Commit 117ddd06 authored by Antonio.Suerte's avatar Antonio.Suerte

CDS Popup Banner [Initial Commit]

parent 92f8dd18
......@@ -72,6 +72,19 @@ include_once('template/base_head.php');
</div>
</div>
</div>
<div id="popup_adv" class="add-pop-cont">
<div class="add-popup">
<a href="https://www.iwl.hk/guide/card-guide.php" target="_blank">
<img src="../img/pop-up-banner.jpg">
</a>
<div class="pt40 calign" >
<a class="add-pop-close btn bg-parent px180 m_btn">Close</a>
</div>
</div>
</div>
<!-- /メインカラム -->
</div>
<?php include_once('template/base_foot.php'); ?>
......
This diff is collapsed.
......@@ -64,6 +64,19 @@ include_once('template/base_head.php');
</div>
</div>
</div>
<div id="popup_adv" class="add-pop-cont">
<div class="add-popup">
<a href="https://www.iwl.hk/jp/guide/card-guide.php" target="_blank">
<img src="../img/card-pop-up-JP-v2.jpg">
</a>
<div class="pt40 calign" >
<a class="add-pop-close btn bg-parent px180 m_btn">閉じる</a>
</div>
</div>
</div>
<!-- /メインカラム -->
</div>
<?php include_once('template/base_foot.php'); ?>
......
......@@ -11,7 +11,7 @@
var loc = window.location.pathname;
if(loc == "/ja/menu" || loc == "/ja/menu.php" || loc == "/en/menu" || loc == "/en/menu.php") {
if(loc == "/ja/menu" || loc == "/ja/menu.php") {
var slideIndex = Math.floor((Math.random() * document.getElementsByClassName("mySlides").length));
} else {
var slideIndex = 1;
......@@ -52,22 +52,32 @@ $(window).on('hashchange', function(e){
});
$(function(){
$('.mySlides').click(function() {
$.ajax({
url:'../api/getAds.php',
type: 'post',
dataType: 'text',
data: {
location: 'menu',
adsId: $(this).attr('id'),
link: $(this).find('a').attr('href'),
user_id: $('#user_id').val(),
lang: $('html').attr('lang')
}
});
});
$('.mySlides').click(function() {
$.ajax({
url:'../api/getAds.php',
type: 'post',
dataType: 'text',
data: {
location: 'menu',
adsId: $(this).attr('id'),
link: $(this).find('a').attr('href'),
user_id: $('#user_id').val(),
lang: $('html').attr('lang')
}
});
});
$.post("menu?type=advertisement")
.done(function(advflg){
if(advflg.accountType == 0 && advflg.adStatus)
$("#popup_adv").addClass("active")
})
$('.add-pop-close').click(function(e) {
$(".add-pop-cont").removeClass("active")
})
});
......@@ -22,9 +22,6 @@ class ControlMenu extends LogicMenu {
* @return : なし
-------------------------------------------------------------------------*/
function action() {
// 変数宣言部
$result = NO_STRING;
try {
$this -> checkAvailability("site", function(){
require_once $this -> getUserHTML('TEMPLATE_MAINTENANCE_MODE_SITE_PATH');
......@@ -32,11 +29,17 @@ class ControlMenu extends LogicMenu {
});
// アクション実行
$result = $this -> logic();
// 画面の表示
require_once($this -> getUserHTML('TEMPLATE_MENU_PATH', $this -> dispHTML()));
$this -> logic();
switch($this -> getType()){
case "advertisement":
$this -> adsLogic();
break;
default:
require_once($this -> getUserHTML('TEMPLATE_MENU_PATH', $this -> dispHTML()));
break;
}
} catch (Exception $e) {
header('Location: /' . $this -> getLangage() . '/login');
}
......
......@@ -37,6 +37,39 @@ class LogicMenu extends MenuModelClass {
}
}
public function adsLogic(){
header("Content-type:text/json;");
if($this -> getColumnData($_SERVER, "REQUEST_METHOD") != "POST")
throw new Exception();
$account = $this -> getRowData($this -> getAccountCommon($this -> getUserData(PARAM_USER_ACCOUNT)));
$expirationDate = strtotime("2022-04-01");
$result = $this -> accessSelect("SELECT_DEPOSIT_CDS_FOR_CHECKING",
[$this -> getUserData(PARAM_USER_ACCOUNT)]);
$language = strtolower($this -> getLangage());
$siteSessionPopupAdvertisement = isset($_SESSION[SITE_USER_DATA]['adv_popup_session']);
$adStatus = (
!$this -> isLoopData($this -> getRowData($result)) &&
$expirationDate > strtotime(date("Y-m-d")) &&
in_array($language, ["en", "ja"]) &&
!$siteSessionPopupAdvertisement
);
if(!$siteSessionPopupAdvertisement && !$this -> isLoopData($this -> getRowData($result)))
$_SESSION[SITE_USER_DATA]["adv_popup_session"] = VAL_INT_1;
echo json_encode([
"accountType" => $this -> getColumnData($account, PARAM_ACCOUNT_TYPE),
"adStatus" => $adStatus
]);
}
/*-------------------------------------------------------------------------
* @function_name: ロジックの実行
* @parameter : なし
......
......@@ -1611,6 +1611,25 @@
deposit.d_id= '__ELEMENT01__'
AND users.admin_flg = 0 AND users.status in (2,3,4,5,6,7)
</SELECT_DEPOSIT>
<!--
Advertisement Query
-->
<SELECT_DEPOSIT_CDS_FOR_CHECKING>
SELECT
transaction_number,
amount,
currency,
deposit_date,
fee
FROM
t_deposit
WHERE
user_account = '__ELEMENT01__'
AND
deposit_bank = 'Credit Card Deposit'
LIMIT 5
</SELECT_DEPOSIT_CDS_FOR_CHECKING>
<!--
入金の登録
......
......@@ -268,27 +268,33 @@ class AdminLogModelClass extends ModelClassEx {
public function getWhere(){
// 変数宣言部
$where = NO_STRING;
$rtn = array();
$category = array();
$where = NO_STRING;
$rtn = array();
$category = array();
$searching = false;
// search name
if($this -> name != NO_STRING) {
$searching = true;
$where .= ' AND (users_admin.last_name LIKE (\')%' . $this -> name . '%(\') OR users_admin.first_name LIKE (\')%' . $this -> name . '%(\'))';
}
// search details
if($this -> details != NO_STRING) {
$where .= ' AND (login_history.details LIKE (\')%' . $this -> details . '%(\'))';
$searching = true;
$where .= ' AND (login_history.details LIKE (\')%' . $this -> details . '%(\'))';
}
// search ip
if($this -> ip != NO_STRING) {
$searching = true;
$where .= ' AND (login_history.ip_address LIKE (\')%' . $this -> ip . '%(\'))';
}
//search via status
if(is_array($this -> category)) {
$searching = true;
$where .= ' AND (';
foreach($this -> category as $row)
......@@ -301,14 +307,19 @@ class AdminLogModelClass extends ModelClassEx {
if($this -> sDate != NO_STRING){
//search via date (FROM)
if($this -> sFrom != NO_STRING) {
$searching = true;
$where .= ' AND login_history.create_time >= (\')' . str_replace(DELIMIT_SLASH, DELIMIT_HYPHEN, $this -> sFrom) . '(\')';
}
//search via date (TO)
if($this -> sTo != NO_STRING) {
$searching = true;
$where .= ' AND login_history.create_time < DATE_ADD((\')' . str_replace(DELIMIT_SLASH, DELIMIT_HYPHEN, $this -> sTo) . '(\'), INTERVAL 1 DAY)';
}
}else{
}
// default condition if there's nothing to search when fetching data
if(!$searching){
$where .= ' AND login_history.create_time >= (\')' . date('Y-m-01') . '(\')';
$where .= ' AND login_history.create_time < DATE_ADD((\')' . date('Y-m-d') . '(\'), INTERVAL 1 DAY)';
}
......
......@@ -551,7 +551,7 @@ class AdminUserModelClass extends ModelClassEx {
</tr>
<tr>
<th>'.VAL_STR_PASSWORD.'</th>
<td>' . $this -> getColumnData($row, COLUMN_PASSWORD) . '</td>
<td><code>内緒</code></td>
</tr>';
}
} else {
......
......@@ -104,23 +104,16 @@ class LoginHistoryModelClass extends ModelClassEx {
public function getWhere() {
// 変数宣言部
$rtn = array();
$page = NO_STRING;
// ログインチェック
if(!$this -> checkAdminUserLogin()) {
throw new Exception(NO_STRING);
}
$rtn = array();
$page = NO_STRING;
// 口座番号(検索項目)
if($this -> sUserAccout != NO_STRING) {
if($this -> sUserAccout != NO_STRING)
$rtn[] = ' users.user_account = (\')' . $this -> sUserAccout . '(\') ';
}
// IPアドレス(検索項目)
if($this -> sIPAddress != NO_STRING) {
if($this -> sIPAddress != NO_STRING)
$rtn[] = ' login_history.ip_address = (\')' . $this -> sIPAddress . '(\') ';
}
if($this -> loginFlg != NO_STRING){
......@@ -131,8 +124,9 @@ class LoginHistoryModelClass extends ModelClassEx {
// 登録時刻(終了)(検索項目)
if($this -> sTo != NO_STRING)
$rtn[] = ' login_history.create_time < DATE_ADD((\')' . $this -> sTo . '(\'), INTERVAL 1 DAY)';
}else{
}
if(!$this -> isLoopData($rtn)){
$firstDayOfTheMonth = date("Y-m-01");
$crrntDayOfTheMonth = date("Y-m-d");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment