1
0
mirror of https://gitee.com/zhc02/timely_service.git synced 2025-08-01 20:27:26 +08:00

增加自动安装模块

This commit is contained in:
白鹄 2020-03-12 00:02:09 +08:00
parent 2fdf825cee
commit e94583e40c
20 changed files with 1274 additions and 0 deletions

View File

@ -0,0 +1,216 @@
@charset "utf-8";
* { word-wrap: break-word; outline: none;}
html, body, ul, li, p { padding: 0; margin: 0;}
body { font-family: "microsoft yahei", "Microsoft YaHei", "Lucida Grande", "Lucida Sans Unicode", Tahoma, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; color: #7E8C8D; background-color: #FFFFFF;}
h1, h2, h4, h5, h6 { font-weight: normal; margin: 0;}
i, em { font-style: normal;}
ul, ol, li { list-style-type: none;}
a { color: #16A085; text-decoration: underline; transition: all 0.25s ease 0s;}
html { -webkit-text-size-adjust: none; min-height: 101%;}
/* Form Input
--------------------------------------*/
input[type="text"], input[type="password"] { font-family: Tahoma, Helvetica, Arial, sans-serif; font-size: 12px; color: #7E8C8C; line-height: 20px; text-indent: 6px; height: 20px; padding: 8px 5px; border: 2px solid #BEC3C7; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-transition: border .25s linear, color .25s linear; -moz-transition: border .25s linear, color .25s linear; -o-transition: border .25s linear, color .25s linear; transition: border .25s linear, color .25s linear;}
input[type="text"]:-moz-placeholder, input[type="password"]:-moz-placeholder { color: #B2BCC5;}
input[type="text"]::-webkit-input-placeholder, input[type="password"]::-webkit-input-placeholder { color: #B2BCC5;}
input[type="text"].placeholder, input[type="password"].placeholder { color: #B2BCC5;}
input[type="text"]:focus, input[type="password"]:focus { border-color: #1ABC9C; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}
input[type="text"].flat, input[type="password"].flat { border-color: transparent;}
input[type="text"].flat:hover, input[type="password"].flat:hover { border-color: #BDC3C7;}
input[type="text"].flat:focus, input[type="password"].flat:focus { border-color: #1ABC9C;}
input[disabled], input[readonly], textarea[disabled], textarea[readonly] { color: #D5DBDB; background-color: #F4F6F6; border-color: #D5DBDB; cursor: default;}
input[type="text"], input[type="password"] { width: 290px;}
input.error { border-color: #F30;}
/* Button Style
-------------------------------------- */
.btn { font-size: 18px; line-height: 20px; color: #FFFFFF; background: #BDC3C7; display: inline-block; height: 20px; padding: 15px 30px; margin: 0 5px; border: none; text-decoration: none; text-shadow: none; -webkit-border-radius: 4px; -moz-border-radius: 4px/; border-radius: 4px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -webkit-transition: 0.25s; -moz-transition: 0.25s; -o-transition: 0.25s; transition: 0.25s; -webkit-backface-visibility: hidden;}
.btn:hover, .btn:focus { color: #FFFFFF; background-color: #CACFD2; outline: none; -webkit-transition: 0.25s; -moz-transition: 0.25s; -o-transition: 0.25s; transition: 0.25s; -webkit-backface-visibility: hidden;}
.btn:active, .btn.active { color: rgba(255, 255, 255, 0.75); background-color: #A1A6A9; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}
.btn.disabled, .btn[disabled] { color: rgba(255, 255, 255, 0.75); background-color: #BDC3C7; opacity: 0.7; filter: alpha(opacity=70)/*IE*/; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}
.btn.btn-primary { background-color: #2b81bac9;}
.btn.btn-primary:hover, .btn.btn-primary:focus { background-color: #f40;}
/* Scrollbar jQuery Plugin
-------------------------------------- */
.ps-container .ps-scrollbar-x, .ps-container .ps-scrollbar-y { background-color: #AAA; height: 8px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; position: absolute; z-index: auto; bottom: 3px; opacity: 0; filter: alpha(opacity=0); -webkit-transition: opacity.25s linear; -moz-transition: opacity .25s linear; transition: opacity .25s linear;}
.ps-container .ps-scrollbar-y { right: 3px; width: 8px; bottom: auto; }
.ps-container:hover .ps-scrollbar-x, .ps-container:hover .ps-scrollbar-y { opacity: .6; filter: alpha(opacity=60);}
.ps-container .ps-scrollbar-x:hover, .ps-container .ps-scrollbar-y:hover { opacity: .9; filter: alpha(opacity=90); cursor: default;}
.ps-container .ps-scrollbar-x.in-scrolling, .ps-container .ps-scrollbar-y.in-scrolling { opacity: .9; filter: alpha(opacity=90);}
/* iCheck jquery plugin
-------------------------------------- */
.icheckbox_flat-green, .iradio_flat-green { background: url(../images/install_bg.png) no-repeat; display: block; width: 20px; height: 20px; float: left; margin: 0; padding: 0; border: none; cursor: pointer;}
.icheckbox_flat-green { background-position: 0 -280px;}
.icheckbox_flat-green.checked { background-position: -22px -280px;}
.icheckbox_flat-green.disabled { background-position: -44px -280px; cursor: default;}
.icheckbox_flat-green.checked.disabled { background-position: -66px -280px;}
.iradio_flat-green { background-position: -88px -280px;}
.iradio_flat-green.checked { background-position: -110px -280px;}
.iradio_flat-green.disabled { background-position: -132px -280px; cursor: default;}
.iradio_flat-green.checked.disabled { background-position: -154px -280px;}
/* Layout head
-------------------------------------- */
.header { width: 100%; height: 100px; border-bottom: solid 1px #ECF0F1;}
.header .layout { width: 960px; height: 100px; margin: 0 auto; position: relative; z-index: 1;}
.header .layout .title { height: 60px; position: absolute; z-index: 1; top: 20px; left: 0;}
.header .layout .title h2 { font-size: 36px; line-height: 40px; color: #2b81bac9; display: block; height: 40px;}
.header .layout .title h5 { font-size: 13px; font-weight: 600; line-height: 20px; color: #2C3E50; text-align: center; display: block; height: 20px;}
.header .layout .title h5 i { font-size: 11px; font-weight: normal; display: inline-block; margin: 0 0 0 5px;}
.header .layout .version { color: #7E8C8D; position: absolute; z-index: 1; bottom: 20px; right: 0;}
/* Layout Central
-------------------------------------- */
.main { width: 100%; min-height: 400px; padding: 30px 0;}
/* Layout Bottom - copyright information
-------------------------------------- */
.footer { text-align: center; width: 100%; height: 60px; padding: 10px 0 20px 0; border-top: solid 1px #ECF0F1;}
.footer h5 { font-family: Tahoma, Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 600; line-height: 24px; color: #7E8C8C;}
.footer h5 .blue { color: #2B81BA;}
.footer h5 .orange { color: #E77E23;}
.footer h5 .black { color: #2D3E50;}
.footer h5 sup { color: #34495E; margin-left: 2px;}
.footer h6 { font-family: Tahoma, Helvetica, Arial, sans-serif; font-size: 11px; line-height: 16px; color: #92A5A5;}
.footer h6 a { text-decoration: none; color: #7E8C8C;}
.footer h6 a:hover { text-decoration: blink;}
/* Content section
-------------------------------------- */
.text-box { width: 898px; height: 550px; margin: 0 auto; border: solid 1px #ECF0F1; position: relative; z-index: 1; overflow: hidden;}
.license { line-height: 24px; width: 858px; margin: 20px auto;}
.license h1 { font-size: 18px; line-height: 28px; color: #7E8C8D; text-align: center;}
.license p { font-size: 12px; text-indent: 2em;}
.btn-box { text-align: center; width: 900px; height: 50px; margin: 30px auto auto; overflow: hidden;}
.error { color: red; padding-left:5px;}
/* Installation step by step guide
-------------------------------------- */
.step-box { width: 900px; height: 200px; margin: 0 auto;}
.step-box .text-nav { width: 900px; height: 70px; position: relative; z-index: 1;}
.step-box .text-nav h1 { font-size: 60px; font-weight: 600; line-height: 68px; text-align: right; width: 49%; height: 68px; position: absolute; z-index: 1; top: 0; right: 51%;}
.step-box .text-nav h2 { font-size: 32px; font-weight: 600; line-height: 36px; text-align: left; width: 50%; height: 36px; position: absolute; z-index: 1; top: 4px; left: 51%;}
.step-box .text-nav h5 { font-size: 12px; line-height: 20px; color: #BEC3C6; text-align: left; width: 50%; height: 20px; position: absolute; z-index: 1; bottom: 5px; left: 51%;}
.procedure-nav { width: 900px; height: 100px; margin: 30px auto 0 auto; position: relative; z-index: 1;}
.schedule-ico { position: absolute; z-index: 1; top: 0; left: 0;}
.schedule-ico span { background: url(../images/install_bg.png) no-repeat; display: block; width: 26px; height: 26px; float: left; margin-left: 230px;}
.schedule-ico span.a { background-position: 0 0; margin-left: 50px;}
.schedule-ico span.b { background-position: -30px 0;}
.schedule-ico span.c { background-position: -60px 0;}
.schedule-ico span.d { background-position: -90px 0;}
.schedule-line-bg { background-color: #ECF0F1; width: 900px; height: 8px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; position: absolute; z-index: 1; top: 40px; left: 0;}
.schedule-line-now { background-color: #f50; height: 8px; -webkit-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px; position: absolute; z-index: 2; top: 40px; left: 0;}
.schedule-line-now em { FILTER:progid:DXImageTransform.Microsoft.Gradient(gradientType=1, startColorStr='#f50', endColorStr='#ECF0F1')/*IE6-9*/; background-image: -ms-linear-gradient(right, #ECF0F1 0%, #f50 100%)/* IE10 Consumer Preview */; background-image: -moz-linear-gradient(right, #ECF0F1 0%, #f50 100%)/* Mozilla Firefox */; background-image: -o-linear-gradient(right, #ECF0F1 0%, #f50 100%)/* Opera */; background-image: -webkit-gradient(linear, right top, left top, color-stop(0, #ECF0F1), color-stop(1, #f50))/* Webkit (Safari/Chrome 10) */; background-image: -webkit-linear-gradient(right, #ECF0F1 0%, #f50 100%)/* Webkit (Chrome 11+) */; background-image: linear-gradient(to left, #ECF0F1 0%, #f50 100%)/* W3C Markup, IE10 Release Preview */; display: block; width: 60px; height: 8px; float: right;}
.schedule-point-bg { position: absolute; z-index: 3; top: 32px; left: 0;}
.schedule-point-bg span { background-color: #FFF; display: block; width: 24px; height: 24px; float: left; margin-left: 232px;-webkit-border-radius: 12px;-moz-border-radius: 12px; border-radius: 12px;}
.schedule-point-bg span.a { margin-left: 50px;}
.schedule-point-now { position: absolute; z-index: 4; top: 36px; left: 0;}
.schedule-point-now span { background-color: #ECF0F1; display: block; width: 16px; height: 16px; float: left; margin-left: 240px; -webkit-border-radius: 12px; -moz-border-radius: 12px; border-radius: 12px;}
.schedule-point-now span.a { margin-left: 54px;}
.schedule-text { width: 900px; height: 30px; position: absolute; z-index: 4; top: 66px; left: 0;}
.schedule-text span { font-size: 14px; color: #BEC3C7; text-align: center; display: block; width: 90px; float: left; margin-left: 167px;}
.schedule-text span.a { margin-left: 16px;}
#step1 .schedule-ico span.a { background-position: -120px 0;}
#step1 .schedule-line-now { width: 200px;}
#step1 .schedule-point-now span.a { background-color: #f50;}
#step1 .schedule-text span.a { font-weight: 600; color: #f50;}
#step2 .schedule-ico span.a { background-position: -120px 0;}
#step2 .schedule-ico span.b { background-position: -150px 0;}
#step2 .schedule-line-now { width: 440px;}
#step2 .schedule-point-now span.a, #step2 .schedule-point-now span.b { background-color: #f50;}
#step2 .schedule-text span.a, #step2 .schedule-text span.b { font-weight: 600; color: #f50;}
#step3 .schedule-ico span.a { background-position: -120px 0;}
#step3 .schedule-ico span.b { background-position: -150px 0;}
#step3 .schedule-ico span.c { background-position: -180px 0;}
#step3 .schedule-line-now { width: 680px;}
#step3 .schedule-point-now span.a, #step3 .schedule-point-now span.b, #step3 .schedule-point-now span.c { background-color: #f50;}
#step3 .schedule-text span.a, #step3 .schedule-text span.b, #step3 .schedule-text span.c { font-weight: 600; color: #f50;}
#step4 .schedule-ico span.a { background-position: -120px 0;}
#step4 .schedule-ico span.b { background-position: -150px 0;}
#step4 .schedule-ico span.c { background-position: -180px 0;}
#step4 .schedule-ico span.d { background-position: -210px 0;}
#step4 .schedule-line-now { width: 900px;}
#step4 .schedule-line-now em { display: none;}
#step4 .schedule-point-now span.a, #step4 .schedule-point-now span.b, #step4 .schedule-point-now span.c, #step4 .schedule-point-now span.d { background-color: #f50;}
#step4 .schedule-text span.a, #step4 .schedule-text span.b, #step4 .schedule-text span.c, #step4 .schedule-text span.d { font-weight: 600; color: #f50;}
/* Select Install Module
-------------------------------------- */
.select-install { width: 900px; margin: 20px auto 0 auto;}
.select-install label { display: block; height: 20px; clear: both; margin: 30px auto 0 100px;}
.select-install label h4 { font-size: 13px; font-weight: 600; float: left; margin-left: 6px;}
.select-install label h5 { font-size: 12px; float: left; margin-left: 6px;}
.select-module { background-color: #ECF0F1; width: 100%; height: 250px; margin: 30px auto; padding: 20px 0; position: relative; z-index: 2;}
.select-module .arrow { font-size: 0px; line-height: 0; width: 0px; height: 0px; margin-right: 200px; border-color: transparent transparent #ECF0F1 transparent; border-width: 10px; border-style: dashed dashed solid dashed; position: absolute; z-index: 1; top: -20px; right: 50%;}
.select-module ul { width: 984px; margin: 0 auto; overflow: hidden;}
.select-module ul li { background-color: #FFFFFF; width: 200px; height: 220px; float: left; padding: 15px; margin: 0 8px;}
.select-module ul li .ico { background: url(../images/install_bg.png) no-repeat; width: 96px; height: 96px; margin: 30px auto 0 auto;}
.select-module ul li.shop .ico { background-position: -110px -60px;}
.select-module ul li.cms .ico { background-position: -210px -60px;}
.select-module ul li.circle .ico { background-position: -310px -60px;}
.select-module ul li.microshop .ico { background-position: -410px -60px;}
.select-module ul li h4 { font-size: 16px; font-weight: 600; line-height: 24px; color: #f50; text-align: center; margin-top: 10px;}
.select-module ul li p { font-size: 12px; line-height: 18px; margin: 10px 10px 0 10px;}
/* Test PHP configuration table
-------------------------------------- */
.content-box { width: 900px; margin: 0 auto;}
.content-box table { width: 100%; margin: 20px 0;}
.content-box table caption { font-size: 18px; line-height: 24px; color: #7E8C8D; text-align: left; padding: 5px 1%;}
.content-box table th[scope="col"] { font-size: 14px; line-height: 24px; color: #FFF; background-color: #2b81bac9; text-align: left; height: 20px; padding: 7px 1%;}
.content-box table th[scope="row"] { line-height: 20px; background-color: #ECF0F1; text-align: left; height: 20px; padding: 5px 1%;}
.content-box table th[scope="col"]:first-of-type { border-radius: 5px 0 0 0;}
.content-box table th[scope="col"]:last-of-type { border-radius: 0 5px 0 0;}
.content-box table tr:last-of-type th[scope="row"]:last-of-type { border-radius: 0 0 0 5px;}
.content-box table td { line-height: 20px; background-color: #F5F7F8; height: 20px; padding: 5px 1%;}
.content-box table tr:last-of-type td:last-of-type { border-radius: 0 0 5px 0;}
.content-box table tr:last-of-type td:nth-last-child(3) { border-radius: 0 0 0 5px;}
.content-box table td span { line-height: 20px; display: block; height: 20px;}
.content-box table td span i { background: url(../images/install_bg.png) no-repeat; vertical-align: middle; display: inline-block; width: 16px; height: 16px; margin-right: 6px;}
.content-box table td span.yes i { background-position: 0 -30px;}
.content-box table td span.no i { background-position: -16px -30px;}
.content-box table td span.no { color: #F33;}
/* Fill the form
-------------------------------------- */
.form-box { width: 900px; margin: 0 auto;}
.form-box fieldset { border-width: 1px 0 0 0; border-style: solid; border-color: #ECF0F1;}
.form-box legend { font-size: 18px; line-height: 24px; color: #7E8C8D;}
.form-box div { height: 40px; margin: 10px 0 0 0; clear: both;}
.form-box div label { font-size: 12px; line-height: 40px; color: #94A5A5; text-indent: 80px; display: block; width: 220px; height: 40px; float: left;}
.form-box div span { vertical-align: middle; display: inline-block; width: 300px; height: 40px; position: relative; z-index: 1;}
.form-box div span input { position: absolute; z-index: 1; top: 0; left: 0;}
.form-box div span font { line-height: 20px; background: url(../images/install_bg.png) no-repeat -540px 2px; height: 20px; padding-left: 20px; position: absolute; z-index: 9; top: 10px; right: 5px;}
.form-box div.icheckbox_flat-green { clear: none; }
.form-box div h4 { font-size: 14px; line-height: 40px; color: #94A5A5; float: left; height:40px; margin-left: 6px;}
.form-box div em { color: #BEC3C6; margin-left: 20px;}
/* Installation is complete
-------------------------------------- */
.final-succeed { width: 900px; height: 85px; margin: 10px auto 0 auto; position: relative; z-index: 1;}
.final-succeed span.ico { background: url(../images/install_bg.png) no-repeat 0 -60px; width: 96px; height: 85px; position: absolute; z-index: 1; top: 0; right: 60%;}
.final-succeed h2 { font-size: 32px; font-weight: 600; line-height: 36px; text-align: left; width: 50%; height: 36px; position: absolute; z-index: 1; top: 10px; left: 42%;}
.final-succeed h5 { font-size: 14px; line-height: 20px; color: #BEC3C6; text-align: left; width: 50%; height: 20px; position: absolute; z-index: 1; bottom: 5px; left: 42%;}
.final-site-nav { background-color: #ECF0F1; width: 100%; margin: 50px auto; position: relative; z-index: 2;}
.final-site-nav .arrow { font-size: 0; line-height: 0; width: 0; height: 0; border-style: dashed dashed solid dashed; border-width: 10px; border-color: transparent transparent #ECF0F1 transparent; position: absolute; z-index: 1; top: -20px; right: 50%;}
.final-site-nav ul { width: 400px; height: 210px; margin: 0 auto;}
.final-site-nav ul li { width: 200px; float: left;}
.final-site-nav ul li .ico { background: url(../images/install_bg.png) no-repeat; width: 110px; height: 110px; margin: 20px auto 0 auto;}
.final-site-nav ul li.cms .ico { background-position: 0 -160px;}
.final-site-nav ul li.shop .ico { background-position: -110px -160px;}
.final-site-nav ul li.circle .ico { background-position: -220px -160px;}
.final-site-nav ul li.microshop .ico { background-position: -330px -160px;}
.final-site-nav ul li.admin .ico { background-position: -440px -160px;}
.final-site-nav ul li h5 { font-size: 14px; font-weight: 600; line-height: 24px; text-align: center; margin-top: 10px;}
.final-site-nav ul li h6 { font-size: 12px; line-height: 20px; text-align: center;}
.final-intro { width: 900px; margin: 0 auto;}
.final-intro p { font-size: 14px; margin-left: 300px;}
.final-intro p em { font-size: 12px; color: #BEC3C6;}

View File

@ -0,0 +1,5 @@
/*! perfect-scrollbar - v0.5.6
* http://noraesae.github.com/perfect-scrollbar/
* Copyright (c) 2014 Hyunje Alex Jun; Licensed MIT */
.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;bottom:3px;height:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container.ps-active-x>.ps-scrollbar-x-rail{display:block}.ps-container:hover>.ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-x-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-y-rail{display:block;position:absolute;right:3px;width:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block}.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-y-rail.in-scrolling{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;bottom:0;height:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;right:0;width:8px;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-o-transition:background-color .2s linear;-webkit-transition:background-color.2s linear;-moz-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999}

View File

@ -0,0 +1,55 @@
<?php
/**
*+------------------
* Timely开源客服系统
*+------------------
* Copyright (c) 2019~2020 http://cojz8.cn All rights reserved.
*+------------------
* Author: baihu(280886296@qq.com)
*+------------------
*/
return [
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => '===db_host===',
// 数据库名
'database' => '===db_name===',
// 用户名
'username' => '===db_user===',
// 密码
'password' => '===db_pwd===',
// 端口
'hostport' => '===db_port===',
// 连接dsn
'dsn' => '',
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => 'utf8',
// 数据库表前缀
'prefix' => '===db_prefix===',
// 数据库调试模式
'debug' => true,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy' => 0,
// 数据库读写是否分离 主从式有效
'rw_separate' => false,
// 读写分离后 主服务器数量
'master_num' => 1,
// 指定从服务器序号
'slave_no' => '',
// 是否严格检查字段是否存在
'fields_strict' => true,
// 数据集返回类型
'resultset_type' => 'array',
// 自动写入时间戳字段
'auto_timestamp' => false,
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
// 是否需要进行SQL性能分析
'sql_explain' => false,
// Query类
'query' => '\\think\\db\\Query',
];

View File

@ -0,0 +1,95 @@
CREATE TABLE `#__admin` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`account` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账号',
`password` varchar(155) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '登录密码',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic COMMENT='后台用户表';;
CREATE TABLE `#__chat_log` (
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志id',
`from_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '发送者id',
`from_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '发送者名称',
`from_avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '发送者头像',
`to_id` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '接收方id',
`to_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '接受者名称',
`to_avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '接收者头像',
`message` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '发送的内容',
`send_status` tinyint(1) NULL DEFAULT 1 COMMENT '发送状态 1发送成功 2发送失败 可以重发',
`read_flag` tinyint(1) NULL DEFAULT 1 COMMENT '是否已读 1 未读 2 已读',
`create_time` datetime NOT NULL COMMENT '记录时间',
PRIMARY KEY (`log_id`) USING BTREE,
INDEX `from_id`(`from_id`) USING BTREE,
INDEX `to_id`(`to_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic COMMENT='聊天记录表';
CREATE TABLE `#__kefu_info` (
`kefu_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '客服id',
`kefu_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客服唯一标识',
`kefu_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客服名称',
`kefu_avatar` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客服头像',
`kefu_password` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客服密码',
`online_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '在线状态 1 在线 2 离线',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
`client_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '客服登录标示',
PRIMARY KEY (`kefu_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic COMMENT='客服信息表';
CREATE TABLE `#__visitor` (
`vid` int(11) NOT NULL AUTO_INCREMENT,
`visitor_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客id',
`visitor_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客名称',
`visitor_avatar` varchar(155) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客头像',
`visitor_ip` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '访客ip',
`client_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客户端标识',
`online_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '0 离线 1 在线',
`create_time` datetime NOT NULL COMMENT '访问时间',
PRIMARY KEY (`vid`) USING BTREE,
INDEX `visiter`(`visitor_id`) USING BTREE,
INDEX `time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic COMMENT='访客信息表';
CREATE TABLE `#__visitor_queue` (
`qid` int(11) NOT NULL AUTO_INCREMENT COMMENT '队列id',
`visitor_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客id',
`visitor_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客名称',
`visitor_avatar` varchar(155) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客头像',
`visitor_ip` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '访客ip',
`client_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '客户端标识',
`create_time` datetime NOT NULL COMMENT '访问时间',
`reception_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '接待状态 0 等待接待中 1 接待中 2接待完成',
`kefu_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`kefu_client_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`qid`) USING BTREE,
UNIQUE INDEX `id`(`visitor_id`) USING BTREE,
INDEX `visiter`(`visitor_id`) USING BTREE,
INDEX `time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic COMMENT='聊天等待表';
CREATE TABLE `#__visitor_service_log` (
`vsid` int(11) NOT NULL AUTO_INCREMENT COMMENT '服务编号',
`visitor_id` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客id',
`client_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客的客户端标识',
`visitor_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客名称',
`visitor_avatar` varchar(155) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客头像',
`visitor_ip` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '访客的ip',
`kefu_id` int(11) NOT NULL,
`kefu_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '接待的客服标识',
`kefu_name` varchar(55) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '客服名称',
`start_date` datetime NOT NULL COMMENT '开始服务时间',
`end_date` datetime NULL DEFAULT NULL COMMENT '结束服务时间',
`connect_stauts` tinyint(3) NOT NULL DEFAULT 1 COMMENT '连接状态 1 正在连接 2 关闭连接',
PRIMARY KEY (`vsid`) USING BTREE,
INDEX `user_id,client_id`(`visitor_id`, `client_id`) USING BTREE,
INDEX `kf_id,start_time,end_time`(`kefu_code`, `start_date`, `end_date`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic COMMENT='服务日志表';

View File

@ -0,0 +1,3 @@
INSERT INTO `#__admin` VALUES ('1', 'admin', 'E10ADC3949BA59ABBE56E057F20F883E', '2019-12-17 14:21:46');
INSERT INTO `#__kefu_info` VALUES (30, 'kefu5df785ee07ae1', '客服一', '/static/common/images/kefu.jpg', 'E10ADC3949BA59ABBE56E057F20F883E', 2, '2019-12-16 21:26:06', '2020-02-18 22:24:06',NULL);
INSERT INTO `#__kefu_info` VALUES (31, 'kefu5df786c6a2277', '客服二', '/static/common/images/kefu.jpg', 'E10ADC3949BA59ABBE56E057F20F883E', 2, '2019-12-16 21:29:42', '2019-12-18 14:59:33', NULL);

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,113 @@
<?php
/**
* environmental check
*/
function env_check(&$env_items) {
//$env_items[] = array('name' => '操作系统', 'min' => '无限制', 'good' => 'Linux', 'cur'=>PHP_OS, 'status' =>(PHP_OS =='Linux' ? 1:0));
$env_items[] = array('name' => '操作系统', 'min' => '无限制', 'good' => 'Linux', 'cur'=>PHP_OS, 'status' =>1);
$env_items[] = array('name' => 'PHP版本', 'min' => '7.0', 'good' => '7.0', 'cur' => PHP_VERSION, 'status'=>(PHP_VERSION < 7.0 ? 0:1));
$tmp = function_exists('gd_info') ? gd_info() : array();
preg_match("/[\d.]+/", $tmp['GD Version'],$match);
unset($tmp);
$env_items[] = array('name' => 'GD库', 'min' => '2.0', 'good' => '2.0', 'cur' => $match[0], 'status' => ($match[0] < 2 ? 0:1));
$env_items[] = array('name' => '附件上传', 'min' => '未限制', 'good' => '2M','cur' => ini_get('upload_max_filesize'), 'status' => 1);
$disk_place = function_exists('disk_free_space') ? floor(disk_free_space(ROOT_PATH) / (1024*1024)) : 0;
$env_items[] = array('name' => '磁盘空间', 'min' => '100M', 'good' => '>100M','cur' => empty($disk_place) ? '未知' : $disk_place.'M', 'status' => $disk_place < 100 ? 0:1);
// $env_items[] = array('name' => 'SWOOLE', 'min' => '4.3', 'good' => '> 4.3','cur' =>SWOOLE_VERSION,'status' => 0);
}
/**
* file check
*/
function dirfile_check(&$dirfile_items) {
foreach($dirfile_items as $key => $item) {
$item_path = '/'.$item['path'];
if($item['type'] == 'dir') {
if(!dir_writeable(ROOT_PATH.$item_path)) {
if(is_dir(ROOT_PATH.$item_path)) {
$dirfile_items[$key]['status'] = 0;
$dirfile_items[$key]['current'] = '+r';
} else {
$dirfile_items[$key]['status'] = -1;
$dirfile_items[$key]['current'] = 'nodir';
}
} else {
$dirfile_items[$key]['status'] = 1;
$dirfile_items[$key]['current'] = '+r+w';
}
} else {
if(file_exists(ROOT_PATH.$item_path)) {
if(is_writable(ROOT_PATH.$item_path)) {
$dirfile_items[$key]['status'] = 1;
$dirfile_items[$key]['current'] = '+r+w';
} else {
$dirfile_items[$key]['status'] = 0;
$dirfile_items[$key]['current'] = '+r';
}
} else {
if ($fp = @fopen(ROOT_PATH.$item_path,'wb+')){
$dirfile_items[$key]['status'] = 1;
$dirfile_items[$key]['current'] = '+r+w';
@fclose($fp);
@unlink(ROOT_PATH.$item_path);
}else {
$dirfile_items[$key]['status'] = -1;
$dirfile_items[$key]['current'] = 'nofile';
}
}
}
}
}
/**
* dir is writeable
* @return number
*/
function dir_writeable($dir) {
$writeable = 0;
if(!is_dir($dir)) {
@mkdir($dir, 0755);
}else {
@chmod($dir,0755);
}
if(is_dir($dir)) {
if($fp = @fopen("$dir/test.txt", 'w')) {
@fclose($fp);
@unlink("$dir/test.txt");
$writeable = 1;
} else {
$writeable = 0;
}
}
return $writeable;
}
/**
* function is exist
*/
function function_check(&$func_items) {
$func = array();
foreach($func_items as $key => $item) {
$func_items[$key]['status'] = function_exists($item['name']) ? 1 : 0;
}
}
function show_msg($msg){
global $html_title,$html_header,$html_footer;
include 'step_msg.php';
exit();
}
//make rand
function random($length, $numeric = 0) {
$seed = base_convert(md5(print_r($_SERVER, 1).microtime()), 16, $numeric ? 10 : 35);
$seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
$hash = '';
$max = strlen($seed) - 1;
for($i = 0; $i < $length; $i++) {
$hash .= $seed[mt_rand(0, $max)];
}
return $hash;
}
/**
* drop table
*/
function droptable($table_name){
return "DROP TABLE IF EXISTS `". $table_name ."`;";
}

View File

@ -0,0 +1,15 @@
<?php
$env_items = array();
$dirfile_items = array(
array('type' => 'dir', 'path' => 'data'),
array('type' => 'dir', 'path' => 'install'),
);
$func_items = array(
array('name' => 'fsockopen'),
array('name' => 'gethostbyname'),
array('name' => 'file_get_contents'),
array('name' => 'mb_convert_encoding'),
array('name' => 'json_encode'),
array('name' => 'curl_init'),
);

220
public/install/index.php Normal file
View File

@ -0,0 +1,220 @@
<?php
set_time_limit(0); //设置运行时间
error_reporting(E_ALL & ~E_NOTICE); //显示全部错误
define('ROOT_PATH', dirname(dirname(__FILE__))); //定义根目录
define('DBCHARSET','UTF8'); //设置数据库默认编码
if(function_exists('date_default_timezone_set')){
date_default_timezone_set('Asia/Shanghai');
}
input($_GET);
input($_POST);
function input(&$data){
foreach ((array)$data as $key => $value) {
if(is_string($value)){
if(!get_magic_quotes_gpc()){
$value = htmlentities($value, ENT_NOQUOTES);
$value = addslashes(trim($value));
}
}else{
$data[$key] = input($value);
}
}
}
//判断是否安装过程序
if(is_file('lock') && $_GET['step'] != 5){
@header("Content-type: text/html; charset=UTF-8");
echo "系统已经安装过了如果要重新安装那么请删除install目录下的lock文件";
exit;
}
$html_title = 'Timely客服系统安装向导';
$html_header = <<<EOF
<div class="header">
<div class="layout">
<div class="title">
<h5 style="font-size: 16px;">Timely客服安装向导</h5>
<h2>系统安装向导</h2>
</div>
<div class="version">版本: v1.0.1</div>
</div>
</div>
EOF;
$html_footer = <<<EOF
<div class="footer">
<h5>Powered by <font class="blue">Timely</font><font class="orange"></font></h5>
<h6>版权所有 2019-2020 &copy; <a href="http://www.cnavd.com" target="_blank">Timely</a></h6>
</div>
EOF;
require('./include/function.php');
if(!in_array($_GET['step'], array(1,2,3,4,5))){
$_GET['step'] = 0;
}
switch ($_GET['step']) {
case 1:
require('./include/var.php');
env_check($env_items);
dirfile_check($dirfile_items);
function_check($func_items);
break;
case 3:
$install_error = '';
$install_recover = '';
$demo_data = file_exists('./data/utf8_add.sql') ? true : false;
step3($install_error,$install_recover);
break;
case 4:
break;
case 5:
$sitepath = strtolower(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')));
$sitepath = str_replace('install',"",$sitepath);
$auto_site_url = strtolower('http://'.$_SERVER['HTTP_HOST'].$sitepath);
break;
default:
# code...
break;
}
include ("step_{$_GET['step']}.php");
function step3(&$install_error,&$install_recover){
global $html_title,$html_header,$html_footer;
if ($_POST['submitform'] != 'submit') return;
$db_host = $_POST['db_host'];
$db_port = $_POST['db_port'];
$db_user = $_POST['db_user'];
$db_pwd = $_POST['db_pwd'];
$db_name = $_POST['db_name'];
$db_prefix = $_POST['db_prefix'];
$admin = $_POST['admin'];
$password = $_POST['password'];
if (!$db_host || !$db_port || !$db_user || !$db_pwd || !$db_name || !$db_prefix || !$admin || !$password){
$install_error = '输入不完整,请检查';
}
if(strpos($db_prefix, '.') !== false) {
$install_error .= '数据表前缀为空,或者格式错误,请检查';
}
if(strlen($admin) > 15 || preg_match("/^$|^c:\\con\\con$| |[,\"\s\t\<\>&]|^游客|^Guest/is", $admin)) {
$install_error .= '非法用户名,用户名长度不应当超过 15 个英文字符,且不能包含特殊字符,一般是中文,字母或者数字';
}
if ($install_error != '')
$mysqli = @ new mysqli($db_host, $db_user, $db_pwd, '', $db_port);
if($mysqli->connect_error) {
$install_error = '数据库连接失败';return;
}
if($mysqli->get_server_info()> '5.0') {
$mysqli->query("CREATE DATABASE IF NOT EXISTS `$db_name` DEFAULT CHARACTER SET ".DBCHARSET);
} else {
$install_error = '数据库必须为MySQL5.0版本以上';return;
}
if($mysqli->error) {
$install_error = $mysqli->error;return ;
}
if($_POST['install_recover'] != 'yes' && ($query = $mysqli->query("SHOW TABLES FROM $db_name"))) {
while($row = mysqli_fetch_array($query)) {
if(preg_match("/^$db_prefix/", $row[0])) {
$install_error = '数据表已存在,继续安装将会覆盖已有数据';
$install_recover = 'yes';
return;
}
}
}
require ('step_4.php');
$sitepath = strtolower(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')));
$sitepath = str_replace('install',"",$sitepath);
$auto_site_url = strtolower('http://'.$_SERVER['HTTP_HOST'].$sitepath);
write_config($auto_site_url);
$_charset = strtolower(DBCHARSET);
$mysqli->select_db($db_name);
$mysqli->set_charset($_charset);
$sql = file_get_contents("data/{$_charset}.sql");
//判断是否安装测试数据
if ($_POST['demo_data'] == '1'){
$sql .= file_get_contents("data/{$_charset}_add.sql");
}
$sql = str_replace("\r\n", "\n", $sql);
runquery($sql,$db_prefix,$mysqli);
showjsmessage('初始化数据 ... 成功 ');
//测试数据
if ($_POST['demo_data'] == '1'){
$sql .= file_get_contents("data/{$_charset}_add.sql");
}
//新增一个标识文件,用来屏蔽重新安装
$fp = @fopen('lock','wb+');
@fclose($fp);
exit("<script type=\"text/javascript\">document.getElementById('install_process').innerHTML = '安装完成,下一步...';document.getElementById('install_process').href='index.php?step=5&sitename={$sitename}&username={$username}&password={$password}';</script>");
exit();
}
//execute sql
function runquery($sql, $db_prefix, $mysqli) {
// global $lang, $tablepre, $db;
if(!isset($sql) || empty($sql)) return;
$sql = str_replace("\r", "\n", str_replace('#__', $db_prefix, $sql));
$ret = array();
$num = 0;
foreach(explode(";\n", trim($sql)) as $query) {
$ret[$num] = '';
$queries = explode("\n", trim($query));
foreach($queries as $query) {
$ret[$num] .= (isset($query[0]) && $query[0] == '#') || (isset($query[1]) && isset($query[1]) && $query[0].$query[1] == '--') ? '' : $query;
}
$num++;
}
unset($sql);
foreach($ret as $query) {
$query = trim($query);
if($query) {
if(substr($query, 0, 12) == 'CREATE TABLE') {
$line = explode('`',$query);
$data_name = $line[1];
showjsmessage('数据表 '.$data_name.' ... 创建成功');
$mysqli->query(droptable($data_name));
$mysqli->query($query);
unset($line,$data_name);
} else {
$mysqli->query($query);
}
}
}
}
//抛出JS信息
function showjsmessage($message) {
echo '<script type="text/javascript">showmessage(\''.addslashes($message).' \');</script>'."\r\n";
flush();
ob_flush();
}
//写入config文件
function write_config($url) {
extract($GLOBALS, EXTR_SKIP);
$config = 'data/database.php';
$configfile = @file_get_contents($config);
$configfile = trim($configfile);
$configfile = substr($configfile, -2) == '?>' ? substr($configfile, 0, -2) : $configfile;
$charset = 'UTF-8';
$db_host = $_POST['db_host'];
$db_port = $_POST['db_port'];
$db_user = $_POST['db_user'];
$db_pwd = $_POST['db_pwd'];
$db_name = $_POST['db_name'];
$db_prefix = $_POST['db_prefix'];
$admin = $_POST['admin'];
$password = $_POST['password'];
$db_type = 'mysql';
$cookie_pre = strtoupper(substr(md5(random(6).substr($_SERVER['HTTP_USER_AGENT'].md5($_SERVER['SERVER_ADDR'].$db_host.$db_user.$db_pwd.$db_name.substr(time(), 0, 6)), 8, 6).random(5)),0,4)).'_';
$configfile = str_replace("===url===", $url, $configfile);
$configfile = str_replace("===db_prefix===", $db_prefix, $configfile);
$configfile = str_replace("===db_charset===", $charset, $configfile);
$configfile = str_replace("===db_host===", $db_host, $configfile);
$configfile = str_replace("===db_user===", $db_user, $configfile);
$configfile = str_replace("===db_pwd===", $db_pwd, $configfile);
$configfile = str_replace("===db_name===", $db_name, $configfile);
$configfile = str_replace("===db_port===", $db_port, $configfile);
@file_put_contents('../../config/database.php', $configfile);
}

11
public/install/js/jquery.icheck.min.js vendored Normal file
View File

@ -0,0 +1,11 @@
/*!
* iCheck v0.9.1 jQuery plugin, http://git.io/uhUPMA
*/
(function(f){function C(a,c,d){var b=a[0],e=/er/.test(d)?k:/bl/.test(d)?u:j;active=d==E?{checked:b[j],disabled:b[u],indeterminate:"true"==a.attr(k)||"false"==a.attr(v)}:b[e];if(/^(ch|di|in)/.test(d)&&!active)p(a,e);else if(/^(un|en|de)/.test(d)&&active)w(a,e);else if(d==E)for(var e in active)active[e]?p(a,e,!0):w(a,e,!0);else if(!c||"toggle"==d){if(!c)a[r]("ifClicked");active?b[l]!==x&&w(a,e):p(a,e)}}function p(a,c,d){var b=a[0],e=a.parent(),g=c==j,H=c==k,m=H?v:g?I:"enabled",r=h(b,m+y(b[l])),L=h(b,
c+y(b[l]));if(!0!==b[c]){if(!d&&c==j&&b[l]==x&&b.name){var p=a.closest("form"),s='input[name="'+b.name+'"]',s=p.length?p.find(s):f(s);s.each(function(){this!==b&&f.data(this,n)&&w(f(this),c)})}H?(b[c]=!0,b[j]&&w(a,j,"force")):(d||(b[c]=!0),g&&b[k]&&w(a,k,!1));J(a,g,c,d)}b[u]&&h(b,z,!0)&&e.find("."+F).css(z,"default");e[t](L||h(b,c));e[A](r||h(b,m)||"")}function w(a,c,d){var b=a[0],e=a.parent(),g=c==j,f=c==k,m=f?v:g?I:"enabled",n=h(b,m+y(b[l])),p=h(b,c+y(b[l]));if(!1!==b[c]){if(f||!d||"force"==d)b[c]=
!1;J(a,g,m,d)}!b[u]&&h(b,z,!0)&&e.find("."+F).css(z,"pointer");e[A](p||h(b,c)||"");e[t](n||h(b,m))}function K(a,c){if(f.data(a,n)){var d=f(a);d.parent().html(d.attr("style",f.data(a,n).s||"")[r](c||""));d.off(".i").unwrap();f(D+'[for="'+a.id+'"]').add(d.closest(D)).off(".i")}}function h(a,c,d){if(f.data(a,n))return f.data(a,n).o[c+(d?"":"Class")]}function y(a){return a.charAt(0).toUpperCase()+a.slice(1)}function J(a,c,d,b){if(!b){if(c)a[r]("ifToggled");a[r]("ifChanged")[r]("if"+y(d))}}var n="iCheck",
F=n+"-helper",x="radio",j="checked",I="un"+j,u="disabled",v="determinate",k="in"+v,E="update",l="type",t="addClass",A="removeClass",r="trigger",D="label",z="cursor",G=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini/i.test(navigator.userAgent);f.fn[n]=function(a,c){var d=":checkbox, :"+x,b=f(),e=function(a){a.each(function(){var a=f(this);b=a.is(d)?b.add(a):b.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),
e(this),b.each(function(){"destroy"==a?K(this,"ifDestroyed"):C(f(this),!0,a);f.isFunction(c)&&c()});if("object"==typeof a||!a){var g=f.extend({checkedClass:j,disabledClass:u,indeterminateClass:k,labelHover:!0},a),h=g.handle,m=g.hoverClass||"hover",y=g.focusClass||"focus",v=g.activeClass||"active",z=!!g.labelHover,s=g.labelHoverClass||"hover",B=(""+g.increaseArea).replace("%","")|0;if("checkbox"==h||h==x)d=":"+h;-50>B&&(B=-50);e(this);return b.each(function(){K(this);var a=f(this),b=this,c=b.id,d=
-B+"%",e=100+2*B+"%",e={position:"absolute",top:d,left:d,display:"block",width:e,height:e,margin:0,padding:0,background:"#fff",border:0,opacity:0},d=G?{position:"absolute",visibility:"hidden"}:B?e:{position:"absolute",opacity:0},h="checkbox"==b[l]?g.checkboxClass||"icheckbox":g.radioClass||"i"+x,k=f(D+'[for="'+c+'"]').add(a.closest(D)),q=a.wrap('<div class="'+h+'"/>')[r]("ifCreated").parent().append(g.insert),e=f('<ins class="'+F+'"/>').css(e).appendTo(q);a.data(n,{o:g,s:a.attr("style")}).css(d);
g.inheritClass&&q[t](b.className);g.inheritID&&c&&q.attr("id",n+"-"+c);"static"==q.css("position")&&q.css("position","relative");C(a,!0,E);if(k.length)k.on("click.i mouseenter.i mouseleave.i touchbegin.i touchend.i",function(c){var d=c[l],e=f(this);if(!b[u])if("click"==d?C(a,!1,!0):z&&(/ve|nd/.test(d)?(q[A](m),e[A](s)):(q[t](m),e[t](s))),G)c.stopPropagation();else return!1});a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(c){var d=c[l];c=c.keyCode;if("click"==d)return!1;if("keydown"==
d&&32==c)return b[l]==x&&b[j]||(b[j]?w(a,j):p(a,j)),!1;if("keyup"==d&&b[l]==x)!b[j]&&p(a,j);else if(/us|ur/.test(d))q["blur"==d?A:t](y)});e.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(d){var c=d[l],e=/wn|up/.test(c)?v:m;if(!b[u]){if("click"==c)C(a,!1,!0);else{if(/wn|er|in/.test(c))q[t](e);else q[A](e+" "+v);if(k.length&&z&&e==m)k[/ut|nd/.test(c)?A:t](s)}if(G)d.stopPropagation();else return!1}})})}return this}})(jQuery);

2
public/install/js/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,84 @@
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function($) {
var types = ['DOMMouseScroll', 'mousewheel'];
if ($.event.fixHooks) {
for ( var i=types.length; i; ) {
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
}
}
$.event.special.mousewheel = {
setup: function() {
if ( this.addEventListener ) {
for ( var i=types.length; i; ) {
this.addEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function() {
if ( this.removeEventListener ) {
for ( var i=types.length; i; ) {
this.removeEventListener( types[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
}
};
$.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
});
function handler(event) {
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
// Old school scrollwheel delta
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
// Gecko
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaY = 0;
deltaX = -1*delta;
}
// Webkit
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

55
public/install/step_0.php Normal file
View File

@ -0,0 +1,55 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $html_title; ?></title>
<link href="css/install.css" rel="stylesheet" type="text/css">
<link href="css/perfect-scrollbar.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
</head>
<body>
<?php echo $html_header; ?>
<div class="main">
<div class="text-box" id="text-box">
<div class="license">
<h1>系统安装协议</h1>
<p style="font-size: 15px">欢迎使用Timely在线客服系统Timely在线客服系统采用了ThinkPHP5.1、Layui、Swoole是一款轻量级、高速度的PHP在线客服系统。
您在使用中如有任何问题都可以登录Timely官方网站获取帮助。官方网址为 http://www.cnavd.com。</p>
<h3>I. 协议许可的权利</h3>
<ol>
<li>Timely遵循Apache Lisense 2.0开源协议发布,并提供免费使用。</li>
<li> Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似鼓励代码共享和尊重原作者的著作权允许代码修改再作为开源或商业软件发布。需要满足的条件</li>
<li> 1、需要给用户一份Apache Licence </li>
<li> 2、如果你修改了代码,需要在被修改的文件中说明;</li>
<li> 3、在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明;</li>
<li> 4、如果再发布的产品中包含一个Notice文件则在Notice文件中需要带有本协议内容。你可以在Notice中增加自己的许可但不可以表现为对Apache Licence构成更改。</li>
<li>您可以在本软件基础上进行修改、再编辑、甚至应用于商业项目,但您必须保留本软件相关标识。</li>
</ol>
<h3>II. 免责声明</h3>
<ol>
<li>1、使用Timely构建的网站的任何信息内容以及导致的任何版权纠纷和法律争议及后果Timely官方不承担任何责任。</li>
<li>2 您一旦安装使用Timely即被视为完全理解并接受本协议的各项条款在享有上述条款授予的权力的同时受到相关的约束和限制。</li>
</ol>
<p></p>
<p></p>
<p align="right">Timely研发团队</p>
<p align="right">2019年12月1日</p>
</div>
</div>
<div class="btn-box"><a href="index.php?step=1" class="btn btn-primary">同意协议进入安装</a><a
href="javascript:window.close()" class="btn">不同意</a></div>
</div>
<?php echo $html_footer; ?>
<script type="text/javascript">
$(document).ready(function () {
//自定义滚定条
$('#text-box').perfectScrollbar();
});
</script>
</body>
</html>

98
public/install/step_1.php Normal file
View File

@ -0,0 +1,98 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $html_title;?></title>
<link href="css/install.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script>
$(document).ready(function(){
$('#next').on('click',function(){
if (typeof($('.no').html()) == 'undefined'){
$(this).attr('href','index.php?step=2');
}else{
alert($('.no').eq(0).parent().parent().find('td:first').html()+' 未通过检测!');
$(this).attr('href','###');
}
});
});
</script>
</head>
<body>
<?php echo $html_header;?>
<div class="main">
<div class="step-box" id="step1">
<div class="text-nav">
<h1>Step.1</h1>
<h2>开始安装</h2>
<h5>检测服务器环境及文件目录权限</h5>
</div>
<div class="procedure-nav">
<div class="schedule-ico"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-now"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-bg"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-line-now"><em></em></div>
<div class="schedule-line-bg"></div>
<div class="schedule-text"><span class="a">检查安装环境</span><span class="b">选择安装方式</span><span class="c">创建数据库</span><span class="d">安装</span></div>
</div>
</div>
<div class="content-box">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<caption>
环境检查
</caption>
<tr>
<th scope="col">项目</th>
<th width="25%" scope="col">程序所需</th>
<th width="25%" scope="col">最佳配置推荐</th>
<th width="25%" scope="col">当前服务器</th>
</tr>
<?php foreach($env_items as $v){?>
<tr>
<td scope="row"><?php echo $v['name'];?></td>
<td><?php echo $v['min'];?></td>
<td><?php echo $v['good'];?></td>
<td><span class="<?php echo $v['status'] ? 'yes' : 'no';?>"><i></i><?php echo $v['cur'];?></span></td>
</tr>
<?php }?>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<caption>
目录、文件权限检查
</caption>
<tr>
<th scope="col">目录文件</th>
<th width="25%" scope="col">所需状态</th>
<th width="25%" scope="col">当前状态</th>
</tr>
<?php foreach($dirfile_items as $k => $v){?>
<tr>
<td><?php echo $v['path'];?> </td>
<td><span>可写</span></td>
<td><span class="<?php echo $v['status'] == 1 ? 'yes' : 'no';?>"><i></i><?php echo $v['status'] == 1 ? '可写' : '不可写';?></span></td>
</tr>
<?php }?>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<caption>
函数检查
</caption>
<tr>
<th scope="col">目录文件</th>
<th width="25%" scope="col">所需状态</th>
<th width="25%" scope="col">当前状态</th>
</tr>
<?php foreach($func_items as $k =>$v){?>
<tr>
<td><?php echo $v['name'];?>()</td>
<td><span>支持</span></td>
<td><span class="<?php echo $v['status'] == 1 ? 'yes' : 'no';?>"><i></i><?php echo $v['status'] == 1 ? '支持' : '不支持';?></span></td>
</tr>
<?php }?>
</table>
</div>
<div class="btn-box"><a href="index.php" class="btn btn-primary">上一步</a><a href='###' id="next" class="btn btn-primary">下一步</a></div>
</div>
<?php ECHO $html_footer;?>
</body>
</html>

64
public/install/step_2.php Normal file
View File

@ -0,0 +1,64 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $html_title;?></title>
<link href="css/install.css" rel="stylesheet" type="text/css">
<script src="js/jquery.js"></script>
<script src="js/jquery.icheck.min.js"></script>
<script>
$(document).ready(function(){
$('input[type="radio"]').on('ifChecked', function(event){
if(this.id == 'radio-0'){
$('.select-module').show();
}else{
$('.select-module').hide();
}
}).iCheck({
checkboxClass: 'icheckbox_flat-green',
radioClass: 'iradio_flat-green'
});
$('input[type="checkbox"]').iCheck({
checkboxClass: 'icheckbox_flat-green',
radioClass: 'iradio_flat-green'
});
$('#next').click(function(){
$('#install_form').submit();
});
});
</script>
</head>
<body>
<?php ECHO $html_header;?>
<div class="main">
<div class="step-box" id="step2">
<div class="text-nav">
<h1>Step.2</h1>
<h2>选择安装方式</h2>
<h5>根据需要选择系统模块完全或手动安装</h5>
</div>
<div class="procedure-nav">
<div class="schedule-ico"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-now"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-bg"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-line-now"><em></em></div>
<div class="schedule-line-bg"></div>
<div class="schedule-text"><span class="a">检查安装环境</span><span class="b">选择安装方式</span><span class="c">创建数据库</span><span class="d">安装</span></div>
</div>
</div>
<form method="get" id="install_form" action="index.php">
<input type="hidden" value="3" name="step">
<div class="select-install">
<label>
<input type="radio" name="iCheck" value="full" id="radio-1" class="green-radio" checked >
<h4>完全安装 Timely</h4>
<h5>系统</h5>
</label>
</div>
<div class="btn-box"><a href="index.php?step=1" class="btn btn-primary">上一步</a><a id="next" href="javascript:void(0);" class="btn btn-primary">下一步</a></div>
</form>
</div>
<?php ECHO $html_footer;?>
</body>
</html>

124
public/install/step_3.php Normal file
View File

@ -0,0 +1,124 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $html_title;?></title>
<link href="css/install.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validation.min.js"></script>
<script type="text/javascript" src="js/jquery.icheck.min.js"></script>
<script>
$(document).ready(function(){
$('input[type="checkbox"]').iCheck({
checkboxClass: 'icheckbox_flat-green',
radioClass: 'iradio_flat-green'
});
});
$(function(){
jQuery.validator.addMethod("lettersonly", function(value, element) {
return this.optional(element) || /^[^:%,'\*\"\s\<\>\&]+$/i.test(value);
}, "不得含有特殊字符");
$("#install_form").validate({
errorElement: "font",
rules : {
db_host : {required : true},
db_name : {required : true},
db_user : {required : true},
db_port : {required : true,digits : true},
site_name : {required : true},
admin : {required : true,lettersonly : true},
password : {required : true, minlength : 6},
rpassword : {required : true,equalTo : '#password'},
}
});
jQuery.extend(jQuery.validator.messages, {
required: "未输入",
digits: "格式错误",
lettersonly: "不得含有特殊字符",
equalTo: "两次密码不一致",
minlength: "密码至少6位"
});
$('#next').click(function(){
$('#install_form').submit();
});
});
</script>
</head>
<body>
<?php echo $html_header;?>
<div class="main">
<div class="step-box" id="step3">
<div class="text-nav">
<h1>Step.3</h1>
<h2>创建数据库</h2>
<h5>填写数据库及站点相关信息</h5>
</div>
<div class="procedure-nav">
<div class="schedule-ico"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-now"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-bg"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-line-now"><em></em></div>
<div class="schedule-line-bg"></div>
<div class="schedule-text"><span class="a">检查安装环境</span><span class="b">选择安装方式</span><span class="c">创建数据库</span><span class="d">安装</span></div>
</div>
</div>
<form action="" id="install_form" method="post">
<input type="hidden" value="submit" name="submitform">
<input type="hidden" value="<?php echo $install_recover;?>" name="install_recover">
<div class="form-box control-group">
<fieldset>
<legend>数据库信息</legend>
<div>
<label>数据库服务器</label>
<span>
<input type="text" name="db_host" maxlength="20" value="<?php echo $_POST['db_host'] ? $_POST['db_host'] : '127.0.0.1';?>">
</span> <em>数据库服务器地址一般为localhost</em></div>
<div>
<label>数据库名</label>
<span>
<input type="text" name="db_name" maxlength="40" value="<?php echo $_POST['db_name'] ? $_POST['db_name'] : 'Timely';?>">
</span> <em></em></div>
<div>
<label>数据库用户名</label>
<span>
<input type="text" name="db_user" maxlength="20" value="<?php echo $_POST['db_user'] ? $_POST['db_user'] : 'root';?>">
</span> <em></em></div>
<div>
<label>数据库密码</label>
<span>
<input type="password" name="db_pwd" maxlength="20" value="<?php echo $_POST['db_pwd'] ? $_POST['db_pwd'] : 'root';?>">
</span> <em></em></div>
<div>
<label>数据库表前缀</label>
<span>
<input type="text" name="db_prefix" maxlength="20" value="<?php echo $_POST['db_prefix'] ? $_POST['db_prefix'] : 'ty_';?>">
</span> <em>同一数据库运行多个程序时,请修改前缀</em></div>
<div>
<label>数据库端口</label>
<span>
<input type="text" name="db_port" maxlength="20" value="<?php echo $_POST['db_port'] ? $_POST['db_port'] : '3306';?>">
</span> <em>数据库默认端口一般为3306</em></div>
<?php if ($demo_data) {?>
<div>
<label>&nbsp;</label>
<input type="checkbox" name="demo_data" <?php echo ($_POST['demo_data']==1 ? 'checked':'');?> id="demo_data" value="1" checked>
<h4>安装演示数据</h4></div>
<?php }?>
<?php if ($install_error != ''){?>
<div>
<label></label>
<font class="error"><?php echo $install_error;?></font></div>
<?php }?>
</fieldset>
</div>
<div class="btn-box"><a href="index.php?step=2" class="btn btn-primary">上一步</a><a id="next" href="javascript:void(0);" class="btn btn-primary">下一步</a></div>
</form>
</div>
<?php echo $html_footer;?>
</body>
</html>

50
public/install/step_4.php Normal file
View File

@ -0,0 +1,50 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $html_title;?></title>
<link href="css/install.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<link href="css/perfect-scrollbar.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript">
var scroll_height = 0;
function showmessage(message) {
document.getElementById('license').innerHTML += message+"<br/>";
document.getElementById("text-box").scrollTop = 500+scroll_height;
scroll_height += 40;
}
$(document).ready(function(){
//自定义滚定条
$('#text-box').perfectScrollbar();
});
</script>
</head>
<body>
<?php echo $html_header;?>
<div class="main">
<div class="step-box" id="step4">
<div class="text-nav">
<h1>Step.4</h1>
<h2>安装数据库</h2>
<h5>正在执行数据库安装</h5>
</div>
<div class="procedure-nav">
<div class="schedule-ico"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-now"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-point-bg"><span class="a"></span><span class="b"></span><span class="c"></span><span class="d"></span></div>
<div class="schedule-line-now"><em></em></div>
<div class="schedule-line-bg"></div>
<div class="schedule-text"><span class="a">检查安装环境</span><span class="b">选择安装方式</span><span class="c">创建数据库</span><span class="d">安装</span></div>
</div>
</div>
<div class="text-box" id="text-box">
<div class="license" id="license"></div>
</div>
<div class="btn-box"><a href="javascript:void(0);" id="install_process" class="btn btn-primary">正在安装 ...</a></div>
</div>
<?php echo $html_footer;?>
</body>
</html>

44
public/install/step_5.php Normal file
View File

@ -0,0 +1,44 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $html_title;?></title>
<link href="css/install.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<link href="css/perfect-scrollbar.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
</head>
<body>
<?php echo $html_header;?>
<div class="main">
<div class="final-succeed"> <span class="ico"></span>
<h2>程序已成功安装</h2>
<h5>选择您要进入的页面</h5>
</div>
<div class="final-site-nav">
<div class="arrow"></div>
<ul>
<li class="shop">
<div class="ico"></div>
<h5><a href="/">后台</a></h5>
<h6>系统后台</h6>
</li>
</ul>
</div>
<div class="final-intro">
<p>用户名admin 密码123456</p>
</div>
<div class="final-intro">
</div>
</div>
<?php echo $html_footer;?>
<script type="text/javascript">
$(document).ready(function(){
//自定义滚定条
$('#text-box').perfectScrollbar();
});
</script>
</body>
</html>