├── readme.png ├── 使用和安装说明.txt ├── image ├── 666.jpg ├── go.png ├── no.png ├── ok.png ├── 首页.png ├── coin01.png ├── coin02.png ├── coin03.png ├── coin04.png ├── coin07.png ├── coin08.png ├── coin09.png ├── coin10.png ├── coin11.png ├── coin12.png ├── coin13.png ├── coin14.png ├── coin15.png ├── coin16.png ├── coin17.png ├── coin18.png ├── coin19.png ├── coin20.png ├── coin21.png ├── coinL1.png ├── coinL2.png ├── delete.png ├── fail.gif ├── logPwd.png ├── logYZM.png ├── logo.jpg ├── logo.png ├── sqlops.png ├── topic.png ├── update.png ├── SQL语言校验.png ├── coin111.png ├── coin222.png ├── logLOGO.png ├── logName.png ├── logo.jpg_bak ├── shanchu.png ├── logBanner.png └── sqlops_chatgpt.png ├── sqlparser.tgz ├── binlog2sql.tgz ├── xadmin ├── images │ ├── bg.png │ └── aiwrap.png ├── fonts │ ├── iconfont.eot │ ├── iconfont.ttf │ └── iconfont.woff ├── lib │ └── layui │ │ ├── font │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ │ ├── images │ │ └── face │ │ │ ├── 0.gif │ │ │ ├── 1.gif │ │ │ ├── 10.gif │ │ │ ├── 11.gif │ │ │ ├── 12.gif │ │ │ ├── 13.gif │ │ │ ├── 14.gif │ │ │ ├── 15.gif │ │ │ ├── 16.gif │ │ │ ├── 17.gif │ │ │ ├── 18.gif │ │ │ ├── 19.gif │ │ │ ├── 2.gif │ │ │ ├── 20.gif │ │ │ ├── 21.gif │ │ │ ├── 22.gif │ │ │ ├── 23.gif │ │ │ ├── 24.gif │ │ │ ├── 25.gif │ │ │ ├── 26.gif │ │ │ ├── 27.gif │ │ │ ├── 28.gif │ │ │ ├── 29.gif │ │ │ ├── 3.gif │ │ │ ├── 30.gif │ │ │ ├── 31.gif │ │ │ ├── 32.gif │ │ │ ├── 33.gif │ │ │ ├── 34.gif │ │ │ ├── 35.gif │ │ │ ├── 36.gif │ │ │ ├── 37.gif │ │ │ ├── 38.gif │ │ │ ├── 39.gif │ │ │ ├── 4.gif │ │ │ ├── 40.gif │ │ │ ├── 41.gif │ │ │ ├── 42.gif │ │ │ ├── 43.gif │ │ │ ├── 44.gif │ │ │ ├── 45.gif │ │ │ ├── 46.gif │ │ │ ├── 47.gif │ │ │ ├── 48.gif │ │ │ ├── 49.gif │ │ │ ├── 5.gif │ │ │ ├── 50.gif │ │ │ ├── 51.gif │ │ │ ├── 52.gif │ │ │ ├── 53.gif │ │ │ ├── 54.gif │ │ │ ├── 55.gif │ │ │ ├── 56.gif │ │ │ ├── 57.gif │ │ │ ├── 58.gif │ │ │ ├── 59.gif │ │ │ ├── 6.gif │ │ │ ├── 60.gif │ │ │ ├── 61.gif │ │ │ ├── 62.gif │ │ │ ├── 63.gif │ │ │ ├── 64.gif │ │ │ ├── 65.gif │ │ │ ├── 66.gif │ │ │ ├── 67.gif │ │ │ ├── 68.gif │ │ │ ├── 69.gif │ │ │ ├── 7.gif │ │ │ ├── 70.gif │ │ │ ├── 71.gif │ │ │ ├── 8.gif │ │ │ └── 9.gif │ │ ├── css │ │ ├── modules │ │ │ ├── layer │ │ │ │ └── default │ │ │ │ │ ├── icon.png │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ └── loading-2.gif │ │ │ ├── code.css │ │ │ └── laydate │ │ │ │ └── default │ │ │ │ └── laydate.css │ │ ├── theme11.min.css │ │ ├── theme12.min.css │ │ └── theme49.min.css │ │ ├── lay │ │ └── modules │ │ │ ├── code.js │ │ │ ├── laytpl.js │ │ │ ├── flow.js │ │ │ ├── rate.js │ │ │ ├── tree.js │ │ │ ├── util.js │ │ │ ├── carousel.js │ │ │ ├── laypage.js │ │ │ ├── upload.js │ │ │ ├── slider.js │ │ │ └── element.js │ │ └── layui.js ├── css │ └── font.css └── js │ └── cookie.js ├── index.html ├── main.php ├── sqladvisor ├── css │ ├── lib │ │ ├── chosen │ │ │ ├── chosen-sprite.png │ │ │ └── chosen-sprite@2x.png │ │ ├── vector-map │ │ │ └── jqvmap.min.css │ │ └── datatable │ │ │ ├── dataTables.bootstrap.min.css │ │ │ └── buttons.bootstrap.min.css │ ├── font-awesome │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ └── normalize.css ├── sqladvisor_result.php └── sqladvisor.php ├── login.php ├── conn.php ├── db_config.php ├── order_number.php ├── sql_statement_error.php ├── sqladvisor_config.php ├── cancel.php ├── sql_statement.php ├── cancel_status.php ├── signup.php ├── mail └── mail.php ├── css └── ace.min.css ├── stat ├── intercept_graph_getdata.php ├── sql_order_graph_getdata.php ├── intercept_stat.html └── sql_order_stat.html ├── send_reset_pass_mail.php ├── update.php ├── update_status.php ├── execute.php ├── login.html ├── time.php ├── forgot_password.html ├── sql_check.php ├── register.html ├── rollback.php ├── resetUserPass.php ├── pt_osc_real_time_output.php ├── sqlops_schema └── sqlops_schema.sql ├── execute_status.php ├── member.php ├── intercept_order.php ├── my_order.php ├── README.md ├── sql_interface.php ├── finish_order.php ├── readme.html └── wait_order.php /readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/readme.png -------------------------------------------------------------------------------- /使用和安装说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/使用和安装说明.txt -------------------------------------------------------------------------------- /image/666.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/666.jpg -------------------------------------------------------------------------------- /image/go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/go.png -------------------------------------------------------------------------------- /image/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/no.png -------------------------------------------------------------------------------- /image/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/ok.png -------------------------------------------------------------------------------- /image/首页.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/首页.png -------------------------------------------------------------------------------- /sqlparser.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqlparser.tgz -------------------------------------------------------------------------------- /binlog2sql.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/binlog2sql.tgz -------------------------------------------------------------------------------- /image/coin01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin01.png -------------------------------------------------------------------------------- /image/coin02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin02.png -------------------------------------------------------------------------------- /image/coin03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin03.png -------------------------------------------------------------------------------- /image/coin04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin04.png -------------------------------------------------------------------------------- /image/coin07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin07.png -------------------------------------------------------------------------------- /image/coin08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin08.png -------------------------------------------------------------------------------- /image/coin09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin09.png -------------------------------------------------------------------------------- /image/coin10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin10.png -------------------------------------------------------------------------------- /image/coin11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin11.png -------------------------------------------------------------------------------- /image/coin12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin12.png -------------------------------------------------------------------------------- /image/coin13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin13.png -------------------------------------------------------------------------------- /image/coin14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin14.png -------------------------------------------------------------------------------- /image/coin15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin15.png -------------------------------------------------------------------------------- /image/coin16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin16.png -------------------------------------------------------------------------------- /image/coin17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin17.png -------------------------------------------------------------------------------- /image/coin18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin18.png -------------------------------------------------------------------------------- /image/coin19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin19.png -------------------------------------------------------------------------------- /image/coin20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin20.png -------------------------------------------------------------------------------- /image/coin21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin21.png -------------------------------------------------------------------------------- /image/coinL1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coinL1.png -------------------------------------------------------------------------------- /image/coinL2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coinL2.png -------------------------------------------------------------------------------- /image/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/delete.png -------------------------------------------------------------------------------- /image/fail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/fail.gif -------------------------------------------------------------------------------- /image/logPwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logPwd.png -------------------------------------------------------------------------------- /image/logYZM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logYZM.png -------------------------------------------------------------------------------- /image/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logo.jpg -------------------------------------------------------------------------------- /image/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logo.png -------------------------------------------------------------------------------- /image/sqlops.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/sqlops.png -------------------------------------------------------------------------------- /image/topic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/topic.png -------------------------------------------------------------------------------- /image/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/update.png -------------------------------------------------------------------------------- /image/SQL语言校验.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/SQL语言校验.png -------------------------------------------------------------------------------- /image/coin111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin111.png -------------------------------------------------------------------------------- /image/coin222.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/coin222.png -------------------------------------------------------------------------------- /image/logLOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logLOGO.png -------------------------------------------------------------------------------- /image/logName.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logName.png -------------------------------------------------------------------------------- /image/logo.jpg_bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logo.jpg_bak -------------------------------------------------------------------------------- /image/shanchu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/shanchu.png -------------------------------------------------------------------------------- /image/logBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/logBanner.png -------------------------------------------------------------------------------- /xadmin/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/images/bg.png -------------------------------------------------------------------------------- /image/sqlops_chatgpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/image/sqlops_chatgpt.png -------------------------------------------------------------------------------- /xadmin/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/fonts/iconfont.eot -------------------------------------------------------------------------------- /xadmin/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/fonts/iconfont.ttf -------------------------------------------------------------------------------- /xadmin/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/fonts/iconfont.woff -------------------------------------------------------------------------------- /xadmin/images/aiwrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/images/aiwrap.png -------------------------------------------------------------------------------- /xadmin/lib/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/font/iconfont.eot -------------------------------------------------------------------------------- /xadmin/lib/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /xadmin/lib/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/font/iconfont.woff -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/0.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/1.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/10.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/11.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/12.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/13.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/14.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/15.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/16.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/17.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/18.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/19.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/2.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/20.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/21.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/22.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/23.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/24.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/25.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/26.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/27.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/28.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/29.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/3.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/30.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/31.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/32.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/33.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/34.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/35.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/36.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/37.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/38.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/39.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/4.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/40.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/41.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/42.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/43.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/44.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/45.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/46.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/47.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/48.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/49.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/5.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/50.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/51.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/52.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/53.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/54.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/55.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/56.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/57.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/58.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/59.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/6.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/60.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/61.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/62.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/63.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/64.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/65.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/66.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/67.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/68.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/69.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/7.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/70.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/71.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/8.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/images/face/9.gif -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /main.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /sqladvisor/css/lib/chosen/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/lib/chosen/chosen-sprite.png -------------------------------------------------------------------------------- /sqladvisor/css/lib/chosen/chosen-sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/lib/chosen/chosen-sprite@2x.png -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /sqladvisor/css/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/xadmin/lib/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /sqladvisor/css/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /sqladvisor/css/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /sqladvisor/css/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /sqladvisor/css/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hcymysql/sqlops/HEAD/sqladvisor/css/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /conn.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /db_config.php: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /order_number.php: -------------------------------------------------------------------------------- 1 | 23 | 24 | -------------------------------------------------------------------------------- /sql_statement_error.php: -------------------------------------------------------------------------------- 1 | "; 19 | echo "
".$row[1]."

"; 20 | ?> 21 | -------------------------------------------------------------------------------- /sqladvisor_config.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /xadmin/css/font.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'iconfont'; 3 | src: url('../fonts/iconfont.eot'); 4 | src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'), 5 | url('../fonts/iconfont.woff') format('woff'), 6 | url('../fonts/iconfont.ttf') format('truetype'), 7 | url('../fonts/iconfont.svg#iconfont') format('svg'); 8 | } 9 | .iconfont{ 10 | font-family:"iconfont" !important; 11 | font-size:16px;font-style:normal; 12 | -webkit-font-smoothing: antialiased; 13 | -webkit-text-stroke-width: 0.2px; 14 | -moz-osx-font-smoothing: grayscale; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /cancel.php: -------------------------------------------------------------------------------- 1 | 14 |
15 | 20 | 21 | 22 |
23 | 24 | -------------------------------------------------------------------------------- /sql_statement.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | "; 24 | echo "
".$row[1]."

"; 25 | ?> 26 | -------------------------------------------------------------------------------- /xadmin/lib/layui/css/theme11.min.css: -------------------------------------------------------------------------------- 1 | body.index{background:rgba(0,0,0,0) !important;}.container{background:#323640 !important;}.container .layui-nav-bar{background:rgb(95, 184, 120) !important;}.container .logo a{background:rgba(0,0,0,0) !important;}.container .logo a{color:rgb(255, 255, 255) !important;}.left-nav{background:rgba(255, 255, 255, 1) !important;}.left-nav a{color:rgb(51, 51, 51) !important;}.left-nav a:hover,.left-nav a.active{background:#786aed !important;}.left-nav a:hover,.left-nav a.active{color:rgba(255, 255, 255, 1) !important;}.left-nav a:hover,.left-nav a.active{border-color:#009688 !important;}body{background:rgb(241, 241, 241) !important;} -------------------------------------------------------------------------------- /xadmin/lib/layui/css/theme12.min.css: -------------------------------------------------------------------------------- 1 | body.index{background:rgba(0,0,0,0) !important;}.container{background:rgba(204, 0, 0, 1) !important;}.container .layui-nav-bar{background:rgb(95, 184, 120) !important;}.container .logo a{background:rgba(0,0,0,0) !important;}.container .logo a{color:rgb(255, 255, 255) !important;}.left-nav{background:rgb(238, 238, 238) !important;}.left-nav a{color:rgb(51, 51, 51) !important;}.left-nav a:hover,.left-nav a.active{background:rgba(204, 0, 0, 1) !important;}.left-nav a:hover,.left-nav a.active{color:rgb(255, 255, 255) !important;}.left-nav a:hover,.left-nav a.active{border-color:rgba(255, 140, 0, 1) !important;}body{background:rgb(241, 241, 241) !important;} -------------------------------------------------------------------------------- /cancel_status.php: -------------------------------------------------------------------------------- 1 | "; 14 | $q = isset($_GET['q'])? htmlspecialchars($_GET['q']) : ''; 15 | if($q) { 16 | if($q =='是') { 17 | require 'conn.php'; 18 | $sql = "DELETE FROM sql_order_wait WHERE id={$id}"; 19 | if(mysqli_query($conn,$sql)){ 20 | header("location:my_order.php"); 21 | } 22 | else{ 23 | echo "修改失败"; 24 | } 25 | mysqli_close($conn); 26 | } 27 | else{ 28 | echo "不撤销.
"; 29 | header("location:my_order.php"); 30 | } 31 | } 32 | 33 | ?> 34 | -------------------------------------------------------------------------------- /xadmin/lib/layui/css/theme49.min.css: -------------------------------------------------------------------------------- 1 | body.index{background:rgba(0,0,0,0) !important;}.container{background: linear-gradient(to left,rgba(1, 170, 237, 1), rgba(82, 183, 109, 1)) !important;}.container .layui-nav-bar{background:rgb(95, 184, 120) !important;}.container .logo a{background:rgba(0,0,0,0) !important;}.container .logo a{color:rgb(255, 255, 255) !important;}.left-nav{background:rgba(57, 61, 73, 1) !important;}.left-nav a{color:rgba(210, 208, 208, 1) !important;}.left-nav a:hover,.left-nav a.active{background:rgba(30, 159, 255, 1) !important;}.left-nav a:hover,.left-nav a.active{color:rgba(234, 234, 234, 1) !important;}.left-nav a:hover,.left-nav a.active{border-color:rgba(0,0,0,0) !important;}body{background:rgb(241, 241, 241) !important;} -------------------------------------------------------------------------------- /signup.php: -------------------------------------------------------------------------------- 1 | "; 16 | $reslut=mysqli_query($conn,$sign_up);//执行sql 17 | 18 | if (!$reslut){ 19 | die('Error: ' . mysqli_error($conn));//如果sql执行失败输出错误 20 | }else{ 21 | echo "注册成功

";//成功输出注册成功 22 | echo '点击此处 返回 登录页面!
'; 23 | 24 | } 25 | 26 | 27 | 28 | mysqli_close($conn);//关闭数据库 29 | 30 | ?> 31 | -------------------------------------------------------------------------------- /sqladvisor/sqladvisor_result.php: -------------------------------------------------------------------------------- 1 | "; 20 | echo "
"; 21 | 22 | ?> 23 | -------------------------------------------------------------------------------- /sqladvisor/css/lib/vector-map/jqvmap.min.css: -------------------------------------------------------------------------------- 1 | .jqvmap-label, 2 | .jqvmap-pin { 3 | pointer-events: none 4 | } 5 | .jqvmap-label { 6 | position: absolute; 7 | display: none; 8 | -webkit-border-radius: 3px; 9 | -moz-border-radius: 3px; 10 | border-radius: 3px; 11 | background: #292929; 12 | color: #fff; 13 | font-family: sans-serif, Verdana; 14 | font-size: smaller; 15 | padding: 3px 16 | } 17 | .jqvmap-zoomin, 18 | .jqvmap-zoomout { 19 | position: absolute; 20 | left: 10px; 21 | -webkit-border-radius: 3px; 22 | -moz-border-radius: 3px; 23 | border-radius: 3px; 24 | background: #000; 25 | padding: 3px; 26 | color: #fff; 27 | width: 15px; 28 | height: 15px; 29 | cursor: pointer; 30 | line-height: 10px; 31 | text-align: center 32 | } 33 | .jqvmap-zoomin { 34 | top: 10px 35 | } 36 | .jqvmap-zoomout { 37 | top: 30px 38 | } 39 | .jqvmap-region { 40 | cursor: pointer 41 | } 42 | .jqvmap-ajax_response { 43 | width: 100%; 44 | height: 500px 45 | } -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /mail/mail.php: -------------------------------------------------------------------------------- 1 | order_id = $order_id; 13 | $this->dev_user = $dev_user; 14 | $this->dev_user_mail = $dev_user_mail; 15 | $this->sql_order = $sql_order; 16 | $this->dbname = $dbname; 17 | $this->approver = $approver; 18 | } 19 | 20 | function execCommand(){ 21 | //$SUBJECT_NAME=`echo -n 数据运维工单处理提醒 | base64`; 22 | //$SUBJECT="=?utf-8?b?{$SUBJECT_NAME}?="; 23 | $SUBJECT='数据运维工单处理提醒'; 24 | system("./mail/sendEmail -f chunyang_he@126.com -t {$this->approver} -cc {$this->dev_user_mail} -s smtp.126.com:25 -u '$SUBJECT' -o message-charset=utf8 -o message-content-type=html -m '工单号:{$this->order_id}
工单名称:{$this->sql_order}
工单提交人:{$this->dev_user}
数据库名:{$this->dbname}
需要您进行审核及实施,请登录SQL自动审核平台查看并处理!' -xu chunyang_he@126.com -xp '123456' -o tls=no"); 25 | } 26 | } 27 | 28 | ?> 29 | -------------------------------------------------------------------------------- /css/ace.min.css: -------------------------------------------------------------------------------- 1 | html{min-height:100%;position:relative}body{background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8',endColorstr='#ffececec',GradientType=0)}.table thead tr th{border-color:#DDD;font-weight:bold}.table thead tr th [class*="icon-"]:first-child{margin-right:2px}.table thead tr th:first-child{border-left-color:#f1f1f1}.table thead tr th:left-child{border-right-color:#f1f1f1}.table.table-bordered thead tr th{vertical-align:middle}.table.table-bordered thead tr th:first-child{border-left-color:#DDD}th.center,td.center{text-align:center}th .lbl,td .lbl{margin-bottom:0}th .lbl:only-child,td .lbl:only-child{vertical-align:top}.table-header{background-color:#307ecc;color:#FFF;font-size:14px;line-height:38px;padding-left:12px;margin-bottom:1px}.table-header .close{margin-right:8px;margin-top:0;opacity:.45;filter:alpha(opacity=45)}.table-header .close:hover{opacity:.75;filter:alpha(opacity=75)}.dataTables_length select{width:70px;height:25px;padding:2px 3px}.dataTables_length label{font-weight:normal}.dataTables_filter{text-align:right}.dataTables_filter input[type=text]{width:125px;height:18px;line-height:18px} 2 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/code.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /stat/intercept_graph_getdata.php: -------------------------------------------------------------------------------- 1 | stat_month = $row['stat_month']; 20 | //$user->user_max = $row['user_max']; 21 | $cons->counts = $row['counts']; 22 | $array[]=$cons; 23 | } 24 | $top_data=json_encode($array); 25 | // echo "{".'"user"'.":".$data."}"; 26 | echo $top_data; 27 | } 28 | 29 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main'; 30 | if (function_exists($fn)) { 31 | call_user_func($fn); 32 | } 33 | */ 34 | 35 | //$ip = $_GET['ip']; 36 | //$dbname = $_GET['dbname']; 37 | //$port = $_GET['port']; 38 | 39 | //index($ip,$dbname,$port); 40 | index(); 41 | 42 | 43 | ?> 44 | 45 | -------------------------------------------------------------------------------- /send_reset_pass_mail.php: -------------------------------------------------------------------------------- 1 | "; 7 | //echo $useremail."
"; 8 | 9 | //echo "请回到你的邮箱:".$useremail."查看修改密码步骤。

"; 10 | 11 | require 'conn.php'; 12 | $sql = "select user,email,pwd from login_user where user = '{$username}' AND email = '{$useremail}'"; 13 | $result = mysqli_query($conn,$sql); 14 | 15 | if (mysqli_num_rows($result) > 0){ 16 | while($row = mysqli_fetch_array($result)) 17 | { 18 | $user_passwd=$row[2]; 19 | } 20 | } else{ //die("email不存在。请核查。"); 21 | echo ""; 22 | } 23 | 24 | $String = base64_encode($username.",".$useremail.",".$find_pwd_time); 25 | 26 | system("./mail/sendEmail -f sqlops@126.com -t {$useremail} -s smtp.126.com -u '你的密码找回信' -o message-charset=utf8 -o message-content-type=html -m '请在10分钟内重置密码,过期链接失效。请不要把这个链接告诉别人,你懂的!

确认密码找回' -xu sqlops@126.com -xp '123456' "); 27 | 28 | echo "

"; 29 | echo "请登录你的邮箱:".$useremail."查看修改密码步骤。

"; 30 | 31 | ?> 32 | -------------------------------------------------------------------------------- /update.php: -------------------------------------------------------------------------------- 1 | "; 15 | $login_user = $_GET['login_user']; 16 | $prvi = $_GET['prvi']; 17 | if($prvi == 2){ 18 | echo "你是内审和安全组的人,没有权限审批工单!
"; 19 | exit; 20 | } 21 | ?> 22 | 32 |
33 | 38 | 39 | 40 | 41 | 42 |
43 | 44 | -------------------------------------------------------------------------------- /stat/sql_order_graph_getdata.php: -------------------------------------------------------------------------------- 1 | =concat(DATE_FORMAT(now(),'%Y'),'-01-01') group by DATE_FORMAT(ops_time,'%Y-%m')"; 9 | 10 | $result1 = mysqli_query($conn,$get_info); 11 | 12 | $array= array(); 13 | class Connections{ 14 | public $stat_month; 15 | public $counts; 16 | } 17 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){ 18 | $cons=new Connections(); 19 | $cons->stat_month = $row['stat_month']; 20 | //$user->user_max = $row['user_max']; 21 | $cons->counts = $row['counts']; 22 | $array[]=$cons; 23 | } 24 | $top_data=json_encode($array); 25 | // echo "{".'"user"'.":".$data."}"; 26 | echo $top_data; 27 | } 28 | 29 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main'; 30 | if (function_exists($fn)) { 31 | call_user_func($fn); 32 | } 33 | */ 34 | 35 | //$ip = $_GET['ip']; 36 | //$dbname = $_GET['dbname']; 37 | //$port = $_GET['port']; 38 | 39 | //index($ip,$dbname,$port); 40 | index(); 41 | 42 | 43 | ?> 44 | 45 | -------------------------------------------------------------------------------- /xadmin/js/cookie.js: -------------------------------------------------------------------------------- 1 | function setCookie(name, value, expires, path, domain, secure) { 2 | if(typeof is_remember!="undefined") 3 | return false; 4 | var today = new Date(); 5 | today.setTime( today.getTime() ); 6 | var expires_date = new Date( today.getTime() + (expires) ); 7 | document.cookie= name + "=" + escape(value) + 8 | ((expires) ? "; expires=" + expires_date.toGMTString() : "") + 9 | ((path) ? "; path=" + path : "") + 10 | ((domain) ? "; domain=" + domain : "") + 11 | ((secure) ? "; secure" : ""); 12 | } 13 | function getCookie(name) { 14 | var dc = document.cookie; 15 | var prefix = name + "="; 16 | var begin = dc.indexOf("; " + prefix); 17 | if (begin == -1) { 18 | begin = dc.indexOf(prefix); 19 | if (begin != 0) return null; 20 | } else { 21 | begin += 2; 22 | } 23 | var end = document.cookie.indexOf(";", begin); 24 | if (end == -1) { 25 | end = dc.length; 26 | } 27 | return unescape(dc.substring(begin + prefix.length, end)); 28 | } 29 | function deleteCookie(name, path, domain) { 30 | if (getCookie(name)) { 31 | document.cookie = name + "=" + 32 | ((path) ? "; path=" + path : "") + 33 | ((domain) ? "; domain=" + domain : "") + 34 | "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /update_status.php: -------------------------------------------------------------------------------- 1 | "; 6 | $q = isset($_GET['q'])? htmlspecialchars($_GET['q']) : ''; 7 | if($q) { 8 | if($q =='是') { 9 | require 'conn.php'; 10 | $sql = "update sql_order_wait set status=1,finish_status=1,approver=(select real_user from login_user where user='{$login_admin_user}') WHERE id={$id}"; 11 | if(mysqli_query($conn,$sql)){ 12 | $sql_get_mail = "select b.email,a.ops_order,a.ops_order_name,b.real_user,a.ops_db from sql_order_wait a join login_user b on a.ops_name = b.user where a.id={$id}"; 13 | $result = mysqli_query($conn,$sql_get_mail); 14 | while($row = mysqli_fetch_array($result)){ 15 | $email_order=$row[0]; 16 | $ops_order=$row[1]; 17 | $ops_order_name=$row[2]; 18 | $real_user=$row[3]; 19 | $ops_db=$row[4]; 20 | 21 | } 22 | system("./mail/sendEmail -f chunyang_he@126.com -t {$email_order} -s smtp.126.com:25 -u '工单号:{$ops_order} 已经完成审批,请执行SQL.' -o message-charset=utf8 -o message-content-type=html -m '工单号:{$ops_order}
工单名称:{$ops_order_name}
工单提交人:{$real_user}
数据库名:{$ops_db}
请登录SQL自动审核平台执行SQL!' -xu chunyang_he@126.com -xp '123456' -o tls=no"); 23 | if($return_status==0){ 24 | header("location:wait_order.php"); 25 | } else { 26 | header("location:finish_order.php"); 27 | } 28 | } 29 | else{ 30 | echo "修改失败"; 31 | } 32 | mysqli_close($conn); 33 | } 34 | else{ 35 | require 'conn.php'; 36 | $sql_no = "update sql_order_wait set status=2,finish_status=0,approver=(select real_user from login_user where user='{$login_admin_user}') WHERE id={$id}"; 37 | if(mysqli_query($conn,$sql_no)){ 38 | echo "不审批.
"; 39 | header("location:wait_order.php"); 40 | } 41 | } 42 | } 43 | mysqli_close($conn); 44 | ?> 45 | 46 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('
'+d+"
");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /execute.php: -------------------------------------------------------------------------------- 1 |
'; 15 | } else { 16 | echo 'Alter更改表结构会引起表锁,影响业务。由于该表过大,平台不支持自助上线。

'; 17 | echo $row['big_table_information'] . "
"; 18 | exit; 19 | } 20 | } 21 | } 22 | 23 | $big_table_dml = "select * from sql_order_wait where id=${id}"; 24 | $result_big_dml = mysqli_query($conn,$big_table_dml); 25 | while($row = mysqli_fetch_array($result_big_dml)){ 26 | if(!empty($row['dml_big_information']) ){ 27 | echo 'Update检索大批量数据会引起大范围行锁,影响业务。平台不支持自助上线。

'; 28 | echo $row['dml_big_information'] . "
"; 29 | exit; 30 | } 31 | } 32 | 33 | ?> 34 | 44 | 45 |
46 | 51 | 52 | 53 | 54 |
55 | -------------------------------------------------------------------------------- /login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sqlops 运管平台登录 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
sqlops 运管平台v2.0
26 |
27 | 28 |
29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 | 37 |

38 | 39 |
40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /time.php: -------------------------------------------------------------------------------- 1 | ".$n; 6 | echo "document.write('
?
');".$n; 7 | echo "var y=".date("Y")."; //年 ".$n; 8 | echo "var m=".date("n")."; //月 ".$n; 9 | echo "var d=".date("j")."; //日 ".$n; 10 | echo "var w=".date("w")."; //星 ".$n; 11 | echo "var h=".date("H")."; //时 ".$n; 12 | echo "var i=".date("i")."; //分 ".$n; 13 | echo "var s=".date("s")."; //秒 ".$n; 14 | echo "var hstr=istr=sstr=a='';".$n; 15 | echo "var ww = Array('日','一','二','三','四','五','六');".$n; 16 | echo "function clock(){".$n; 17 | echo " s++;".$n; 18 | echo " if (s==60) {i+=1;s=0;}//秒进位".$n; 19 | echo " if (i==60) {h+=1;i=0;}//分进位".$n; 20 | echo " if (h==24) {w+=1;d+=1;h=0;}//时进位".$n; 21 | echo " if (w==7) {w=0;}//星期进位".$n; 22 | echo " if (m==2) { //是否是二月份?".$n; 23 | echo " if (!y%4>0) { //不是闰月(二月有28天)".$n; 24 | echo " if (d==30){".$n; 25 | echo " m+=1;".$n; 26 | echo " d=1;}".$n; 27 | echo " }".$n; 28 | echo " else { //是闰月(二月有29天)".$n; 29 | echo " if (d==29){".$n; 30 | echo " m+=1;".$n; 31 | echo " d=1;}".$n; 32 | echo " }".$n; 33 | echo " }".$n; 34 | echo " else { //非2月份的月份".$n; 35 | echo " if (m==4 || m==6 || m==9 || m==11) { //只有30天的月份".$n; 36 | echo " if (d==31) {".$n; 37 | echo " m+=1;".$n; 38 | echo " d=1;}".$n; 39 | echo " }".$n; 40 | echo " else { //有31天的月份".$n; 41 | echo " if (d==32){".$n; 42 | echo " m+=1;".$n; 43 | echo " d=1;}".$n; 44 | echo " }".$n; 45 | echo " }".$n; 46 | echo " if (m==13) {y+=1;m=1;}//月进位".$n; 47 | echo " if (h < 10) {hstr=' 0'+h} else {hstr=' '+h};".$n; 48 | echo " if (i < 10) {istr=':0'+i} else {istr=':'+i};".$n; 49 | echo " if (s < 10) {sstr=':0'+s} else {sstr=':'+s};".$n; 50 | echo " if (h < 13) {astr=' am';} else {astr=' pm';};".$n; 51 | echo " TimeShow.innerHTML= '' +'  '+ y+'年'+m+'月'+d+'日 '+'星期'+ww[w]+hstr+istr+sstr+astr+'';".$n; 52 | echo " setTimeout('clock()',1000);".$n; 53 | echo "}".$n; 54 | echo "clock();".$n; 55 | echo "".$n; 56 | ?> 57 | -------------------------------------------------------------------------------- /forgot_password.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 找回密码 7 | 20 | 21 | 22 | 23 | 24 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
重置密码
40 |

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 53 | 54 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 69 | 70 | 72 | 73 | 74 | 75 | 76 | 77 |
用户名: 49 | 输入你的登录用户名
电子邮件: 输入你的真实邮件地址,SQL上线平台会发送邮件给你重置密码。
68 |
71 |
 
78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /sql_check.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | &1";} 17 | 18 | if(preg_match("/^create/i",trim($multi_key_sql[$x]))){ 19 | $create_temp=preg_replace("/^create/i","CREATE TEMPORARY",trim($multi_key_sql[$x])); 20 | $dbsql_exec="/usr/local/mariadb/bin/mysql --default-character-set=utf8 --skip-column-names -h$ip -u$user -p"."'".$pwd."'"." -P$port tmp --execute=\"${create_temp};\" 2>&1"; 21 | } 22 | 23 | if(preg_match("/^alter/i",trim($multi_key_sql[$x]))){ 24 | $dbsql_exec="/usr/local/mariadb/bin/mysql --default-character-set=utf8 --skip-column-names -h$ip -u$user -p"."'".$pwd."'"." -P$port tmp --execute=\"${multi_sql[$x]};\" 2>&1"; 25 | } 26 | 27 | $exec_result=exec("$dbsql_exec",$output,$return); 28 | //print_r($output); 29 | //echo $dbsql_exec."
"; 30 | 31 | if(!empty($multi_key_sql[$x])){ 32 | if(preg_match("/^alter/i",trim($multi_key_sql[$x]))){ 33 | if(preg_match("/ERROR 1064|ERROR 1146/",$output[0])){ 34 | echo "   

检测出SQL语句有错误,报错信息如下:

"; 35 | echo "   ".$output[0]."
"; 36 | array_splice($output, 0, count($output)); 37 | exit; 38 | } 39 | } 40 | if (!preg_match("/^alter/i",trim($multi_key_sql[$x])) && $return == 1){ 41 | echo "   

检测出SQL语句有错误,报错信息如下:

"; 42 | echo "   ".$output[0]."
"; 43 | array_splice($output, 0, count($output)); 44 | exit; 45 | } 46 | } 47 | 48 | array_splice($output, 0, count($output)); 49 | 50 | ?> 51 | -------------------------------------------------------------------------------- /register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 用户注册 7 | 20 | 21 | 22 | 23 | 24 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
用户注册
40 |

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 53 | 54 | 55 | 57 | 58 | 59 | 60 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 80 | 81 | 83 | 84 | 85 | 86 | 87 | 88 |
用户名: 49 | 你的姓名拼音全拼
密码: 56 | 最少6个字符
姓名:你的真实中文名字
电子邮件: 请输入有效的邮件地址,SQL审批通过后会发送邮件给你。
79 |
82 |
 
89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='"+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /rollback.php: -------------------------------------------------------------------------------- 1 |
"; 29 | echo "你刚才上线时的SQL如下:
"; 30 | echo '
' .$ops_content. '
'; 31 | echo "
"; 32 | echo "
"; 33 | echo "生成反向SQL如下:
"; 34 | 35 | //print_r($binlog_information); 36 | 37 | //后端MySQL 5.6+ 38 | $rollback_sql="/usr/bin/python /var/www/html/sqlops/binlog2sql/binlog2sql.py --flashback -h${ip} -u${user} -p'${pwd}' -P${port} --start-file='$binlog_information[0]' --stop-file='$binlog_information[3]' --start-position='$binlog_information[1]' --stop-position='$binlog_information[4]'"; 39 | 40 | //后端MariaDB 41 | //$rollback_sql="cd /root/binlog2sql/binlog2sql;/usr/bin/python binlog2sql.py --flashback -h${ip} -u${user} -p'${pwd}' -P${port} --start-file='$binlog_information[0]' --stop-file='$binlog_information[2]' --start-position='$binlog_information[1]' --stop-position='$binlog_information[3]'"; 42 | 43 | //echo $rollback_sql; 44 | 45 | 46 | ##########执行回滚################### 47 | $remote_user="root"; 48 | $remote_password="123456"; 49 | $script=$rollback_sql; 50 | $connection = ssh2_connect('127.0.0.1',22); 51 | ssh2_auth_password($connection,$remote_user,$remote_password); 52 | $stream = ssh2_exec($connection,$script,NULL,$env=array(),10,10); 53 | $correctStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO); 54 | $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); 55 | //stream_set_blocking($errorStream, true); 56 | stream_set_blocking($correctStream, true); 57 | $message=stream_get_contents($errorStream); 58 | $measage_stdio=stream_get_contents($correctStream); 59 | 60 | echo $message."
"; 61 | echo '
' .nl2br($measage_stdio). '
'."
"; 62 | //echo nl2br(nl2br($measage_stdio)) . "
"; 63 | echo "
"; 64 | echo "点击返回工单界面

"; 65 | fclose($stream); 66 | fclose($errorStream); 67 | ####################################### 68 | ?> 69 | 70 | -------------------------------------------------------------------------------- /resetUserPass.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 重置密码 7 | 20 | 21 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
重置密码
41 |

42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 |
输入新的密码: 50 | 最少6个字符
59 |
62 |
 
69 | 70 | "; 79 | //echo $array[2]."
"; 80 | 81 | if($minute >=10){ 82 | die("

你的激活有效期已超过10分钟,请输入你的帐号重新发送激活邮件。


"); 83 | } 84 | 85 | if(isset($_POST['submit'])){ 86 | 87 | $new_pwd=$_POST['password']; 88 | if(strlen($new_pwd)<6){ 89 | echo ""; 90 | } 91 | 92 | require 'con.php'; 93 | 94 | $update_pwd="UPDATE login_user set pwd=MD5('$new_pwd') where user = '{$array[0]}' AND email = '{$array[1]}'"; 95 | //echo $update_pwd."
"; 96 | mysqli_query($con,$update_pwd); 97 | if (mysqli_affected_rows($con) >0){ 98 | echo "

密码已经成功更新!


"; 99 | echo "

点击此处 登录


"; 100 | } else{ 101 | echo "

密码更新失败!


"; 102 | } 103 | } 104 | 105 | ?> 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /stat/intercept_stat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | SQL工单拦截统计 4 | 5 | 6 | 7 | 8 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /stat/sql_order_stat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | SQL工单数量统计 4 | 5 | 6 | 7 | 8 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /pt_osc_real_time_output.php: -------------------------------------------------------------------------------- 1 | 表结构正在变更,请耐心等待,期间不要关闭浏览器!执行进度会自动刷新。

"; 9 | 10 | function liveExecuteCommand($cmd) 11 | { 12 | 13 | while (@ ob_end_flush()); // end all output buffers if any 14 | 15 | $proc = popen("$cmd 2>&1 ; echo Exit status : $?", 'r'); 16 | 17 | $live_output = ""; 18 | $complete_output = ""; 19 | 20 | while (!feof($proc)) 21 | { 22 | $live_output = fread($proc, 4096); 23 | $complete_output = $complete_output . $live_output; 24 | $live_output = str_replace("\n","
",$live_output); 25 | echo "$live_output"."
"; 26 | @ flush(); 27 | } 28 | 29 | pclose($proc); 30 | 31 | // get exit status 32 | preg_match('/[0-9]+$/', $complete_output, $matches); 33 | 34 | // return exit status and intended output 35 | return array ( 36 | 'exit_status' => intval($matches[0]), 37 | 'output' => str_replace("Exit status : " . $matches[0], '', $complete_output) 38 | ); 39 | } 40 | 41 | if($q) { 42 | if($q =='是') { 43 | require 'conn.php'; 44 | $result = mysqli_query($conn,"SELECT a.ip,a.dbname,a.user,a.pwd,a.port,b.ops_content,b.is_ddl,b.ops_name FROM dbinfo a join sql_order_wait b on a.dbname = b.ops_db where b.id='".$id ."'"); 45 | 46 | while($row = mysqli_fetch_array($result)) 47 | { 48 | $ip=$row[0]; 49 | $db=$row[1]; 50 | $user=$row[2]; 51 | $pwd=$row[3]; 52 | $port=$row[4]; 53 | $ops_content=$row[5]; 54 | $table_tmp = explode(' ',$ops_content); 55 | $table = $table_tmp[2]; 56 | $sql_cut_tmp = array_slice($table_tmp,3); 57 | $sql_cut_tmp2 = implode(' ',$sql_cut_tmp); 58 | $sql_cut = str_ireplace(';','',$sql_cut_tmp2); 59 | $is_ddl=$row[6]; 60 | $ops_sql=nl2br(htmlspecialchars($row[5],ENT_QUOTES)); 61 | $ops_user=$row[7]; 62 | } 63 | 64 | $result = liveExecuteCommand("/usr/bin/env pt-online-schema-change --host={$ip} --user={$user} --password='{$pwd}' --port={$port} --alter='{$sql_cut}' D={$db},t={$table} --no-check-replication-filters --recursion-method=none --charset=utf8 --max-load='Threads_running=200' --critical-load='Threads_running=200' --execute"); 65 | 66 | if($result['exit_status'] === 0){ 67 | echo "执行命令已经变更完毕。
"; 68 | $sql = "update sql_order_wait set finish_status=2 WHERE id={$id}"; 69 | if(mysqli_query($conn,$sql)){ 70 | echo "
"; 71 | echo "对,就这样,上线成功了!
"; 72 | echo "666"; 73 | echo "

"; 74 | } 75 | mysqli_close($conn); 76 | echo "
"; 77 | echo "点击返回工单界面
"; 78 | } else { 79 | echo "执行出错。

"; 80 | } 81 | } else{ 82 | echo "没有执行.

"; 83 | } 84 | } 85 | 86 | ?> 87 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o(''),s=o(["
  • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
  • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
    '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /sqlops_schema/sqlops_schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `dbinfo` ( 2 | `id` int(11) NOT NULL AUTO_INCREMENT, 3 | `ip` varchar(100) DEFAULT NULL, 4 | `dbname` varchar(100) DEFAULT NULL, 5 | `user` varchar(100) DEFAULT NULL, 6 | `pwd` varchar(100) DEFAULT NULL, 7 | `port` int(11) DEFAULT NULL, 8 | PRIMARY KEY (`id`), 9 | KEY `IX_dbname` (`dbname`) 10 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据库信息表'; 11 | 12 | CREATE TABLE `dbinfo_prvi` ( 13 | `id` int(11) NOT NULL AUTO_INCREMENT, 14 | `dbuser` varchar(50) DEFAULT NULL, 15 | `approver` varchar(50) DEFAULT NULL, 16 | `dbname` varchar(100) DEFAULT NULL, 17 | PRIMARY KEY (`id`), 18 | KEY `dbname` (`dbname`), 19 | KEY `dbuser` (`dbuser`) 20 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='审批权限表'; 21 | 22 | CREATE TABLE `login_user` ( 23 | `id` int(11) NOT NULL AUTO_INCREMENT, 24 | `user` varchar(100) DEFAULT NULL, 25 | `real_user` varchar(100) DEFAULT NULL, 26 | `email` varchar(100) DEFAULT NULL, 27 | `pwd` varchar(256) DEFAULT NULL, 28 | `privilege` int(11) DEFAULT '0' COMMENT '0:普通研发;1:研发经理;100:DBA', 29 | PRIMARY KEY (`id`), 30 | UNIQUE KEY `IX_user` (`user`) 31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户登录表'; 32 | 33 | CREATE TABLE `sql_order_wait` ( 34 | `id` int(11) NOT NULL AUTO_INCREMENT, 35 | `ops_order` bigint(11) NOT NULL COMMENT '工单号', 36 | `ops_name` varchar(100) DEFAULT NULL COMMENT '上线人', 37 | `ops_db` varchar(50) DEFAULT NULL COMMENT '上线DB', 38 | `ops_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上线申请时间', 39 | `ops_order_name` varchar(5000) DEFAULT NULL COMMENT '工单名称', 40 | `ops_reason` varchar(100) DEFAULT NULL COMMENT '上线申请原因', 41 | `ops_content` mediumtext COMMENT 'SQL详细信息', 42 | `status` tinyint(4) DEFAULT '0' COMMENT '0:等待管理员审批,1:审批完毕,2:审批不通过', 43 | `finish_status` tinyint(4) DEFAULT '0' COMMENT '0:未审批不能执行,1:执行,2:执行完毕', 44 | `approver` varchar(100) DEFAULT NULL COMMENT '工单审批人', 45 | `binlog_information` varchar(500) DEFAULT NULL COMMENT 'binlog位置信息记录', 46 | `is_ddl` tinyint(4) DEFAULT NULL COMMENT '0:没有ALTER操作;1:有ALTER操作', 47 | `is_big_table` tinyint(4) DEFAULT '0' COMMENT '是否为大表', 48 | `big_table_information` text COMMENT '不能上线执行DDL警告提示', 49 | `dml_big_information` text COMMENT '不能上线执行DML警告提示', 50 | PRIMARY KEY (`id`), 51 | KEY `ops_name` (`ops_name`), 52 | KEY `ops_time` (`ops_time`), 53 | KEY `IX_ops_order` (`ops_order`) 54 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='工单表'; 55 | 56 | CREATE TABLE `sql_order_error` ( 57 | `id` int(11) NOT NULL AUTO_INCREMENT, 58 | `ops_order` bigint(11) NOT NULL COMMENT '工单号', 59 | `ops_name` varchar(100) DEFAULT NULL, 60 | `ops_db` varchar(50) DEFAULT NULL, 61 | `ops_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 62 | `ops_order_name` varchar(5000) DEFAULT NULL, 63 | `ops_reason` varchar(100) DEFAULT NULL, 64 | `ops_content` mediumtext, 65 | `prompt_message` text, 66 | PRIMARY KEY (`id`), 67 | KEY `ops_name` (`ops_name`), 68 | KEY `ops_time` (`ops_time`) 69 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='工单拦截表'; 70 | 71 | INSERT INTO login_user values(1,'admin','管理员','admin@126.com',MD5('123456'),100); 72 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,a,n="layui-fixbar",r="layui-fixbar-top",o=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['"].join("")),s=g.find("."+r),u=function(){var e=o.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+n)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),a=i.attr("lay-type");"top"===a&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,a)}),o.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var a=this,n="function"==typeof e,r=new Date(t).getTime(),o=new Date(!e||n?(new Date).getTime():e).getTime(),l=r-o,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];n&&(i=e);var g=setTimeout(function(){a.countdown(t,o+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,a=[[],[]],n=(new Date).getTime()-new Date(t).getTime();return n>6912e5?(n=new Date(t),a[0][0]=i.digit(n.getFullYear(),4),a[0][1]=i.digit(n.getMonth()+1),a[0][2]=i.digit(n.getDate()),e||(a[1][0]=i.digit(n.getHours()),a[1][1]=i.digit(n.getMinutes()),a[1][2]=i.digit(n.getSeconds())),a[0].join("-")+" "+a[1].join(":")):n>=864e5?(n/1e3/60/60/24|0)+"天前":n>=36e5?(n/1e3/60/60|0)+"小时前":n>=12e4?(n/1e3/60|0)+"分钟前":n<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var a=t.length;a/g,">").replace(/'/g,"'").replace(/"/g,""")}};!function(t,e,i){"$:nomunge";function a(){n=e[l](function(){r.each(function(){var e=t(this),i=e.width(),a=e.height(),n=t.data(this,g);(i!==n.w||a!==n.h)&&e.trigger(c,[n.w=i,n.h=a])}),a()},o[s])}var n,r=t([]),o=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";o[s]=250,o[u]=!0,t.event.special[c]={setup:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===r.length&&a()},teardown:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.not(e),e.removeData(g),r.length||clearTimeout(n)},add:function(e){function a(e,a,r){var o=t(this),l=t.data(this,g)||{};l.w=a!==i?a:o.width(),l.h=r!==i?r:o.height(),n.apply(this,arguments)}if(!o[u]&&this[l])return!1;var n;return t.isFunction(e)?(n=e,a):(n=e.handler,void(e.handler=a))}}}(e,window),t("util",i)}); -------------------------------------------------------------------------------- /execute_status.php: -------------------------------------------------------------------------------- 1 | "; 6 | $q = isset($_GET['q'])? htmlspecialchars($_GET['q']) : ''; 7 | if($q) { 8 | if($q =='是') { 9 | require 'conn.php'; 10 | $result = mysqli_query($conn,"SELECT a.ip,a.dbname,a.user,a.pwd,a.port,b.ops_content,b.is_ddl,b.ops_name FROM dbinfo a join sql_order_wait b on a.dbname = b.ops_db where b.id='".$id ."'"); 11 | while($row = mysqli_fetch_array($result)) 12 | { 13 | $ip=$row[0]; 14 | $db=$row[1]; 15 | $user=$row[2]; 16 | $pwd=$row[3]; 17 | $port=$row[4]; 18 | $ops_content=$row[5]; 19 | $is_ddl=$row[6]; 20 | //$ops_sql=htmlspecialchars(nl2br($row[5]),ENT_QUOTES); 21 | $ops_sql=nl2br(htmlspecialchars($row[5],ENT_QUOTES)); 22 | $ops_user=$row[7]; 23 | /*echo $ip."
    "; 24 | echo $db."
    "; 25 | echo $user."
    "; 26 | echo $pwd."
    "; 27 | echo $port."
    "; 28 | echo $ops_content."
    ";*/ 29 | } 30 | mysqli_close($conn); 31 | //上线(客户端请使用MySQL 5.5及以下版本,或者MariaDB10版本。) 32 | //MySQL 5.6版本会报Using a password on the command line interface can be insecure警告,导致上线失败。 33 | // --safe-updates 34 | $dbsql_exec="/usr/bin/mysql --default-character-set=utf8 --skip-column-names -h$ip -u$user -p"."'".$pwd."'"." -P$port $db --execute=\"SET transaction_isolation = 'REPEATABLE-READ';START TRANSACTION WITH CONSISTENT SNAPSHOT;SHOW MASTER STATUS;".$ops_content.";COMMIT;SHOW MASTER STATUS;"."\" 2>&1" ; 35 | 36 | //echo $dbsql_exec."
    "; 37 | 38 | ##########上线执行################### 39 | echo "
    "; 40 | $exec_result=exec("$dbsql_exec",$output,$return); 41 | $b=$e=array(); 42 | foreach($output as $v){ 43 | if(preg_match("/mysql.*/",$v)){ 44 | array_push($b,$v); 45 | } else{ 46 | array_push($e,$v); 47 | } 48 | } 49 | 50 | if ($return == 0){ 51 | $input_binlog=$b[0]."\n".$b[1]."\n"; 52 | require 'conn.php'; 53 | $sql = "update sql_order_wait set finish_status=2,binlog_information='{$input_binlog}' WHERE id={$id}"; 54 | //echo $sql; 55 | if(mysqli_query($conn,$sql)){ 56 | echo "
    "; 57 | echo "对,就这样,上线成功了!
    "; 58 | echo "666"; 59 | echo "

    "; 60 | } 61 | mysqli_close($conn); 62 | //header("refresh:3;location:wait_order.php"); 63 | if($is_ddl == 1){ 64 | $exec_time=date("Y-m-d H:i:s"); 65 | system("./mail/sendEmail -f chunyang_he@126.com -t sqlops@126.com -s smtp.126.com:25 -u '【通知】{$db}库【Alter】操作已经上线完毕-{$exec_time}' -o message-charset=utf8 -o message-content-type=html -m '上线人:{$ops_user}

    上线的SQL是:{$ops_sql}

    数据库名:{$db}

    执行时间:{$exec_time}' -xu sqlops@126.com -xp '123456' -o tls=no"); 66 | } 67 | echo "
    "; 68 | echo "点击返回工单界面
    "; 69 | } 70 | else{ 71 | echo "
    "; 72 | if($e[0] == NULL){ 73 | echo "
    由于提交的SQL过多,PHP在传入参数变量时,内存溢出导致,可通知DBA手工执行。
    "; 74 | } 75 | echo $e[0]."
    "; 76 | echo "

    上线失败!


    "; 77 | echo "fail"; 78 | } 79 | ####################################### 80 | 81 | /*$sql = "update sql_order_wait set status=1,finish_status=1 WHERE id={$id}"; 82 | if(mysqli_query($con,$sql)){ 83 | header("location:wait_order.php"); 84 | } 85 | else{ 86 | echo "修改失败"; 87 | }*/ 88 | //mysql_close($con); 89 | } 90 | else{ 91 | echo "没有执行.
    "; 92 | } 93 | } 94 | 95 | ?> 96 | -------------------------------------------------------------------------------- /sqladvisor/sqladvisor.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | SQL自助查询优化 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
    32 |
    33 |

    注:选择你的数据库,然后提交SQL,平台会自动返回优化建议。例如你可以将线上跑的比较慢的SQL,拿到平台里执行,平台会根据你的SQL自动反馈优化建议。同时,你也可以关注“监控管理”-->“MySQL慢查询分析” ,来查看线上抓取的慢SQL。

    34 |
    35 | SQL自助查询优化(自动反馈优化建议) 36 |
    37 |
    38 |
    39 |
    40 |
    41 |
    42 | 43 | 52 | 62 |
    63 |
    64 | 65 |
    66 |
    67 |
    68 |
    69 | 70 |
    71 | 72 |
    73 |
    74 |
    75 |
    76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
      ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
    "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a 2 | 3 | 4 | 5 | 6 | 会员信息统计 7 | 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 16 | 46 |

    会员信息总计:

    47 |
    48 |
    49 |
    50 | 51 | "; 62 | echo " 63 | 会员id 64 | 登录名 65 | 真实姓名 66 | 邮箱 67 | 备注"; 68 | 69 | while($row = mysql_fetch_array($result)) 70 | { 71 | echo ""; 72 | echo "{$row['id']}"; 73 | echo "{$row['user']}"; 74 | echo "{$row['real_user']}"; 75 | echo "{$row['email']}"; 76 | if($row['privilege'] == 0) 77 | { 78 | echo "开发上线人
    "; 79 | } else if($row['privilege'] == 1) 80 | { 81 | echo "业务方审批人
    "; 82 | } else if($row['privilege'] == 2) 83 | { 84 | echo "安全和内审人
    "; 85 | } else if($row['privilege'] == 3) 86 | { 87 | echo "大数据审批人
    "; 88 | }else { 89 | echo "后台管理员
    "; 90 | } 91 | echo ""; 92 | } 93 | echo ""; 94 | echo "
    "; 95 | echo "
    "; 96 | echo "
    "; 97 | 98 | $maxPageCount=10; 99 | $buffCount=2; 100 | $startPage=1; 101 | 102 | if ($page< $buffCount){ 103 | $startPage=1; 104 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 105 | $startPage=$page-$buffCount+1; 106 | }else{ 107 | $startPage=$totalPage-$maxPageCount+1; 108 | } 109 | 110 | $endPage=$startPage+$maxPageCount-1; 111 | 112 | 113 | $htmlstr=""; 114 | 115 | $htmlstr.=""; 116 | if ($page > 1){ 117 | $htmlstr.=""; 118 | $htmlstr.=""; 119 | } 120 | 121 | $htmlstr.=""; 122 | 123 | for ($i=$startPage;$i<=$endPage; $i++){ 124 | 125 | $htmlstr.=""; 126 | } 127 | 128 | if ($page<$totalPage){ 129 | $htmlstr.=""; 130 | $htmlstr.=""; 131 | 132 | } 133 | $htmlstr.="
    第一页 上一页 总共${totalPage}页" . $i . "下一页最后页
    "; 134 | echo $htmlstr; 135 | 136 | ?> 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /sqladvisor/css/lib/datatable/dataTables.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important;border-collapse:separate !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:0.85em;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap;justify-content:flex-end}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:before,table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:before,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:before,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:before,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:0.9em;display:block;opacity:0.3}table.dataTable thead .sorting:before,table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_desc:before,table.dataTable thead .sorting_asc_disabled:before,table.dataTable thead .sorting_desc_disabled:before{right:1em;content:"\2191"}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{right:0.5em;content:"\2193"}table.dataTable thead .sorting_asc:before,table.dataTable thead .sorting_desc:after{opacity:1}table.dataTable thead .sorting_asc_disabled:before,table.dataTable thead .sorting_desc_disabled:after{opacity:0}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot>.dataTables_scrollFootInner{box-sizing:content-box}div.dataTables_scrollFoot>.dataTables_scrollFootInner>table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-sm>thead>tr>th{padding-right:20px}table.dataTable.table-sm .sorting:before,table.dataTable.table-sm .sorting_asc:before,table.dataTable.table-sm .sorting_desc:before{top:5px;right:0.85em}table.dataTable.table-sm .sorting:after,table.dataTable.table-sm .sorting_asc:after,table.dataTable.table-sm .sorting_desc:after{top:5px}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0} -------------------------------------------------------------------------------- /intercept_order.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 触碰规则拦截SQL工单汇总 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

      非法访问!你没有权限审批工单!


    "; 34 | //echo ''; 35 | exit; 36 | } 37 | ?> 38 | 39 | 40 |
    41 |
    42 |

    系统拦截工单查询

    43 |
    44 | 45 |
    46 |
    47 | 48 | 0) { 69 | $sql ="select a.*,b.real_user from sql_order_error a join login_user b on a.ops_name = b.user order by id DESC limit $startCount,$perNumber"; 70 | } 71 | $result = mysqli_query($conn,$sql); 72 | 73 | echo ""; 74 | echo " 75 | 76 | 77 | 78 | 79 | 80 | 81 | "; 82 | 83 | while($row = mysqli_fetch_array($result)) 84 | { 85 | $exec_status = $row['status']; 86 | $exec_status_second = $row['status_second']; 87 | $exec_finish_status = $row['finish_status']; 88 | $exec_finish_status_second = $row['finish_status_second']; 89 | echo ""; 90 | echo ""; 91 | echo ""; 92 | echo ""; 93 | echo ""; 94 | echo ""; 95 | echo ""; 96 | echo ""; 97 | echo ""; 98 | }//end while 99 | echo "
    工单号申请人数据库名申请时间工单名称申请原因审批结果
    {$row['ops_order']}{$row['real_user']}{$row['ops_db']}{$row['ops_time']}{$row['ops_order_name']}{$row['ops_reason']}被系统拦截
    "; 100 | echo "
    "; 101 | echo "
    "; 102 | echo "
    "; 103 | 104 | $maxPageCount=10; 105 | $buffCount=2; 106 | $startPage=1; 107 | 108 | if ($page< $buffCount){ 109 | $startPage=1; 110 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 111 | $startPage=$page-$buffCount+1; 112 | }else{ 113 | $startPage=$totalPage-$maxPageCount+1; 114 | } 115 | 116 | $endPage=$startPage+$maxPageCount-1; 117 | 118 | 119 | $htmlstr=""; 120 | 121 | $htmlstr.=""; 122 | if ($page > 1){ 123 | $htmlstr.=""; 124 | $htmlstr.=""; 125 | } 126 | 127 | $htmlstr.=""; 128 | 129 | for ($i=$startPage;$i<=$endPage; $i++){ 130 | 131 | $htmlstr.=""; 132 | } 133 | 134 | if ($page<$totalPage){ 135 | $htmlstr.=""; 136 | $htmlstr.=""; 137 | 138 | } 139 | $htmlstr.="
    第一页 上一页 总共${totalPage}页" . $i . "下一页最后页
    "; 140 | echo $htmlstr; 141 | 142 | ?> 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /my_order.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 数据库上线工单查询 8 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
    26 |
    27 |

    数据库上线工单查询

    28 |
    29 | 30 |
    31 |
    32 | 33 | 0) { 56 | $sql ="select a.*,b.real_user from sql_order_wait a join login_user b on a.ops_name = b.user where a.ops_name = '${login_user}' order by id DESC limit $startCount,$perNumber"; 57 | } else{ 58 | $sql ="select a.*,b.real_user from sql_order_wait a join login_user b on a.ops_name = b.user where a.ops_name = '${login_user}' order by id DESC limit $startCount,$perNumber"; 59 | } 60 | 61 | $result = mysqli_query($conn,$sql); 62 | 63 | echo ""; 64 | echo " 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | "; 74 | while($row = mysqli_fetch_array($result)) 75 | { 76 | $status = $row['status']?"已审批":"待审批"; 77 | $exec_status = $row['status']; 78 | $exec_status_second = $row['status_second']; 79 | $exec_finish_status = $row['finish_status']; 80 | $exec_finish_status_second = $row['finish_status_second']; 81 | 82 | echo ""; 83 | echo ""; 84 | echo ""; 85 | echo ""; 86 | echo ""; 87 | echo ""; 88 | echo ""; 89 | 90 | if($exec_status==1){ 91 | echo ""; 93 | } else if($exec_status==2){ 94 | echo ""; 96 | } else{ 97 | echo ""; 98 | } 99 | 100 | ####################################################### 101 | if($exec_finish_status==1){ 102 | echo ""; 105 | } 106 | else if($exec_finish_status==2){ 107 | echo ""; 109 | } 110 | else{ 111 | echo ""; 113 | } 114 | echo ""; 115 | 116 | } //end while 117 | echo "
    工单号申请人数据库名申请时间工单名称上线理由审批结果操作
    {$row['ops_order']}{$row['real_user']}{$row['ops_db']}{$row['ops_time']}{$row['ops_order_name']}{$row['ops_reason']}$status
    92 | 审批人:{$row['approver']}
    审批不通过
    95 | 审批人:{$row['approver']}
    等待审批中执行工单 103 |
    104 | 自行撤销工单
    已执行
    "; 108 | echo "生成反向SQL
    没审批不能执行
    "; 112 | echo "自行撤销工单
    "; 118 | echo "
    "; 119 | echo "
    "; 120 | echo "
    "; 121 | 122 | $maxPageCount=10; 123 | $buffCount=2; 124 | $startPage=1; 125 | 126 | if ($page< $buffCount){ 127 | $startPage=1; 128 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 129 | $startPage=$page-$buffCount+1; 130 | }else{ 131 | $startPage=$totalPage-$maxPageCount+1; 132 | } 133 | 134 | $endPage=$startPage+$maxPageCount-1; 135 | 136 | 137 | $htmlstr=""; 138 | 139 | $htmlstr.=""; 140 | if ($page > 1){ 141 | $htmlstr.=""; 142 | $htmlstr.=""; 143 | } 144 | for ($i=$startPage;$i<=$endPage; $i++){ 145 | 146 | $htmlstr.=""; 147 | } 148 | 149 | if ($page<$totalPage){ 150 | $htmlstr.=""; 151 | $htmlstr.=""; 152 | 153 | } 154 | $htmlstr.="
    第一页 上一页" . $i . "下一页最后页
    "; 155 | echo $htmlstr; 156 | 157 | ?> 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![image](https://raw.githubusercontent.com/hcymysql/sqlops/master/image/sqlops_chatgpt.png) 2 | 3 | # 安装视频: 4 | 5 | https://edu.51cto.com/center/course/lesson/index?id=843411 6 | 7 | ----------------------------------------------------------------------------- 8 | 9 | 2023-01-08更新: 10 | 11 | 新增pt-osc功能,研发可以在网页里执行大表Alter更改表结构操作。 12 | https://blog.51cto.com/hcymysql/5996723 13 | 14 | sqlops新增pt-osc功能,触发条件: 15 | 16 | 1)当行记录小于150万行,研发可以直接在网页里执行Alter table操作。 17 | 18 | 2)当行记录大于150万行并且小于3000行,平台将调用pt-online-schema-change开源工具在线执行Alter表结构变更。 19 | 20 | 注:期间不要关闭浏览器!执行进度会自动刷新。 21 | 22 | 3)当行记录大于3000行时,提示:Alter更改表结构会引起表锁,影响业务。由于该表过大,平台不支持自助上线。 23 | 24 | -------------------------------------------------------------------------------------------- 25 | ![image](https://raw.githubusercontent.com/hcymysql/sqlops/master/image/%E9%A6%96%E9%A1%B5.png) 26 | 27 | 2020-03-11更新: 28 | 29 | __1)sql_check.php --> SQL语法校验功能__ 30 | 31 | ![image](https://raw.githubusercontent.com/hcymysql/sqlops/master/image/SQL%E8%AF%AD%E8%A8%80%E6%A0%A1%E9%AA%8C.png) 32 | 33 | 这里须要调用MariaDB的mysql客户端,因为MySQL5.6高版本会抛出警告,命令行里带密码不安全,会影响SQL语言检测结果。 34 | 35 | mysql: [Warning] Using a password on the command line interface can be insecure. 36 | 37 | --------------------------------------------------------------------------------------- 38 | 39 | __2)用户权限增加研发经理角色__ 40 | 41 | login_user表privilege字段(0:普通研发;1:研发经理;100:DBA) 42 | 43 | 区别:研发经理只能审批SQL,不能执行SQL;DBA可以审批SQL且可以执行SQL 44 | 45 | --------------------------------------------------------------------------------------- 46 | 47 | __3) 增加dbinfo_prvi审批权限表__ 48 | 49 | 在待审批工单栏目下,研发经理可以只审批自己的业务库,别的项目数据库库,看不到审批内容。 50 | 51 | insert into dbinfo_prvi(dbuser,approver,dbname) values('hechunyang','贺春旸','test'); 52 | 53 | ---------------------------------------------------------------------------- 54 | 55 | 为了让DBA从日常繁琐的工作中解放出来,通过SQL自助平台,可以让开发自上线,开发提交SQL后就会自动返回优化建议,无需DBA的再次审核, 56 | 从而提升上线效率,有利于建立数据库开发规范。 57 | 58 | ![image](https://raw.githubusercontent.com/hcymysql/sqlops/master/image/sqlops.png) 59 | 60 | 借鉴了去哪网Inception的思路并且把美团网SQLAdvisor(索引优化建议)集成在一起,并结合了之前写的《DBA的40条军规》纳入了审核规则里,用PHP实现。 61 | 目前在我公司内部使用。 62 | 63 | 64 | SQL自动审核主要完成两方面目的: 65 | 66 | 1、避免性能太差的SQL进入生产系统,导致整体性能降低。 67 | 68 | 2、检查开发设计的索引是否合理,是否需要添加索引。 69 | 70 | 71 | 思路其实很简单: 72 | 73 | 1、获取开发提交的SQL 74 | 75 | 2、对要执行的SQL做分析,触碰事先定义好的规则来判断这个SQL是否可以自动审核通过,未通过审核的需要人工处理。 76 | 77 | 78 | ---------------------------------------------------------------------------- 79 | # 环境安装 80 | 81 | 1、PHP环境安装 82 | 83 | # yum install httpd mariadb php php-mysqlnd php-devel php-pear libssh2 libssh2-devel gcc -y 84 | 85 | 2、安装PHP SSH2扩展 86 | 87 | pecl install -f ssh2 88 | 89 | 90 | 3、修改/etc/php.ini 91 | 92 | 在最后一行添加 93 | 94 | extension=ssh2.so 95 | 96 | 然后重启httpd 97 | 98 | systemctl restart httpd.service 99 | 100 | 4、关闭selinux 101 | 102 | # vim /etc/selinux/config 103 | 104 | SELINUX=disabled 105 | 106 | 107 | 5、美团网SQLAdvisor安装 108 | 109 | 请移步 110 | 111 | https://github.com/Meituan-Dianping/SQLAdvisor/blob/master/doc/QUICK_START.md 112 | 113 | 6、binlog2sql安装 114 | 115 | 请移步 116 | 117 | https://github.com/danfengcao/binlog2sql 118 | 119 | 120 | # 部署 121 | 122 | 将https://github.com/hcymysql/sqlops/archive/master.zip 123 | 解压缩到/var/www/html/目录下 124 | 125 | 1、导入表结构sqlops_schema/sqlops_schema.sql(DB配置信息表)和(SQL工单记录表) 126 | 127 | 2、修改conn.php(sqlops数据库的配置信息的IP、端口、用户名、密码、库名) 128 | 129 | 录入开发上线的生产数据库信息 130 | 131 | insert into `dbinfo`(`id`,`ip`,`dbname`,`user`,`pwd`,`port`) values (1,'10.10.159.31','test','admin','hechunyang',3306); 132 | 133 | 134 | 3、修改sqladvisor_config.php(访问SQLAdvisor服务器的IP、SSH端口、SSH用户名、SSH密码) 135 | 136 | 4、修改rollback.php(访问binlog2sql服务器的IP、SSH端口、SSH用户名、SSH密码) 137 | 138 | 5、__execute_status.php 执行上线__ 139 | 140 | 这里须要调用MariaDB的mysql客户端,因为MySQL5.6高版本会抛出警告,命令行里带密码不安全,会影响SQL语言检测结果。 141 | 142 | mysql: [Warning] Using a password on the command line interface can be insecure. 143 | 144 | --------------------------------------------------------------------------------------------- 145 | # 规则 146 | __create审核__ 147 | 148 | 检查项: 149 | 150 | 1、警告!表没有主键 151 | 152 | 2、警告!表主键字段名必须是id。 153 | 154 | 3、提示:id自增字段默认值为1,auto_increment=1 155 | 156 | 4、警告!表字段没有中文注释,COMMENT应该有默认值,如COMMENT '姓名' 157 | 158 | 5、警告!表没有中文注释,例:COMMENT='学生信息表' 159 | 160 | 6、警告!表缺少utf8字符集,否则会出现乱码 161 | 162 | 7、警告!表存储引擎应设置为InnoDB 163 | 164 | 8、警告!表缺少update_time字段,方便抽数据使用,且给加上索引。 165 | 166 | 9、警告!表update_time字段类型应设置timestamp。 167 | 168 | 10、警告!表update_time字段缺少索引。 169 | 170 | 11、警告!表缺少create_time字段,方便抽数据使用,且给加上索引。 171 | 172 | 12、警告!表中的索引数已经超过10个,索引是一把双刃剑,它可以提高查询效率但也会降低插入和更新的速度并占用磁盘空间 173 | 174 | 13、警告!表应该为timestamp类型加默认系统当前时间。例如:update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' 175 | 176 | 14、警告!表 utf8_bin应使用默认的字符集核对utf8_general_ci 177 | 178 | 15、警告!用DECIMAL代替FLOAT和DOUBLE存储精确浮点数。浮点数的缺点是会引起精度问题,对货币等对精度敏感的数据,应该用定点数decimal类型存储。 179 | 180 | 16、警告!避免使用外键,外键会导致父表和子表之间耦合,十分影响SQL性能,出现过多的锁等待,甚至会造成死锁。 181 | 182 | 17、警告!表字段类型应设置为datetime精确到秒。例:将datetime(3)改成datetime。警告!表字段类型应设置为timestamp精确到秒。例:将timestamp(3)改成timestamp。 183 | 184 | --------------------------------------------------------------------------------- 185 | __alter审核__ 186 | 187 | 检查项: 188 | 189 | 1、警告!不支持create index语法,请更改为alter table add index语法。 190 | 191 | 2、警告!更改表结构要减少与数据库的交互次数,应改为,例alter table t1 add index IX_uid(uid),add index IX_name(name) 192 | 193 | 3、表记录小于150万行,可以由开发自助执行。否则表太大请联系DBA执行! 194 | 195 | 4、支持删除索引,但不支持删除字段 196 | 197 | 5、不支持更改字段名字 198 | 199 | ------------------------------------------- 200 | __insert审核__ 201 | 202 | 检查项: 203 | 204 | 1、警告:insert 表1 select 表2,会造成锁表。 205 | 206 | ------------------------------------------- 207 | __update/delete审核__ 208 | 209 | 检查项: 210 | 211 | 1、警告!没有where条件,update会全表更新,禁止执行!!! 212 | 213 | 2、更新的行数小于1000行,可以由开发自助执行。否则请联系DBA执行!!! 214 | 215 | 3、防止where 1=1 绕过审核规则 216 | 217 | 4、检查更新字段有无索引 218 | 219 | 5、警告!DML不同的操作要分开写,不要写在一个事务里。 220 | 221 | ------------------------------------------- 222 | 223 | 224 | -------------------------------------------------------------------------------- /sql_interface.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | SQL自动审核-自助上线平台 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
    38 |
    39 | 40 |
    41 |

    SQL自动审核-自助上线平台

    42 |

    43 |
    44 | 45 | 46 |
    47 |
    48 |
    49 | 59 |
    60 | 65 |

    66 | 67 |
    68 |
    69 |
    70 | 71 |
    72 |
    73 |
    74 | 75 |
    76 |
    77 |
    78 | 79 | 80 | 100 |
    101 |
    102 |
    103 | 104 | 105 |
    106 |
    107 |
    108 | 112 |
    113 |
    114 | 115 |
    116 |
    117 |
    118 | 119 | 125 |
    126 |
    127 | 128 |
    129 | 130 | 131 |
    132 | 133 | 134 | 135 | 136 | 148 | 149 |
    137 |

    使用说明:
    138 | 1、针对select/insert/update/delete/create/alter加了规则。
    139 | 2、语句之间要有空格,例where id = 100,没有空格会影响判断的准确性。
    140 | 3、SQL语句后面要加分号; MySQL解析器规定分号才可以执行SQL。
    141 | 4、反引号`可能会造成上线失败,需要用文本编辑器替换掉。
    142 | 5、支持多条SQL解析,用一个分号;分割。例如:
    143 |      insert into t1 values(1,'a');
    144 | 145 |      insert into t1 values(2,'b');

    146 | 6、JSON格式里的双引号要用反斜杠进行转义,例如:{\"dis_text\":\"nba\"}。

    147 |
    150 |

     

    151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /xadmin/lib/layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,o={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.4.5"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,o=t.scripts,n=o.length-1,r=n;r>0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){var e=function(e,t){layui[e]=t,o.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),o.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var y=this,p=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":o.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return y},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function p(){return++y>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(p,100))}(),a)},o.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof o.callback[e]?o.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},void(n.onerror=function(e){n.onerror=null,"function"==typeof o&&o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),o.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===o)return delete n[t];o="object"==typeof o?o:{key:o};try{var r=JSON.parse(n[t])}catch(i){var r={}}return"value"in o&&(r[o.key]=o.value),o.remove&&delete r[o.key],n[t]=JSON.stringify(r),o.key?r[o.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oi?1:r"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
    '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
    ',"
    "].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(c)||(e.elemFile.wrap(a),t.elem.next("."+c).append(function(){var e=[];return layui.each(t.data,function(i,t){t="function"==typeof t?t():t,e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){i="function"==typeof i?i():i,r.append(e,i)}),i.ajax({url:l.url,type:"post",data:r,contentType:!1,processData:!1,dataType:"json",headers:l.headers||{},success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files},resetFile:function(e,i,t){var n=new File([i],t);o.files=o.files||{},o.files[e]=n}},y=function(){if("choose"!==t&&!l.auto||(l.choose&&l.choose(g),"choose"!==t))return l.before&&l.before(g),a.ie?a.ie>9?u():c():void u()};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?t.toFixed(2)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/slider.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.jquery,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=i.extend({},t.config,e),t},on:function(e,i){return layui.onevent.call(this,n,e,i)}},a=function(){var e=this,i=e.config;return{setValue:function(i,t){return e.slide("set",i,t||0)},config:i}},n="slider",l="layui-disabled",s="layui-slider",r="layui-slider-bar",o="layui-slider-wrap",u="layui-slider-wrap-btn",d="layui-slider-tips",v="layui-slider-input",c="layui-slider-input-txt",m="layui-slider-input-btn",p="layui-slider-hover",f=function(e){var a=this;a.index=++t.index,a.config=i.extend({},a.config,t.config,e),a.render()};f.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},f.prototype.render=function(){var e=this,t=e.config;if(t.step<1&&(t.step=1),t.maxt.min?a:t.min,t.value[1]=n>t.min?n:t.min,t.value[0]=t.value[0]>t.max?t.max:t.value[0],t.value[1]=t.value[1]>t.max?t.max:t.value[1];var r=Math.floor((t.value[0]-t.min)/(t.max-t.min)*100),v=Math.floor((t.value[1]-t.min)/(t.max-t.min)*100),m=v-r+"%";r+="%",v+="%"}else{"object"==typeof t.value&&(t.value=Math.min.apply(null,t.value)),t.valuet.max&&(t.value=t.max);var m=Math.floor((t.value-t.min)/(t.max-t.min)*100)+"%"}var p=t.disabled?"#c2c2c2":t.theme,f='
    '+(t.tips?'
    ':"")+'
    '+(t.range?'
    ':"")+"
    ",h=i(t.elem),y=h.next("."+s);if(y[0]&&y.remove(),e.elemTemp=i(f),t.range?(e.elemTemp.find("."+o).eq(0).data("value",t.value[0]),e.elemTemp.find("."+o).eq(1).data("value",t.value[1])):e.elemTemp.find("."+o).data("value",t.value),h.html(e.elemTemp),"vertical"===t.type&&e.elemTemp.height(t.height+"px"),t.showstep){for(var g=(t.max-t.min)/t.step,b="",x=1;x
    ')}e.elemTemp.append(b)}if(t.input&&!t.range){var w=i('
    ');h.css("position","relative"),h.append(w),h.find("."+c).children("input").val(t.value),"vertical"===t.type?w.css({left:0,top:-48}):e.elemTemp.css("margin-right",w.outerWidth()+15)}t.disabled?(e.elemTemp.addClass(l),e.elemTemp.find("."+u).addClass(l)):e.slide(),e.elemTemp.find("."+u).on("mouseover",function(){var a="vertical"===t.type?t.height:e.elemTemp[0].offsetWidth,n=e.elemTemp.find("."+o),l="vertical"===t.type?a-i(this).parent()[0].offsetTop-n.height():i(this).parent()[0].offsetLeft,s=l/a*100,r=i(this).parent().data("value"),u=t.setTips?t.setTips(r):r;e.elemTemp.find("."+d).html(u),"vertical"===t.type?e.elemTemp.find("."+d).css({bottom:s+"%","margin-bottom":"20px",display:"inline-block"}):e.elemTemp.find("."+d).css({left:s+"%",display:"inline-block"})}).on("mouseout",function(){e.elemTemp.find("."+d).css("display","none")})},f.prototype.slide=function(e,t,a){var n=this,l=n.config,s=n.elemTemp,f=function(){return"vertical"===l.type?l.height:s[0].offsetWidth},h=s.find("."+o),y=s.next("."+v),g=y.children("."+c).children("input").val(),b=100/((l.max-l.min)/Math.ceil(l.step)),x=function(e,i){e=Math.ceil(e)*b>100?Math.ceil(e)*b:Math.round(e)*b,e=e>100?100:e,h.eq(i).css("vertical"===l.type?"bottom":"left",e+"%");var t=T(h[0].offsetLeft),a=l.range?T(h[1].offsetLeft):0;"vertical"===l.type?(s.find("."+d).css({bottom:e+"%","margin-bottom":"20px"}),t=T(f()-h[0].offsetTop-h.height()),a=l.range?T(f()-h[1].offsetTop-h.height()):0):s.find("."+d).css("left",e+"%"),t=t>100?100:t,a=a>100?100:a;var n=Math.min(t,a),o=Math.abs(t-a);"vertical"===l.type?s.find("."+r).css({height:o+"%",bottom:n+"%"}):s.find("."+r).css({width:o+"%",left:n+"%"});var u=l.min+Math.round((l.max-l.min)*e/100);if(g=u,y.children("."+c).children("input").val(g),h.eq(i).data("value",u),u=l.setTips?l.setTips(u):u,s.find("."+d).html(u),l.range){var v=[h.eq(0).data("value"),h.eq(1).data("value")];v[0]>v[1]&&v.reverse()}l.change&&l.change(l.range?v:u)},T=function(e){var i=e/f()*100/b,t=Math.round(i)*b;return e==f()&&(t=Math.ceil(i)*b),t},w=i(['
    f()&&(r=f());var o=r/f()*100/b;x(o,e),t.addClass(p),s.find("."+d).show(),i.preventDefault()},o=function(){t.removeClass(p),s.find("."+d).hide()};M(r,o)})}),s.on("click",function(e){var t=i("."+u);if(!t.is(event.target)&&0===t.has(event.target).length&&t.length){var a,n="vertical"===l.type?f()-e.clientY+i(this).offset().top:e.clientX-i(this).offset().left;n<0&&(n=0),n>f()&&(n=f());var s=n/f()*100/b;a=l.range?"vertical"===l.type?Math.abs(n-parseInt(i(h[0]).css("bottom")))>Math.abs(n-parseInt(i(h[1]).css("bottom")))?1:0:Math.abs(n-h[0].offsetLeft)>Math.abs(n-h[1].offsetLeft)?1:0:0,x(s,a),e.preventDefault()}}),y.hover(function(){var e=i(this);e.children("."+m).fadeIn("fast")},function(){var e=i(this);e.children("."+m).fadeOut("fast")}),y.children("."+m).children("i").each(function(e){i(this).on("click",function(){g=1==e?g-l.stepl.max?l.max:Number(g)+l.step;var i=(g-l.min)/(l.max-l.min)*100/b;x(i,0)})});var q=function(){var e=this.value;e=isNaN(e)?0:e,e=el.max?l.max:e,this.value=e;var i=(e-l.min)/(l.max-l.min)*100/b;x(i,0)};y.children("."+c).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),q.call(this))}).on("change",q)},f.prototype.events=function(){var e=this;e.config},t.render=function(e){var i=new f(e);return a.call(i)},e(n,t)}); -------------------------------------------------------------------------------- /xadmin/lib/layui/lay/modules/element.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var a=layui.$,i=(layui.hint(),layui.device()),e="element",l="layui-this",n="layui-show",s=function(){this.config={}};s.prototype.set=function(t){var i=this;return a.extend(!0,i.config,t),i},s.prototype.on=function(t,a){return layui.onevent.call(this,e,t,a)},s.prototype.tabAdd=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.children(".layui-tab-bar"),o=l.children(".layui-tab-content"),r='
  • "+(i.title||"unnaming")+"
  • ";return s[0]?s.before(r):n.append(r),o.append('
    '+(i.content||"")+"
    "),f.hideTabMore(!0),f.tabAuto(),this},s.prototype.tabDelete=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabDelete(null,s),this},s.prototype.tabChange=function(t,i){var e=".layui-tab-title",l=a(".layui-tab[lay-filter="+t+"]"),n=l.children(e),s=n.find('>li[lay-id="'+i+'"]');return f.tabClick.call(s[0],null,null,s),this},s.prototype.tab=function(t){t=t||{},b.on("click",t.headerElem,function(i){var e=a(this).index();f.tabClick.call(this,i,e,null,t)})},s.prototype.progress=function(t,i){var e="layui-progress",l=a("."+e+"[lay-filter="+t+"]"),n=l.find("."+e+"-bar"),s=n.find("."+e+"-text");return n.css("width",i),s.text(i),this};var o=".layui-nav",r="layui-nav-item",c="layui-nav-bar",u="layui-nav-tree",d="layui-nav-child",y="layui-nav-more",h="layui-anim layui-anim-upbit",f={tabClick:function(t,i,s,o){o=o||{};var r=s||a(this),i=i||r.parent().children("li").index(r),c=o.headerElem?r.parent():r.parents(".layui-tab").eq(0),u=o.bodyElem?a(o.bodyElem):c.children(".layui-tab-content").children(".layui-tab-item"),d=r.find("a"),y=c.attr("lay-filter");"javascript:;"!==d.attr("href")&&"_blank"===d.attr("target")||(r.addClass(l).siblings().removeClass(l),u.eq(i).addClass(n).siblings().removeClass(n)),layui.event.call(this,e,"tab("+y+")",{elem:c,index:i})},tabDelete:function(t,i){var n=i||a(this).parent(),s=n.index(),o=n.parents(".layui-tab").eq(0),r=o.children(".layui-tab-content").children(".layui-tab-item"),c=o.attr("lay-filter");n.hasClass(l)&&(n.next()[0]?f.tabClick.call(n.next()[0],null,s+1):n.prev()[0]&&f.tabClick.call(n.prev()[0],null,s-1)),n.remove(),r.eq(s).remove(),setTimeout(function(){f.tabAuto()},50),layui.event.call(this,e,"tabDelete("+c+")",{elem:o,index:s})},tabAuto:function(){var t="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",n=this;a(".layui-tab").each(function(){var s=a(this),o=s.children(".layui-tab-title"),r=(s.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),c=a('');if(n===window&&8!=i.ie&&f.hideTabMore(!0),s.attr("lay-allowClose")&&o.find("li").each(function(){var t=a(this);if(!t.find("."+l)[0]){var i=a('');i.on("click",f.tabDelete),t.append(i)}}),"string"!=typeof s.attr("lay-unauto"))if(o.prop("scrollWidth")>o.outerWidth()+1){if(o.find("."+e)[0])return;o.append(c),s.attr("overflow",""),c.on("click",function(a){o[this.title?"removeClass":"addClass"](t),this.title=this.title?"":"收缩"})}else o.find("."+e).remove(),s.removeAttr("overflow")})},hideTabMore:function(t){var i=a(".layui-tab-title");t!==!0&&"tabmore"===a(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=a(this),i=t.parents(o),n=i.attr("lay-filter"),s=t.parent(),c=t.siblings("."+d),y="string"==typeof s.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||y||c[0]||(i.find("."+l).removeClass(l),s.addClass(l)),i.hasClass(u)&&(c.removeClass(h),c[0]&&(s["none"===c.css("display")?"addClass":"removeClass"](r+"ed"),"all"===i.attr("lay-shrink")&&s.siblings().removeClass(r+"ed"))),layui.event.call(this,e,"nav("+n+")",t)},collapse:function(){var t=a(this),i=t.find(".layui-colla-icon"),l=t.siblings(".layui-colla-content"),s=t.parents(".layui-collapse").eq(0),o=s.attr("lay-filter"),r="none"===l.css("display");if("string"==typeof s.attr("lay-accordion")){var c=s.children(".layui-colla-item").children("."+n);c.siblings(".layui-colla-title").children(".layui-colla-icon").html(""),c.removeClass(n)}l[r?"addClass":"removeClass"](n),i.html(r?"":""),layui.event.call(this,e,"collapse("+o+")",{title:t,content:l,show:r})}};s.prototype.init=function(t,e){var l=function(){return e?'[lay-filter="'+e+'"]':""}(),s={tab:function(){f.tabAuto.call({})},nav:function(){var t=200,e={},s={},p={},b=function(l,o,r){var c=a(this),f=c.find("."+d);o.hasClass(u)?l.css({top:c.position().top,height:c.children("a").outerHeight(),opacity:1}):(f.addClass(h),l.css({left:c.position().left+parseFloat(c.css("marginLeft")),top:c.position().top+c.height()-l.height()}),e[r]=setTimeout(function(){l.css({width:c.width(),opacity:1})},i.ie&&i.ie<10?0:t),clearTimeout(p[r]),"block"===f.css("display")&&clearTimeout(s[r]),s[r]=setTimeout(function(){f.addClass(n),c.find("."+y).addClass(y+"d")},300))};a(o+l).each(function(i){var l=a(this),o=a(''),h=l.find("."+r);l.find("."+c)[0]||(l.append(o),h.on("mouseenter",function(){b.call(this,o,l,i)}).on("mouseleave",function(){l.hasClass(u)||(clearTimeout(s[i]),s[i]=setTimeout(function(){l.find("."+d).removeClass(n),l.find("."+y).removeClass(y+"d")},300))}),l.on("mouseleave",function(){clearTimeout(e[i]),p[i]=setTimeout(function(){l.hasClass(u)?o.css({height:0,top:o.position().top+o.height()/2,opacity:0}):o.css({width:0,left:o.position().left+o.width()/2,opacity:0})},t)})),h.find("a").each(function(){var t=a(this),i=(t.parent(),t.siblings("."+d));i[0]&&!t.children("."+y)[0]&&t.append(''),t.off("click",f.clickThis).on("click",f.clickThis)})})},breadcrumb:function(){var t=".layui-breadcrumb";a(t+l).each(function(){var t=a(this),i="lay-separator",e=t.attr(i)||"/",l=t.find("a");l.next("span["+i+"]")[0]||(l.each(function(t){t!==l.length-1&&a(this).after(""+e+"")}),t.css("visibility","visible"))})},progress:function(){var t="layui-progress";a("."+t+l).each(function(){var i=a(this),e=i.find(".layui-progress-bar"),l=e.attr("lay-percent");e.css("width",function(){return/^.+\/.+$/.test(l)?100*new Function("return "+l)()+"%":l}()),i.attr("lay-showPercent")&&setTimeout(function(){e.html(''+l+"")},350)})},collapse:function(){var t="layui-collapse";a("."+t+l).each(function(){var t=a(this).find(".layui-colla-item");t.each(function(){var t=a(this),i=t.find(".layui-colla-title"),e=t.find(".layui-colla-content"),l="none"===e.css("display");i.find(".layui-colla-icon").remove(),i.append(''+(l?"":"")+""),i.off("click",f.collapse).on("click",f.collapse)})})}};return s[t]?s[t]():layui.each(s,function(t,a){a()})},s.prototype.render=s.prototype.init;var p=new s,b=a(document);p.render();var v=".layui-tab-title li";b.on("click",v,f.tabClick),b.on("click",f.hideTabMore),a(window).on("resize",f.tabAuto),t(e,p)}); -------------------------------------------------------------------------------- /finish_order.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 数据库上线工单查询 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

      非法访问!你没有权限审批工单!


    "; 34 | //echo ''; 35 | exit; 36 | } 37 | ?> 38 | 39 | 49 | 50 | 66 | 67 | 68 |
    69 |
    70 |

    数据库上线工单查询    总计:

    71 |
    72 | 73 |
    74 |
    75 | 76 | 77 |
    78 | 79 | 80 | 0) { 84 | echo "Hi,管理员,等待你审批工单。
    "; 85 | $sql ="select a.*,b.real_user from sql_order_wait a join login_user b on a.ops_name = b.user order by id DESC limit $startCount,$perNumber"; 86 | //$sql ="SELECT a.*,b.real_user AS approver_real_name,c.real_user FROM sql_order_wait a JOIN login_user b ON a.approver = b.user JOIN login_user c ON a.ops_name = c.user ORDER BY id DESC limit $startCount,$perNumber"; 87 | } 88 | $result = mysqli_query($conn,$sql); 89 | 90 | echo "
    "; 91 | echo "
    92 |

    输入工单号: 93 | 94 | 95 |

    96 |
    "; 97 | 98 | echo ""; 99 | echo " 100 | 101 | 102 | 103 | 104 | 105 | 106 | "; 107 | if($prvi!=1){ 108 | echo " 109 | "; 110 | } 111 | while($row = mysqli_fetch_array($result)) 112 | { 113 | $status = $row['status']?"已审批":"待审批"; 114 | $ddl_alter=0; 115 | $exec_status = $row['status']; 116 | $exec_finish_status = $row['finish_status']; 117 | echo ""; 118 | echo ""; 119 | echo ""; 120 | echo ""; 121 | echo ""; 122 | echo ""; 123 | echo ""; 124 | 125 | if($prvi==1 || $prvi=100){ 126 | 127 | if($exec_status==0){ 128 | echo ""; 129 | } 130 | if($exec_status==1){ 131 | echo ""; 133 | } 134 | if($exec_status==2){ 135 | echo ""; 137 | } 138 | } 139 | else{ 140 | echo ""; 141 | } 142 | ####################################################### 143 | if($prvi==100){ 144 | 145 | if($exec_finish_status==1){ 146 | echo ""; 147 | //echo "自行撤销工单"; 148 | } 149 | else if($exec_finish_status==2){ 150 | echo ""; 152 | } 153 | else{ 154 | echo ""; 157 | //echo ""; 158 | } 159 | echo ""; 160 | 161 | } //end if($prvi==100) 162 | 163 | }//end while 164 | echo "
    工单号申请人数据库名申请时间工单名称申请原因审批结果操作
    {$row['ops_order']}{$row['real_user']}{$row['ops_db']}{$row['ops_time']}{$row['ops_order_name']}{$row['ops_reason']}$status$status
    132 | 审批人:{$row['approver']}
    审批不通过
    136 | 审批人:
    {$row['approver']}
    等待审批中执行工单已执行
    "; 151 | echo "生成反向SQL
    没审批不能执行
    155 | 自行撤销工单 156 |
    自行撤销工单
    "; 165 | echo "
    "; 166 | echo "
    "; 167 | echo "
    "; 168 | 169 | $maxPageCount=10; 170 | $buffCount=2; 171 | $startPage=1; 172 | 173 | if ($page< $buffCount){ 174 | $startPage=1; 175 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 176 | $startPage=$page-$buffCount+1; 177 | }else{ 178 | $startPage=$totalPage-$maxPageCount+1; 179 | } 180 | 181 | $endPage=$startPage+$maxPageCount-1; 182 | 183 | 184 | $htmlstr=""; 185 | 186 | $htmlstr.=""; 187 | if ($page > 1){ 188 | $htmlstr.=""; 189 | $htmlstr.=""; 190 | } 191 | 192 | $htmlstr.=""; 193 | 194 | for ($i=$startPage;$i<=$endPage; $i++){ 195 | 196 | $htmlstr.=""; 197 | } 198 | 199 | if ($page<$totalPage){ 200 | $htmlstr.=""; 201 | $htmlstr.=""; 202 | 203 | } 204 | $htmlstr.="
    第一页 上一页 总共${totalPage}页" . $i . "下一页最后页
    "; 205 | echo $htmlstr; 206 | 207 | ?> 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SQL自助平台使用说明 5 | 6 | 7 | 8 | 9 |

    README.md

    10 |

    11 |

    12 |

    13 | 上线流程为:开发提交SQL,系统自动审核(sql_review.php),审核通过后生成我的工单待管理员批复并且发邮件通知,

    14 |

                            15 | 16 | 管理员人工确认审核通过后,开发点击执行完成上线。

    17 |

     

    18 |

    19 | 通过SQL自助平台,可以让开发自上线,开发提交SQL后就会自动返回优化建议,无需DBA的再次审核,从而提升上线效率,有利于建立数据库开发规范。

    20 |

    SQL自动审核主要完成两方面目的:

    21 |

    1、避免性能太差的SQL进入生产系统,导致整体性能降低。

    22 |

    2、检查开发设计的索引是否合理,是否需要添加索引。

    23 |

     

    24 |

    思路其实很简单:

    25 |

    1、获取开发提交的SQL

    26 |

    27 | 2、对要执行的SQL做分析,触碰事先定义好的规则来判断这个SQL是否可以自动审核通过,未通过审核的需要人工处理。

    28 |

     

    29 |

    规则:

    30 |

    create审核

    31 |

    检查项:

    32 |

    1、警告!表没有主键

    33 |

    2、警告!表主键字段名必须是id。

    34 |

    3、提示:id自增字段默认值为1,auto_increment=1

    35 |

    4、警告!表字段没有中文注释,COMMENT应该有默认值,如COMMENT '姓名'

    36 |

    5、警告!表没有中文注释,例:COMMENT='学生信息表'

    37 |

    6、警告!表缺少utf8字符集,否则会出现乱码

    38 |

    7、警告!表存储引擎应设置为InnoDB

    39 |

    8、警告!表缺少update_time字段,方便抽数据使用,且给加上索引。

    40 |

    9、警告!表update_time字段类型应设置timestamp。

    41 |

    10、警告!表update_time字段缺少索引。

    42 |

    11、警告!表缺少create_time字段,方便抽数据使用,且给加上索引。

    43 |

    44 | 12、警告!表中的索引数已经超过10个,索引是一把双刃剑,它可以提高查询效率但也会降低插入和更新的速度并占用磁盘空间

    45 |

    13、警告!表应该为timestamp类型加默认系统当前时间。例如:update_time 46 | timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 47 | '更新时间'

    48 |

    14、警告!表 utf8_bin应使用默认的字符集核对utf8_general_ci

    49 |

    50 | 15、警告!用DECIMAL代替FLOAT和DOUBLE存储精确浮点数。浮点数的缺点是会引起精度问题,对货币等对精度敏感的数据,应该用定点数decimal类型存储。

    51 |

    52 | 16、警告!避免使用外键,外键会导致父表和子表之间耦合,十分影响SQL性能,出现过多的锁等待,甚至会造成死锁。

    53 |

    54 | 17、警告!表字段类型应设置为datetime精确到秒。例:将datetime(3)改成datetime。警告!表字段类型应设置为timestamp精确到秒。例:将timestamp(3)改成timestamp。

    55 |
    56 |

    57 |

    59 |

    alter审核

    60 |

    检查项:

    61 |

    1、警告!不支持create index语法,请更改为alter table add 62 | index语法。

    63 |

    2、警告!更改表结构要减少与数据库的交互次数,应改为,例alter table t1 add 64 | index IX_uid(uid),add index IX_name(name)

    65 |

    3、表记录小于150万行,可以由开发自助执行。否则表太大请联系DBA执行!

    66 |

    4、支持删除索引,但不支持删除字段

    67 |

    5、不支持更改字段名字

    68 |
    69 |

    70 |

    72 |

    insert审核

    73 |

    检查项:

    74 |

    1、警告:insert 表1 select 表2,会造成锁表。

    75 |
    76 |

    77 |

    79 |

    update/delete审核

    80 |

    检查项:

    81 |

    1、警告!没有where条件,update会全表更新,禁止执行!!!

    82 |

    2、更新的行数小于1000行,可以由开发自助执行。否则请联系DBA执行!!!

    83 |

    3、防止where 1=1 绕过审核规则

    84 |

    4、检查更新字段有无索引

    85 |

    5、警告!DML不同的操作要分开写,不要写在一个事务里。

    86 |
    87 |

    88 |

    90 |

    select审核

    91 |

    检查项:

    92 |

    1、select * 是否有必要查询所有的字段?

    93 |

    2、警告!没有where条件,注意where后面的字段要加上索引

    94 |

    3、没有limit会查询更多的数据

    95 |

    4、警告!子查询性能低下,请转为join表关联

    96 |

    5、提示:in里面的数值不要超过1000个

    97 |

    6、提示:采用join关联,注意关联字段要都加上索引,如on a.id=b.id

    98 |

    7、提示:MySQL对多表join关联性能低下,建议不要超过3个表以上的关联

    99 |

    8、警告!like '%%'双百分号无法用到索引,like 100 | 'mysql%'这样是可以利用到索引的

    101 |

    9、提示:默认情况下,MySQL对所有GROUP BY 102 | col1,col2...的字段进行排序。如果查询包括GROUP BY,想要避免排序结果的消耗,则可以指定ORDER BY NULL禁止排序。

    103 |

    10、警告!MySQL里用到order by 104 | rand()在数据量比较多的时候是很慢的,因为会导致MySQL全表扫描,故也不会用到索引

    105 |

    11、提示:是否要加一个having过滤下?

    106 |

    12、警告!禁止不必要的order by排序,因为前面已经count统计了

    107 |

    108 | 13、警告!MySQL里不支持函数索引,例DATE_FORMAT('create_time','%Y-%m-%d')='2016-01-01'是无法用到索引的,需要改写为 109 | create_time>='2016-01-01 00:00:00' and create_time<='2016-01-01 23:59:59'

    110 |

    14、检查更新字段有无索引

    111 |

     

    112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /wait_order.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 数据库上线工单查询 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

      非法访问!你没有权限审批工单!


    "; 34 | //echo ''; 35 | exit; 36 | } 37 | ?> 38 | 39 | 49 | 50 | 68 | 69 | 70 |
    71 |
    72 |

    数据库上线工单查询    总计:

    73 |
    74 | 75 |
    76 |
    77 | 78 | 79 |
    80 | 81 | 82 | 0) { 86 | echo "Hi,管理员,等待你审批工单。(如未找到审批的工单,请到'工单汇总'栏目下查找)
    "; 87 | if($prvi==1){ 88 | $sql="SELECT a.*,b.real_user FROM sql_order_wait a JOIN login_user b ON a.ops_name = b.user 89 | LEFT JOIN `dbinfo_prvi` d ON a.ops_db=d.dbname WHERE d.dbuser='${login_user}' AND ((is_ddl IS NULL AND STATUS=0) OR 90 | (is_ddl IS NOT NULL AND STATUS=0)) ORDER BY id DESC limit $startCount,$perNumber"; 91 | } else if($prvi==100){ 92 | $sql ="select a.*,b.real_user from sql_order_wait a join login_user b on a.ops_name = b.user order by id DESC limit $startCount,$perNumber"; 93 | } else { } 94 | } 95 | $result = mysqli_query($conn,$sql); 96 | 97 | echo "
    "; 98 | echo "
    99 |

    输入工单号: 100 | 101 | 102 |

    103 |
    "; 104 | 105 | echo ""; 106 | echo " 107 | 108 | 109 | 110 | 111 | 112 | 113 | "; 114 | if($prvi!=1){ 115 | echo " 116 | "; 117 | } 118 | while($row = mysqli_fetch_array($result)) 119 | { 120 | $status = $row['status']?"已审批":"待审批"; 121 | $ddl_alter=0; 122 | $exec_status = $row['status']; 123 | $exec_finish_status = $row['finish_status']; 124 | echo ""; 125 | echo ""; 126 | echo ""; 127 | echo ""; 128 | echo ""; 129 | echo ""; 130 | echo ""; 131 | 132 | if($prvi==1 || $prvi=100){ 133 | 134 | if($exec_status==0){ 135 | echo ""; 136 | } 137 | if($exec_status==1){ 138 | echo ""; 140 | } 141 | if($exec_status==2){ 142 | echo ""; 144 | } 145 | } 146 | else{ 147 | echo ""; 148 | } 149 | ####################################################### 150 | if($prvi==100){ 151 | 152 | if($exec_finish_status==1){ 153 | echo ""; 154 | } 155 | else if($exec_finish_status==2){ 156 | echo ""; 158 | } 159 | else{ 160 | echo ""; 163 | //echo ""; 164 | } 165 | echo ""; 166 | 167 | } //end if($prvi==100) 168 | 169 | }//end while 170 | echo "
    工单号申请人数据库名申请时间工单名称申请原因审批结果操作
    {$row['ops_order']}{$row['real_user']}{$row['ops_db']}{$row['ops_time']}{$row['ops_order_name']}{$row['ops_reason']}$status$status
    139 | 审批人:{$row['approver']}
    审批不通过
    143 | 审批人:
    {$row['approver']}
    等待审批中执行工单已执行
    "; 157 | echo "生成反向SQL
    没审批不能执行
    161 | 自行撤销工单 162 |
    自行撤销工单
    "; 171 | echo "
    "; 172 | echo "
    "; 173 | echo "
    "; 174 | 175 | $maxPageCount=10; 176 | $buffCount=2; 177 | $startPage=1; 178 | 179 | if ($page< $buffCount){ 180 | $startPage=1; 181 | }else if($page>=$buffCount and $page<$totalPage-$maxPageCount ){ 182 | $startPage=$page-$buffCount+1; 183 | }else{ 184 | $startPage=$totalPage-$maxPageCount+1; 185 | } 186 | 187 | $endPage=$startPage+$maxPageCount-1; 188 | 189 | 190 | $htmlstr=""; 191 | 192 | $htmlstr.=""; 193 | if ($page > 1){ 194 | $htmlstr.=""; 195 | $htmlstr.=""; 196 | } 197 | 198 | $htmlstr.=""; 199 | 200 | for ($i=$startPage;$i<=$endPage; $i++){ 201 | 202 | $htmlstr.=""; 203 | } 204 | 205 | if ($page<$totalPage){ 206 | $htmlstr.=""; 207 | $htmlstr.=""; 208 | 209 | } 210 | $htmlstr.="
    第一页 上一页 总共${totalPage}页" . $i . "下一页最后页
    "; 211 | echo $htmlstr; 212 | 213 | ?> 214 | 215 | 216 | 217 | -------------------------------------------------------------------------------- /xadmin/lib/layui/css/modules/laydate/default/laydate.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | .laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:laydate-upbit;animation-name:laydate-upbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@-webkit-keyframes laydate-upbit{from{-webkit-transform:translate3d(0,20px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes laydate-upbit{from{transform:translate3d(0,20px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.laydate-set-ym span,.layui-laydate-header i{padding:0 5px;cursor:pointer}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;color:#999;font-size:18px}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;height:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px 20px}.layui-laydate-footer span{margin-right:15px;display:inline-block;cursor:pointer;font-size:12px}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{height:26px;line-height:26px;margin:0 0 0 -1px;padding:0 10px;border:1px solid #C9C9C9;background-color:#fff;white-space:nowrap;vertical-align:top;border-radius:2px}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-0 .laydate-next-m,.layui-laydate-range .laydate-main-list-0 .laydate-next-y,.layui-laydate-range .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#00F7DE}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eaeaea;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px} -------------------------------------------------------------------------------- /sqladvisor/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in iOS. 9 | */ 10 | 11 | html { 12 | line-height: 1.15; /* 1 */ 13 | -webkit-text-size-adjust: 100%; /* 2 */ 14 | } 15 | 16 | /* Sections 17 | ========================================================================== */ 18 | 19 | /** 20 | * Remove the margin in all browsers. 21 | */ 22 | 23 | body { 24 | margin: 0; 25 | } 26 | 27 | /** 28 | * Correct the font size and margin on `h1` elements within `section` and 29 | * `article` contexts in Chrome, Firefox, and Safari. 30 | */ 31 | 32 | h1 { 33 | font-size: 2em; 34 | margin: 0.67em 0; 35 | } 36 | 37 | /* Grouping content 38 | ========================================================================== */ 39 | 40 | /** 41 | * 1. Add the correct box sizing in Firefox. 42 | * 2. Show the overflow in Edge and IE. 43 | */ 44 | 45 | hr { 46 | box-sizing: content-box; /* 1 */ 47 | height: 0; /* 1 */ 48 | overflow: visible; /* 2 */ 49 | } 50 | 51 | /** 52 | * 1. Correct the inheritance and scaling of font size in all browsers. 53 | * 2. Correct the odd `em` font sizing in all browsers. 54 | */ 55 | 56 | pre { 57 | font-family: monospace, monospace; /* 1 */ 58 | font-size: 1em; /* 2 */ 59 | } 60 | 61 | /* Text-level semantics 62 | ========================================================================== */ 63 | 64 | /** 65 | * Remove the gray background on active links in IE 10. 66 | */ 67 | 68 | a { 69 | background-color: transparent; 70 | } 71 | 72 | /** 73 | * 1. Remove the bottom border in Chrome 57- 74 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 75 | */ 76 | 77 | abbr[title] { 78 | border-bottom: none; /* 1 */ 79 | text-decoration: underline; /* 2 */ 80 | text-decoration: underline dotted; /* 2 */ 81 | } 82 | 83 | /** 84 | * Add the correct font weight in Chrome, Edge, and Safari. 85 | */ 86 | 87 | b, 88 | strong { 89 | font-weight: bolder; 90 | } 91 | 92 | /** 93 | * 1. Correct the inheritance and scaling of font size in all browsers. 94 | * 2. Correct the odd `em` font sizing in all browsers. 95 | */ 96 | 97 | code, 98 | kbd, 99 | samp { 100 | font-family: monospace, monospace; /* 1 */ 101 | font-size: 1em; /* 2 */ 102 | } 103 | 104 | /** 105 | * Add the correct font size in all browsers. 106 | */ 107 | 108 | small { 109 | font-size: 80%; 110 | } 111 | 112 | /** 113 | * Prevent `sub` and `sup` elements from affecting the line height in 114 | * all browsers. 115 | */ 116 | 117 | sub, 118 | sup { 119 | font-size: 75%; 120 | line-height: 0; 121 | position: relative; 122 | vertical-align: baseline; 123 | } 124 | 125 | sub { 126 | bottom: -0.25em; 127 | } 128 | 129 | sup { 130 | top: -0.5em; 131 | } 132 | 133 | /* Embedded content 134 | ========================================================================== */ 135 | 136 | /** 137 | * Remove the border on images inside links in IE 10. 138 | */ 139 | 140 | img { 141 | border-style: none; 142 | } 143 | 144 | /* Forms 145 | ========================================================================== */ 146 | 147 | /** 148 | * 1. Change the font styles in all browsers. 149 | * 2. Remove the margin in Firefox and Safari. 150 | */ 151 | 152 | button, 153 | input, 154 | optgroup, 155 | select, 156 | textarea { 157 | font-family: inherit; /* 1 */ 158 | font-size: 100%; /* 1 */ 159 | line-height: 1.15; /* 1 */ 160 | margin: 0; /* 2 */ 161 | } 162 | 163 | /** 164 | * Show the overflow in IE. 165 | * 1. Show the overflow in Edge. 166 | */ 167 | 168 | button, 169 | input { /* 1 */ 170 | overflow: visible; 171 | } 172 | 173 | /** 174 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 175 | * 1. Remove the inheritance of text transform in Firefox. 176 | */ 177 | 178 | button, 179 | select { /* 1 */ 180 | text-transform: none; 181 | } 182 | 183 | /** 184 | * Correct the inability to style clickable types in iOS and Safari. 185 | */ 186 | 187 | button, 188 | [type="button"], 189 | [type="reset"], 190 | [type="submit"] { 191 | -webkit-appearance: button; 192 | } 193 | 194 | /** 195 | * Remove the inner border and padding in Firefox. 196 | */ 197 | 198 | button::-moz-focus-inner, 199 | [type="button"]::-moz-focus-inner, 200 | [type="reset"]::-moz-focus-inner, 201 | [type="submit"]::-moz-focus-inner { 202 | border-style: none; 203 | padding: 0; 204 | } 205 | 206 | /** 207 | * Restore the focus styles unset by the previous rule. 208 | */ 209 | 210 | button:-moz-focusring, 211 | [type="button"]:-moz-focusring, 212 | [type="reset"]:-moz-focusring, 213 | [type="submit"]:-moz-focusring { 214 | outline: 1px dotted ButtonText; 215 | } 216 | 217 | /** 218 | * Correct the padding in Firefox. 219 | */ 220 | 221 | fieldset { 222 | padding: 0.35em 0.75em 0.625em; 223 | } 224 | 225 | /** 226 | * 1. Correct the text wrapping in Edge and IE. 227 | * 2. Correct the color inheritance from `fieldset` elements in IE. 228 | * 3. Remove the padding so developers are not caught out when they zero out 229 | * `fieldset` elements in all browsers. 230 | */ 231 | 232 | legend { 233 | box-sizing: border-box; /* 1 */ 234 | color: inherit; /* 2 */ 235 | display: table; /* 1 */ 236 | max-width: 100%; /* 1 */ 237 | padding: 0; /* 3 */ 238 | white-space: normal; /* 1 */ 239 | } 240 | 241 | /** 242 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 243 | */ 244 | 245 | progress { 246 | vertical-align: baseline; 247 | } 248 | 249 | /** 250 | * Remove the default vertical scrollbar in IE 10+. 251 | */ 252 | 253 | textarea { 254 | overflow: auto; 255 | } 256 | 257 | /** 258 | * 1. Add the correct box sizing in IE 10. 259 | * 2. Remove the padding in IE 10. 260 | */ 261 | 262 | [type="checkbox"], 263 | [type="radio"] { 264 | box-sizing: border-box; /* 1 */ 265 | padding: 0; /* 2 */ 266 | } 267 | 268 | /** 269 | * Correct the cursor style of increment and decrement buttons in Chrome. 270 | */ 271 | 272 | [type="number"]::-webkit-inner-spin-button, 273 | [type="number"]::-webkit-outer-spin-button { 274 | height: auto; 275 | } 276 | 277 | /** 278 | * 1. Correct the odd appearance in Chrome and Safari. 279 | * 2. Correct the outline style in Safari. 280 | */ 281 | 282 | [type="search"] { 283 | -webkit-appearance: textfield; /* 1 */ 284 | outline-offset: -2px; /* 2 */ 285 | } 286 | 287 | /** 288 | * Remove the inner padding in Chrome and Safari on macOS. 289 | */ 290 | 291 | [type="search"]::-webkit-search-decoration { 292 | -webkit-appearance: none; 293 | } 294 | 295 | /** 296 | * 1. Correct the inability to style clickable types in iOS and Safari. 297 | * 2. Change font properties to `inherit` in Safari. 298 | */ 299 | 300 | ::-webkit-file-upload-button { 301 | -webkit-appearance: button; /* 1 */ 302 | font: inherit; /* 2 */ 303 | } 304 | 305 | /* Interactive 306 | ========================================================================== */ 307 | 308 | /* 309 | * Add the correct display in Edge, IE 10+, and Firefox. 310 | */ 311 | 312 | details { 313 | display: block; 314 | } 315 | 316 | /* 317 | * Add the correct display in all browsers. 318 | */ 319 | 320 | summary { 321 | display: list-item; 322 | } 323 | 324 | /* Misc 325 | ========================================================================== */ 326 | 327 | /** 328 | * Add the correct display in IE 10+. 329 | */ 330 | 331 | template { 332 | display: none; 333 | } 334 | 335 | /** 336 | * Add the correct display in IE 10. 337 | */ 338 | 339 | [hidden] { 340 | display: none; 341 | } 342 | -------------------------------------------------------------------------------- /sqladvisor/css/lib/datatable/buttons.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 3px 8px rgba(0,0,0,0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:0.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}button.dt-button,div.dt-button,a.dt-button{position:relative;display:inline-block;box-sizing:border-box;margin-right:0.333em;padding:0.5em 1em;border:1px solid #999;border-radius:2px;cursor:pointer;font-size:0.88em;color:black;white-space:nowrap;overflow:hidden;background-color:#e9e9e9;background-image:-webkit-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:-moz-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:-ms-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:-o-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:linear-gradient(to bottom, #fff 0%, #e9e9e9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='white', EndColorStr='#e9e9e9');-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;outline:none}button.dt-button.disabled,div.dt-button.disabled,a.dt-button.disabled{color:#999;border:1px solid #d0d0d0;cursor:default;background-color:#f9f9f9;background-image:-webkit-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:-moz-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:-ms-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:-o-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:linear-gradient(to bottom, #fff 0%, #f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#ffffff', EndColorStr='#f9f9f9')}button.dt-button:active:not(.disabled),button.dt-button.active:not(.disabled),div.dt-button:active:not(.disabled),div.dt-button.active:not(.disabled),a.dt-button:active:not(.disabled),a.dt-button.active:not(.disabled){background-color:#e2e2e2;background-image:-webkit-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:-moz-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:-ms-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:-o-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:linear-gradient(to bottom, #f3f3f3 0%, #e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f3f3f3', EndColorStr='#e2e2e2');box-shadow:inset 1px 1px 3px #999999}button.dt-button:active:not(.disabled):hover:not(.disabled),button.dt-button.active:not(.disabled):hover:not(.disabled),div.dt-button:active:not(.disabled):hover:not(.disabled),div.dt-button.active:not(.disabled):hover:not(.disabled),a.dt-button:active:not(.disabled):hover:not(.disabled),a.dt-button.active:not(.disabled):hover:not(.disabled){box-shadow:inset 1px 1px 3px #999999;background-color:#cccccc;background-image:-webkit-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:-moz-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:-ms-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:-o-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:linear-gradient(to bottom, #eaeaea 0%, #ccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#eaeaea', EndColorStr='#cccccc')}button.dt-button:hover,div.dt-button:hover,a.dt-button:hover{text-decoration:none}button.dt-button:hover:not(.disabled),div.dt-button:hover:not(.disabled),a.dt-button:hover:not(.disabled){border:1px solid #666;background-color:#e0e0e0;background-image:-webkit-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:-moz-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:-ms-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:-o-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:linear-gradient(to bottom, #f9f9f9 0%, #e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f9f9f9', EndColorStr='#e0e0e0')}button.dt-button:focus:not(.disabled),div.dt-button:focus:not(.disabled),a.dt-button:focus:not(.disabled){border:1px solid #426c9e;text-shadow:0 1px 0 #c4def1;outline:none;background-color:#79ace9;background-image:-webkit-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:-moz-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:-ms-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:-o-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:linear-gradient(to bottom, #bddef4 0%, #79ace9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#bddef4', EndColorStr='#79ace9')}.dt-button embed{outline:none}div.dt-buttons{position:relative;float:left}div.dt-buttons.buttons-right{float:right}div.dt-button-collection{position:absolute;top:0;left:0;width:150px;margin-top:3px;padding:8px 8px 4px 8px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.4);background-color:white;overflow:hidden;z-index:2002;border-radius:5px;box-shadow:3px 3px 5px rgba(0,0,0,0.3);z-index:2002;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}div.dt-button-collection button.dt-button,div.dt-button-collection div.dt-button,div.dt-button-collection a.dt-button{position:relative;left:0;right:0;display:block;float:none;margin-bottom:4px;margin-right:0}div.dt-button-collection button.dt-button:active:not(.disabled),div.dt-button-collection button.dt-button.active:not(.disabled),div.dt-button-collection div.dt-button:active:not(.disabled),div.dt-button-collection div.dt-button.active:not(.disabled),div.dt-button-collection a.dt-button:active:not(.disabled),div.dt-button-collection a.dt-button.active:not(.disabled){background-color:#dadada;background-image:-webkit-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:-moz-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:-ms-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:-o-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f0f0f0', EndColorStr='#dadada');box-shadow:inset 1px 1px 3px #666}div.dt-button-collection.fixed{position:fixed;top:50%;left:50%;margin-left:-75px;border-radius:0}div.dt-button-collection.fixed.two-column{margin-left:-150px}div.dt-button-collection.fixed.three-column{margin-left:-225px}div.dt-button-collection.fixed.four-column{margin-left:-300px}div.dt-button-collection>*{-webkit-column-break-inside:avoid;break-inside:avoid}div.dt-button-collection.two-column{width:300px;padding-bottom:1px;-webkit-column-count:2;-moz-column-count:2;-ms-column-count:2;-o-column-count:2;column-count:2}div.dt-button-collection.three-column{width:450px;padding-bottom:1px;-webkit-column-count:3;-moz-column-count:3;-ms-column-count:3;-o-column-count:3;column-count:3}div.dt-button-collection.four-column{width:600px;padding-bottom:1px;-webkit-column-count:4;-moz-column-count:4;-ms-column-count:4;-o-column-count:4;column-count:4}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);background:-ms-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:-moz-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:-o-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:-webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, rgba(0,0,0,0.3)), color-stop(1, rgba(0,0,0,0.7)));background:-webkit-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:radial-gradient(ellipse farthest-corner at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);z-index:2001}@media screen and (max-width: 640px){div.dt-buttons{float:none !important;text-align:center}} 2 | --------------------------------------------------------------------------------