Preparing Server Transfer 001
This commit is contained in:
parent
c1ca86576d
commit
4f68f5ece4
|
|
@ -2,51 +2,35 @@
|
|||
|
||||
date_default_timezone_set('America/Toronto');
|
||||
|
||||
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
|
||||
// $host = "localhost";
|
||||
$host = "192.168.2.166";
|
||||
$user = "goiintra_root";
|
||||
$pw = "L0C2CKN5GHHY";
|
||||
$dbName = "goiintra_db";
|
||||
} else if ($_SERVER['HTTP_HOST'] == "goi.ifreshy.com") {
|
||||
$host = "localhost";
|
||||
$user = "ifreshy_goi";
|
||||
$pw = "L0C2CKN5GHHY";
|
||||
$dbName = "ifreshy_goi";
|
||||
|
||||
}
|
||||
else if ($_SERVER['HTTP_HOST'] == "www.goiintranet.com"|| $_SERVER['HTTP_HOST'] == "goiintranet.com") {
|
||||
$host = "localhost";
|
||||
$user = "goiintra_root";
|
||||
$pw = "L0C2CKN5GHHY";
|
||||
$dbName = "goiintra_db";
|
||||
}
|
||||
$host = getenv('DB_HOST') ?: 'mis-mysql';
|
||||
$user = getenv('DB_USER') ?: 'goiintra_root';
|
||||
$pw = getenv('DB_PASSWORD') ?: '';
|
||||
$dbName = getenv('DB_NAME') ?: 'goiintra_db';
|
||||
|
||||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
||||
|
||||
try {
|
||||
$conn = new mysqli($host, $user, $pw, $dbName);
|
||||
$conn->set_charset('utf8');
|
||||
} catch (mysqli_sql_exception $e) {
|
||||
error_log($e->getMessage());
|
||||
exit('[DB Error. Please contact administrator.]');
|
||||
}
|
||||
|
||||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
||||
function qry($qry){
|
||||
global $conn;
|
||||
return mysqli_query($conn, $qry);
|
||||
}
|
||||
|
||||
/* DB 연결 확인 */
|
||||
if(!$conn){ die( 'Could not connect: ' . mysqli_error($conn) ); }
|
||||
function fetch_array($qryResult) {
|
||||
return mysqli_fetch_array($qryResult, MYSQLI_ASSOC);
|
||||
}
|
||||
|
||||
mysqli_query($conn, "set names utf8");
|
||||
function db_insert_id() {
|
||||
global $conn;
|
||||
return mysqli_insert_id($conn);
|
||||
}
|
||||
|
||||
function qry($qry){
|
||||
global $conn;
|
||||
return mysqli_query($conn, $qry);
|
||||
}
|
||||
|
||||
function fetch_array($qryResult) {
|
||||
return mysqli_fetch_array($qryResult, MYSQLI_ASSOC);
|
||||
}
|
||||
|
||||
function db_insert_id() {
|
||||
global $conn;
|
||||
return mysqli_insert_id($conn);
|
||||
}
|
||||
|
||||
function db_num_rows($db_query) {
|
||||
return mysqli_num_rows($db_query);
|
||||
}
|
||||
?>
|
||||
function db_num_rows($db_query) {
|
||||
return mysqli_num_rows($db_query);
|
||||
}
|
||||
|
|
@ -1,40 +1,18 @@
|
|||
<?php
|
||||
|
||||
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
|
||||
$DB_HOST = "192.168.2.166";
|
||||
$DB_NAME = "goiintra_db";
|
||||
$DB_USER = "goiintra_root";
|
||||
$DB_PASSWORD = "L0C2CKN5GHHY";
|
||||
|
||||
if ($pdo = new PDO('mysql:host=192.168.2.166;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
|
||||
{echo "";}else{echo "bad news";}
|
||||
$DB_HOST = getenv('DB_HOST') ?: 'mis-mysql';
|
||||
$DB_NAME = getenv('DB_NAME') ?: 'goiintra_db';
|
||||
$DB_USER = getenv('DB_USER') ?: 'goiintra_root';
|
||||
$DB_PASSWORD = getenv('DB_PASSWORD') ?: '';
|
||||
|
||||
}
|
||||
else if ($_SERVER['HTTP_HOST'] == "goi.ifreshy.com") {
|
||||
$DB_HOST = "localhost";
|
||||
$DB_NAME = "ifreshy_goi";
|
||||
$DB_USER = "ifreshy_goi";
|
||||
$DB_PASSWORD = "L0C2CKN5GHHY";
|
||||
|
||||
if ($pdo = new PDO('mysql:host=localhost;dbname=ifreshy_goi', $DB_USER, $DB_PASSWORD))
|
||||
{echo "";}else{echo "bad news";}
|
||||
}
|
||||
else if ($_SERVER['HTTP_HOST'] == "www.goiintranet.com"|| $_SERVER['HTTP_HOST'] == "goiintranet.com") {
|
||||
$DB_HOST = "localhost";
|
||||
$DB_NAME = "goiintra_db";
|
||||
$DB_USER = "goiintra_root";
|
||||
$DB_PASSWORD = "L0C2CKN5GHHY";
|
||||
|
||||
if ($pdo = new PDO('mysql:host=localhost;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
|
||||
{echo "";}else{echo "bad news";}
|
||||
}
|
||||
else {
|
||||
echo "[DB Error. Please contact administrator.]";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$pdo-> exec("set names utf8");
|
||||
|
||||
|
||||
?>
|
||||
try {
|
||||
$pdo = new PDO(
|
||||
"mysql:host={$DB_HOST};dbname={$DB_NAME};charset=utf8",
|
||||
$DB_USER,
|
||||
$DB_PASSWORD,
|
||||
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
error_log($e->getMessage());
|
||||
exit('[DB Error. Please contact administrator.]');
|
||||
}
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
<?
|
||||
ob_start();
|
||||
|
||||
include getenv("DOCUMENT_ROOT")."/include/session_include.php";
|
||||
|
||||
// Start of header
|
||||
include getenv("DOCUMENT_ROOT")."/include/header.php";
|
||||
|
||||
|
||||
// Start of menu
|
||||
include getenv("DOCUMENT_ROOT")."/include/top.php";
|
||||
|
||||
|
||||
// Start of top
|
||||
//if (!strncmp($view,"signup", 5) || !strncmp($view,"login", 5) || !strncmp($view,"my", 2) || !strncmp($view,"study", 5) || !strncmp($view,"about", 5) || !strncmp($view,"resources", 9) || !strncmp($view,"contact", 7)) include getenv("DOCUMENT_ROOT")."/include/mpc-sub-top.php";
|
||||
// else include getenv("DOCUMENT_ROOT")."/include/mpc-top.php";
|
||||
|
||||
// Start of main
|
||||
|
||||
if ($view != "") {
|
||||
$getFile = getenv("DOCUMENT_ROOT")."/doc/".$view.".php";
|
||||
|
||||
if (!is_file($getFile)) {
|
||||
$msg = "SORRY, we couldn't find that page. Please Login again.";
|
||||
//$func -> alertBack($msg);
|
||||
session_destroy();
|
||||
$func -> modalMsg ($msg, "/login_intranet.php");
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
include getenv("DOCUMENT_ROOT")."/doc/".$view.".php"; // Main
|
||||
}
|
||||
}
|
||||
else include getenv("DOCUMENT_ROOT")."/doc/customer_list.php";
|
||||
|
||||
|
||||
// Start of footer
|
||||
include getenv("DOCUMENT_ROOT")."/include/footer.php";
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
// Counter
|
||||
|
||||
// Session
|
||||
//if ($_SESSION['ss_LOGCHECK'] != "1") {
|
||||
|
||||
// Cookie
|
||||
if ($_COOKIE["LOGCHECK"] != "1") {
|
||||
//$setTimeStr = "+1 hour";
|
||||
$today = date("YmdH");
|
||||
$todayDetail = date("YmdHis");
|
||||
|
||||
$columns = array();
|
||||
$values = array();
|
||||
|
||||
// existing date check
|
||||
$query = "select UID,CNT_NUMBER from tbl_counter where CNT_DATE = '$today' ";
|
||||
$result = $jdb->fQuery($query, "fetched query error");
|
||||
|
||||
if($result['UID'] == "") {
|
||||
$columns[] = "CNT_DATE";
|
||||
$columns[] = "CNT_NUMBER";
|
||||
|
||||
$values[] = $today;
|
||||
$values[] = 1;
|
||||
$jdb->iQuery("tbl_counter", $columns, $values);
|
||||
}
|
||||
else {
|
||||
$nowNo = $result['CNT_NUMBER']+1;
|
||||
//echo "BEFORE[$result[CNT_NUMBER]]";
|
||||
$query = " update tbl_counter set CNT_NUMBER = '$nowNo' where UID = '".$result['UID']."' ";
|
||||
$jdb->nQuery($query, "query error");
|
||||
}
|
||||
|
||||
// 사용자 IP 얻어옴
|
||||
$user_ip = $_SERVER["REMOTE_ADDR"];
|
||||
$referer = $_SERVER["HTTP_REFERER"];
|
||||
$user_agent = $_SERVER["HTTP_USER_AGENT"];
|
||||
|
||||
if ($refurl == "") {
|
||||
if (!$referer) $referer="Typing or Bookmark Moving On This Site";
|
||||
}
|
||||
|
||||
|
||||
$rt_geo = json_decode(file_get_contents("http://ip-api.com/json/{$user_ip}"));
|
||||
//print_r ($rt_geo);
|
||||
//echo "{$rt_geo->country},{$rt_geo->city}";//CA,Rogers Communications Canada Inc.
|
||||
|
||||
|
||||
$columns = array();
|
||||
$values = array();
|
||||
|
||||
unset($columns);
|
||||
unset($values);
|
||||
|
||||
$columns[] = "CNT_DATE";
|
||||
$columns[] = "CNT_IP";
|
||||
$columns[] = "CNT_REFERER";
|
||||
$columns[] = "CNT_USERAGENT";
|
||||
|
||||
$columns[] = "CNT_INFO_AS";
|
||||
$columns[] = "CNT_INFO_CITY";
|
||||
$columns[] = "CNT_INFO_COUNTRY";
|
||||
$columns[] = "CNT_INFO_COUNTRYCODE";
|
||||
$columns[] = "CNT_INFO_ISP";
|
||||
$columns[] = "CNT_INFO_LAT";
|
||||
$columns[] = "CNT_INFO_LON";
|
||||
$columns[] = "CNT_INFO_ORG";
|
||||
$columns[] = "CNT_INFO_REGION";
|
||||
$columns[] = "CNT_INFO_REGIONNAME";
|
||||
$columns[] = "CNT_INFO_STATUS";
|
||||
$columns[] = "CNT_INFO_TIMEZONE";
|
||||
$columns[] = "CNT_INFO_ZIP";
|
||||
|
||||
|
||||
$values[] = $todayDetail;
|
||||
$values[] = $user_ip;
|
||||
$values[] = $referer;
|
||||
$values[] = $user_agent;
|
||||
|
||||
$values[] = $rt_geo->as;
|
||||
$values[] = $rt_geo->city;
|
||||
$values[] = $rt_geo->country;
|
||||
$values[] = $rt_geo->countryCode;
|
||||
$values[] = $rt_geo->isp;
|
||||
$values[] = $rt_geo->lat;
|
||||
$values[] = $rt_geo->lon;
|
||||
$values[] = $rt_geo->org;
|
||||
$values[] = $rt_geo->region;
|
||||
$values[] = $rt_geo->regionName;
|
||||
$values[] = $rt_geo->status;
|
||||
$values[] = $rt_geo->timezone;
|
||||
$values[] = $rt_geo->zip;
|
||||
|
||||
|
||||
$jdb->iQuery("tbl_count_details", $columns, $values);
|
||||
|
||||
setcookie("LOGCHECK", "1", time()+3600); // 1h
|
||||
//$_SESSION['ss_LOGCHECK'] = "1"; // 세션에 변수를 저장한다.
|
||||
|
||||
}
|
||||
|
||||
//setcookie("LOGCHECK", "1", time()-3600); // expire cookie
|
||||
|
||||
?>
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
<?
|
||||
ob_start();
|
||||
|
||||
include getenv("DOCUMENT_ROOT")."/include/session_include.php";
|
||||
|
||||
if ($_SESSION['ss_LOGIN'] == 1) {
|
||||
$msg = "You are already logged in. Please proceed to the main page.";
|
||||
$func -> modalMsg ($msg, "/index_intranet.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
|
||||
<title>GOI</title>
|
||||
<meta content="" name="description">
|
||||
<meta content="" name="keywords">
|
||||
|
||||
<!-- Favicons -->
|
||||
<link href="assets/img/cropped-green-oil-favicon-192x192.png" rel="icon">
|
||||
<link href="assets/img/cropped-green-oil-favicon-192x192.png" rel="apple-touch-icon">
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600;1,700&family=Amatic+SC:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Vendor CSS Files -->
|
||||
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
|
||||
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
|
||||
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Template Main CSS File -->
|
||||
<link href="assets/css/main.css" rel="stylesheet">
|
||||
<link href="assets/css/table-style.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
|
||||
<script src="https://www.google.com/recaptcha/api.js?onload=CaptchaCallback&render=explicit" async defer></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var CaptchaCallback = function() {
|
||||
grecaptcha.render('RecaptchaField1', {'sitekey' : '6LfclnokAAAAALCTKrvnxjyIzJZXFWLLr9BZFij5'});
|
||||
grecaptcha.render('RecaptchaField2', {'sitekey' : '6LfclnokAAAAALCTKrvnxjyIzJZXFWLLr9BZFij5'});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@media (max-width:575px) {
|
||||
#rc-imageselect, .g-recaptcha {
|
||||
transform:scale(0.70);
|
||||
transform-origin:0 0;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- ======= Header ======= -->
|
||||
<header id="header" class="header fixed-top d-flex align-items-center">
|
||||
<div class="container d-flex align-items-center justify-content-between">
|
||||
|
||||
<a href="index.html" class="logo d-flex align-items-center me-auto me-lg-0">
|
||||
<img src="assets/img/green-oil-logo-dark.jpg" >
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</header><!-- End Header -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ======= Hero Section ======= -->
|
||||
<section id="hero" class="hero d-flex align-items-center section-bg">
|
||||
<div class="container">
|
||||
<div class="row justify-content-between gy-5">
|
||||
<div class="col-lg-12 order-2 order-lg-1 d-flex flex-column justify-content-center align-items-center align-items-lg-start text-center text-lg-start">
|
||||
<p class="item-inner">WE RECYCLE YOUR</p>
|
||||
<h2 class="item-inner" data-aos="fade-up">USED COOKING OIL</h2>
|
||||
<p class="item-inner" data-aos="fade-up" data-aos-delay="100">
|
||||
AND TRANSFORM IT INTO VALUABLE FEEDSTOCK</br>
|
||||
TO RENEWABLE ENERGY
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section><!-- End Hero Section -->
|
||||
|
||||
<main id="main" class="main">
|
||||
|
||||
<section id="section-login" class="page">
|
||||
<div class="container section-inner" data-aos="fade-up">
|
||||
|
||||
<div class="section-header">
|
||||
<h2>Welcome to Green Oil Inc.</h2>
|
||||
<p>INTRANET SYSTEM</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<form method="post" role="form" class="form-login" action="/lib/login_process.php" data-aos="fade-up" data-aos-delay="100">
|
||||
<input type=hidden name=action value=login>
|
||||
<input type=hidden name=destination value=<?=$destination?>>
|
||||
<input type=hidden name=mode value=<?=$mode?>>
|
||||
|
||||
<label>Email</label>
|
||||
<input type="email" class="form-control" name="confirmID" id="email" required placeholder="Your Email" data-msg="Please enter a valid email">
|
||||
<label>Password</label>
|
||||
<input type="password" class="form-control" name="confirmPW" id="password" required placeholder="Password" data-msg="Please enter a password">
|
||||
<label><div class="g-recaptcha" id="RecaptchaField1" required="required" required ></div></label>
|
||||
<div class="text-center"><button class="btn-primary" type="submit">LOGIN</button></div>
|
||||
</form>
|
||||
</div><!-- End login Form -->
|
||||
|
||||
|
||||
</div>
|
||||
</section><!-- End Book A Table Section -->
|
||||
|
||||
|
||||
</main><!-- End #main -->
|
||||
|
||||
|
||||
<!-- ======= Footer ======= -->
|
||||
<footer id="footer" class="footer">
|
||||
|
||||
<div class="container">
|
||||
<div class="copyright">
|
||||
Copyright © 2022 Green Oil Inc. All Rights Reserved.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</footer><!-- End Footer -->
|
||||
<!-- End Footer -->
|
||||
|
||||
<a href="#" class="scroll-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
|
||||
|
||||
<div id="preloader"></div>
|
||||
|
||||
<!-- Vendor JS Files -->
|
||||
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
|
||||
<script src="assets/vendor/purecounter/purecounter_vanilla.js"></script>
|
||||
<script src="assets/vendor/swiper/swiper-bundle.min.js"></script>
|
||||
|
||||
<!-- jQuery JS -->
|
||||
<script src="/assets/js/vendor/jquery-3.3.1.min.js"></script>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="/assets/js/vendor/bootstrap.min.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.js"></script>
|
||||
|
||||
<!-- Template Main JS File -->
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue