From 065107033bb6e609fefccfccde5de0065a9440a5 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 17 Mar 2018 21:21:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=88=EB=A1=9C=EC=9A=B4=20=EC=84=A4?= =?UTF-8?q?=EC=B9=98=20=EC=BD=94=EB=93=9C=20=EC=A4=80=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/install.css | 67 +++++++++++++++++ css/join.css | 67 +++++++++++++++++ f_func/func.php | 18 ++++- f_install/install.php | 134 +++++++++++++++++++++++++++++---- f_install/j_install_status.php | 44 +++++++++++ install.php | 6 +- js/install.js | 43 +++++++++++ 7 files changed, 360 insertions(+), 19 deletions(-) create mode 100644 css/install.css create mode 100644 css/join.css create mode 100644 f_install/j_install_status.php create mode 100644 js/install.js diff --git a/css/install.css b/css/install.css new file mode 100644 index 00000000..c98cfd6e --- /dev/null +++ b/css/install.css @@ -0,0 +1,67 @@ +body, html{ + height: 100%; + background-repeat: no-repeat; +} + +.main{ + margin-top: 70px; +} + +h1.title { + font-size: 50px; + font-family: 'Passion One', cursive; + font-weight: 400; +} + +hr{ + width: 10%; + /*color: #fff;*/ +} + +.form-group{ + margin-bottom: 15px; +} + +label{ + margin-bottom: 15px; +} + +input, +input::-webkit-input-placeholder { + font-size: 11px; + padding-top: 3px; +} + +.main-login{ + /*background-color: #fff;*/ + /* shadows and rounded borders */ + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + +} + +.main-center{ + margin-top: 30px; + margin: 0 auto; + max-width: 330px; + padding: 40px 40px; + +} + +.login-button{ + margin-top: 5px; +} + +.login-register{ + font-size: 11px; + text-align: center; +} + + +.terms{ + max-height: 200px; overflow: auto; +} diff --git a/css/join.css b/css/join.css new file mode 100644 index 00000000..76822f61 --- /dev/null +++ b/css/join.css @@ -0,0 +1,67 @@ + body, html{ + height: 100%; + background-repeat: no-repeat; +} + +.main{ + margin-top: 70px; +} + +h1.title { + font-size: 50px; + font-family: 'Passion One', cursive; + font-weight: 400; +} + +hr{ + width: 10%; + /*color: #fff;*/ +} + +.form-group{ + margin-bottom: 15px; +} + +label{ + margin-bottom: 15px; +} + +input, +input::-webkit-input-placeholder { + font-size: 11px; + padding-top: 3px; +} + +.main-login{ + /*background-color: #fff;*/ + /* shadows and rounded borders */ + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); + +} + +.main-center{ + margin-top: 30px; + margin: 0 auto; + max-width: 330px; + padding: 40px 40px; + +} + +.login-button{ + margin-top: 5px; +} + +.login-register{ + font-size: 11px; + text-align: center; +} + + +.terms{ + max-height: 200px; overflow: auto; +} diff --git a/f_func/func.php b/f_func/func.php index 0dc98f67..5f740afa 100644 --- a/f_func/func.php +++ b/f_func/func.php @@ -15,7 +15,7 @@ function CustomHeader() { header('Pragma: no-cache'); // header('Cache-Control: public'); // header('Pragma: public'); - header('Content-Type: text/html; charset=utf-8'); +// header('Content-Type: text/html; charset=utf-8'); } //define(CURPATH, 'f_async'); //define(FILE, substr(strrchr(__FILE__, "\\"), 1)); @@ -26,6 +26,22 @@ function getmicrotime() { return $microtimestmp[0] + $microtimestmp[1]; } +function logErrorByCustomHandler(int $errno , string $errstr, string $errfile, int $errline, array $errcontext){ + if (!(error_reporting() & $errno)) { + // This error code is not included in error_reporting, so let it fall + // through to the standard PHP error handler + return false; + } + + $date = date("Ymd_His"); + + file_put_contents(__DIR__.'/../d_log/err_log.txt',"$date, $errno, $errstr, $errfile, $errline\n"); + + /* Don't execute PHP internal error handler */ + return true; +} +set_error_handler("logErrorByCustomHandler"); + function Error($msg) { AppendToFile(ROOT.'/d_log/err.txt', $msg."\n"); exit(1); diff --git a/f_install/install.php b/f_install/install.php index 095cf537..bb531c39 100644 --- a/f_install/install.php +++ b/f_install/install.php @@ -1,18 +1,126 @@ - - - - - 게임 시스템 설치 시작 - + + + + + 설치 + + + + + + + + + +
+

삼국지 모의전투 HiD 설치

+
- -
- -
- +
+ + + + + +
+
+
+ - diff --git a/f_install/j_install_status.php b/f_install/j_install_status.php new file mode 100644 index 00000000..feaf219b --- /dev/null +++ b/f_install/j_install_status.php @@ -0,0 +1,44 @@ +'conn_fail' + ]); +} + +function dbSQLFail($params){ + returnJson([ + 'step'=>'sql_fail' + ]); +} + +if(!$SETTING->isExist()){ + returnJson([ + 'step'=>'config' + ]); +} + +require(__DIR__.'/../f_config/DB.php'); +$rootDB = getRootDB(); + +$rootDB->throw_exception_on_nonsql_error = false; +$rootDB->nonsql_error_handler = 'dbConnFail'; +$rootDB->error_handler = 'dbSQLFail'; + +$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from MEMBER'); +if($memberCnt === 0){ + returnJson([ + 'step'=>'admin' + ]); +} + + +returnJson([ + 'step'=>'done' +]); \ No newline at end of file diff --git a/install.php b/install.php index 0a17d3fe..470f4af5 100644 --- a/install.php +++ b/install.php @@ -1,8 +1,4 @@ - - -Go to f_install/install.php
-Todo: Back to replace code +header('location:f_install/install.php'); \ No newline at end of file diff --git a/js/install.js b/js/install.js new file mode 100644 index 00000000..5c6d309d --- /dev/null +++ b/js/install.js @@ -0,0 +1,43 @@ + + +function changeInstallMode(){ + $.ajax({ + cache:false, + type:'post', + url:'j_install_status.php', + dataType:'json', + }).then(function(result){ + if(result.step == 'config'){ + $('#db_form_card').show(); + $('#admin_form_card').hide(); + return; + } + if(result.step == 'admin'){ + $('#db_form_card').hide(); + $('#admin_form_card').show(); + return; + } + if(result.step == 'done'){ + alert('설치가 완료되었습니다.'); + window.location.href = ".."; + return; + } + if(result.step == 'conn_fail'){ + $('#db_form_card').hide(); + $('#admin_form_card').hide(); + alert('설치 이후 DB 설정이 변경된 것 같습니다. conf.php 파일의 설정을 확인해주십시오.'); + return; + } + if(result.step == 'sql_fail'){ + $('#db_form_card').hide(); + $('#admin_form_card').hide(); + alert('DB가 제대로 설정되지 않았거나, 훼손된 것 같습니다. DB를 복구하거나 conf.php 파일을 삭제 후 재설치를 진행해 주십시오.'); + return; + } + + }); +} + +$(document).ready( function () { + changeInstallMode(); +}); \ No newline at end of file