CMXX - First testing

This commit is contained in:
“VeLiTi”
2025-03-07 15:07:15 +01:00
parent 5dd2973a26
commit cd0e04981c
81 changed files with 697 additions and 325 deletions

View File

@@ -2033,4 +2033,59 @@ input.banner_deny:hover {
.dropdown-content img {
width: 20px;
height: auto;
}
.loading-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.8);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9999;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s, visibility 0.3s;
}
.loading-container.active {
opacity: 1;
visibility: visible;
}
.loading-bar {
width: 200px;
height: 10px;
background-color: #f0f0f0;
border-radius: 5px;
overflow: hidden;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.progress {
height: 100%;
width: 0%;
background-color: #4CAF50;
animation: progressAnimation 2s infinite ease-in-out;
}
.loading-text {
margin-top: 10px;
font-size: 14px;
color: #333;
}
@keyframes progressAnimation {
0% { width: 0%; }
50% { width: 100%; }
100% { width: 0%; }
}
/* Hide the loading bar when page is loaded */
.loaded .loading-container {
display: none;
}

View File

@@ -35,7 +35,7 @@ function template_header($title, $head = '') {
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
//build up settings
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 'Admin' ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 1 ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
//check for age_consent
if (age_verification_enabled){
@@ -69,10 +69,113 @@ if (veliti_analytics){
<link href="{$base_url}custom/css/style.css" rel="stylesheet" type="text/css">
<link href="{$base_url}custom/css/custom.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
<script>
// Wait for DOM to be ready before accessing elements
document.addEventListener('DOMContentLoaded', function() {
// Get loading screen element
const loadingScreen = document.getElementById('loadingScreen');
// Only proceed if the element exists
if (!loadingScreen) {
console.error('Loading screen element not found!');
return;
}
// Show loading screen
function showLoading() {
loadingScreen.classList.add('active');
}
// Hide loading screen
function hideLoading() {
loadingScreen.classList.remove('active');
}
// Show loading when page initially loads
showLoading();
// Hide loading when everything is loaded
window.addEventListener('load', hideLoading);
// In case the page loads very quickly
setTimeout(hideLoading, 500);
// Intercept form submissions
setupFormInterception();
// Intercept fetch and XMLHttpRequest
interceptNetworkRequests();
// Intercept all form submissions
function setupFormInterception() {
const forms = document.querySelectorAll('form');
forms.forEach(form => {
form.addEventListener('submit', function(e) {
// Show loading screen before form submission
showLoading();
});
});
}
// Intercept all network requests (fetch and XMLHttpRequest)
function interceptNetworkRequests() {
// Track active requests
let activeRequests = 0;
// Intercept fetch API
const originalFetch = window.fetch;
window.fetch = function() {
showLoading();
activeRequests++;
return originalFetch.apply(this, arguments)
.then(response => {
activeRequests--;
if (activeRequests === 0) hideLoading();
return response;
})
.catch(error => {
activeRequests--;
if (activeRequests === 0) hideLoading();
throw error;
});
};
// Intercept XMLHttpRequest
const originalXHROpen = XMLHttpRequest.prototype.open;
const originalXHRSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.open = function() {
return originalXHROpen.apply(this, arguments);
};
XMLHttpRequest.prototype.send = function() {
showLoading();
activeRequests++;
this.addEventListener('loadend', function() {
activeRequests--;
if (activeRequests === 0) hideLoading();
});
return originalXHRSend.apply(this, arguments);
};
}
});
</script>
$veliti_analytics
$head
</head>
<body $style>
<!-- Loading Bar -->
<div class="loading-container" id="loadingScreen">
<div class="loading-bar">
<div class="progress"></div>
</div>
<div class="loading-text">Loading, please wait...</div>
</div>
<header>
<div class="content-wrapper">
<h1>
@@ -145,7 +248,7 @@ function template_header_top($title, $head = '') {
$about_link = url('index.php?page=about');
$myaccount_link = url('index.php?page=myaccount');
$cart_link = url('index.php?page=cart');
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 'Admin' ? '<a href="' . base_url . 'admin/index.php" target="_blank">Admin</a>' : '';
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 1 ? '<a href="' . base_url . 'admin/index.php" target="_blank">Admin</a>' : '';
$logout_link = isset($_SESSION['account_loggedin']) ? '<a title="Logout" href="' . url('index.php?page=logout') . '"><i class="fas fa-sign-out-alt"></i></a>' : '';
$site_name = site_name;
$site_title = site_title;
@@ -186,10 +289,113 @@ function template_header_top($title, $head = '') {
<link href="{$base_url}custom/css/style.css" rel="stylesheet" type="text/css">
<link href="{$base_url}custom/css/custom.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
<script>
// Wait for DOM to be ready before accessing elements
document.addEventListener('DOMContentLoaded', function() {
// Get loading screen element
const loadingScreen = document.getElementById('loadingScreen');
// Only proceed if the element exists
if (!loadingScreen) {
console.error('Loading screen element not found!');
return;
}
// Show loading screen
function showLoading() {
loadingScreen.classList.add('active');
}
// Hide loading screen
function hideLoading() {
loadingScreen.classList.remove('active');
}
// Show loading when page initially loads
showLoading();
// Hide loading when everything is loaded
window.addEventListener('load', hideLoading);
// In case the page loads very quickly
setTimeout(hideLoading, 500);
// Intercept form submissions
setupFormInterception();
// Intercept fetch and XMLHttpRequest
interceptNetworkRequests();
// Intercept all form submissions
function setupFormInterception() {
const forms = document.querySelectorAll('form');
forms.forEach(form => {
form.addEventListener('submit', function(e) {
// Show loading screen before form submission
showLoading();
});
});
}
// Intercept all network requests (fetch and XMLHttpRequest)
function interceptNetworkRequests() {
// Track active requests
let activeRequests = 0;
// Intercept fetch API
const originalFetch = window.fetch;
window.fetch = function() {
showLoading();
activeRequests++;
return originalFetch.apply(this, arguments)
.then(response => {
activeRequests--;
if (activeRequests === 0) hideLoading();
return response;
})
.catch(error => {
activeRequests--;
if (activeRequests === 0) hideLoading();
throw error;
});
};
// Intercept XMLHttpRequest
const originalXHROpen = XMLHttpRequest.prototype.open;
const originalXHRSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.open = function() {
return originalXHROpen.apply(this, arguments);
};
XMLHttpRequest.prototype.send = function() {
showLoading();
activeRequests++;
this.addEventListener('loadend', function() {
activeRequests--;
if (activeRequests === 0) hideLoading();
});
return originalXHRSend.apply(this, arguments);
};
}
});
</script>
$veliti_analytics
$head
</head>
<body>
<!-- Loading Bar -->
<div class="loading-container" id="loadingScreen">
<div class="loading-bar">
<div class="progress"></div>
</div>
<div class="loading-text">Loading, please wait...</div>
</div>
<main>
$banner
$age_consent
@@ -215,7 +421,7 @@ function template_menu(){
$default_country = isset($_SESSION['country_code']) ? strtolower($_SESSION['country_code']) : language_code;
//build up settings
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 'Admin' ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
$admin_link = isset($_SESSION['account_loggedin'], $_SESSION['account_role']) && $_SESSION['account_role'] == 1 ? '<a href="' . base_url . 'admin/index.php" title="Settings" target="_blank"><i class="fa-solid fa-sliders"></i></a> ': '';
// DO NOT INDENT THE BELOW CODE
@@ -346,8 +552,11 @@ function template_footer() {
// Order email
//++++++++++++++++++++++++++++++++++++++++++++++++++++
//Template header order email
function template_order_email_header() {
include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
function template_order_email_header($user_language) {
$user_language = ((isset($_SESSION['country_code']))? $_SESSION['country_code'] :$user_language);
include './custom/translations/translations_'.strtoupper($user_language).'.php';
$home_link = url('index.php');
$myaccount_link = url('index.php?page=myaccount');

View File

@@ -1,16 +1,4 @@
<?php
defined($security_key) or exit;
//------------------------------------------
// Content Reset Email
//------------------------------------------
$newuser_subject = 'CustomerPortal user created';
$newuser_header = 'Dear CustomerPortal user';
$newuser_text = 'Your administrator has provided access to the CustomerPortal.';
$newuser_credential_text_1 = 'Your account has been created with username ';
$newuser_credential_text_2 = 'Please click the button below to complete your registration.';
$newuser_closure = 'For security reasons this link is only active for 10 minutes.';
<?php defined(security_key) or exit;
//------------------------------------------
// Content Reset Email
@@ -44,18 +32,18 @@ $message = '
<table class="content" width="600" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse; border: 1px solid #cccccc;">
<!-- Header -->
<tr>
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
CustomerPortal
<td class="header" style="background-color:'.color.'; padding: 40px; text-align: center; color: white; font-size: 24px;">
'.site_title.'
</td>
</tr>
<!-- Body -->
<tr>
<td class="body" style="padding: 40px; text-align: left; font-size: 16px; line-height: 1.6;">
' . $newuser_header . ',
'.$newuser_header.',
<br>
<br>
'.$newuser_text.' '.$newuser_credential_text_1.'<b>'.$post_content['username'].'</b>
'.$newuser_text.' '.$newuser_credential_text_1.'<b>'.$account['identity'].'</b>
<br>
<br>
'.$newuser_credential_text_2.'
@@ -68,8 +56,8 @@ $message = '
<!-- CTA Button -->
<table cellspacing="0" cellpadding="0" style="margin: auto;">
<tr>
<td align="center" style="background-color: #008685; padding: 10px 20px; border-radius: 5px;">
<a href="https://' . base_url . '/page=myaccount?activation_key='.$resetkey.'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">Reset Password</a>
<td align="center" style="background-color: '.color_accent.'; padding: 10px 20px; border-radius: 5px;">
<a href="'.url('index.php?page=myaccount?activation_key='.$account['accountID'].'').'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">'.(${$verify_account} ?? 'Verify account').'</a>
</td>
</tr>
</table>
@@ -77,20 +65,20 @@ $message = '
</tr>
<tr>
<td class="body" style="padding: 40px; text-align: left; font-size: 16px; line-height: 1.6;">
' . $newuser_closure . '
<br>
'.$newuser_closure.'
<br>
Kind regards,
<br>
'.$newuser_signature.'
<br>
<br>
Service team
'.$newuser_signature_name.'
<br>
<br>
</td>
</tr>
<!-- Footer -->
<tr>
<td class="footer" style="background: url(\'https://'.base_url.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color: #005655; padding: 40px;">
<td class="footer" style="background: url(\'https://'.base_url.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color:'.color.'; padding: 40px;">
</td>
</tr>
</table>

View File

@@ -1,13 +1,4 @@
<?php
defined($security_key) or exit;
//------------------------------------------
// Content Reset Email
//------------------------------------------
$changeuser_subject = 'CustomerPortal - password reset requested';
$changeuser_header = 'Dear CustomerPortal user';
$changeuser_text = 'A password reset has been requested for your account.';
$changeuser_credential_text_1 = 'Please click the button below to reset the password of your CustomerPortal account.';
$changeuser_closure = 'For security reasons this link is only active for 10 minutes.';
<?php defined(security_key) or exit;
//------------------------------------------
// Content Reset Email
@@ -42,14 +33,14 @@ $message = '
<!-- Header -->
<tr>
<td class="header" style="background-color:#005655; padding: 40px; text-align: center; color: white; font-size: 24px;">
CustomerPortal
'.site_title.'
</td>
</tr>
<!-- Body -->
<tr>
<td class="body" style="padding: 40px; text-align: left; font-size: 16px; line-height: 1.6;">
' . $changeuser_header . ',
'.$changeuser_header.',
<br>
<br>
'.$changeuser_text.'
@@ -66,7 +57,7 @@ $message = '
<table cellspacing="0" cellpadding="0" style="margin: auto;">
<tr>
<td align="center" style="background-color: #008685; padding: 10px 20px; border-radius: 5px;">
<a href="https://' . $portalURL . '/reset.php?resetkey='.$resetkey.'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">Reset Password</a>
<a href="'.url('index.php?page=myaccount?reset_key='.$account['resetkey'].'').'" target="_blank" style="color: #ffffff; text-decoration: none; font-weight: bold;">'.(${$reset_account} ?? 'Reset account').'</a>
</td>
</tr>
</table>
@@ -74,20 +65,20 @@ $message = '
</tr>
<tr>
<td class="body" style="padding: 40px; text-align: left; font-size: 16px; line-height: 1.6;">
' . $changeuser_closure . '
'.$changeuser_closure.'
<br>
<br>
Kind regards,
'.$changeuser_signature.'
<br>
<br>
Service team
'.$changeuser_signature_name.'
<br>
<br>
</td>
</tr>
<!-- Footer -->
<tr>
<td class="footer" style="background: url(\'https://'.$portalURL.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color: #005655; padding: 40px;">
<td class="footer" style="background: url(\'https://'.base_url.emaillogo.'\');background-position: center center;background-repeat:no-repeat;background-size:contain;background-color:'.color.'; padding: 40px;">
</td>
</tr>
</table>

View File

@@ -1,6 +1,6 @@
<?php defined(security_key) or exit; ?>
<?=template_order_email_header()?>
<?=template_order_email_header('')?>
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
</tr>
<tr><td><br></td></tr>
@@ -39,9 +39,17 @@
</thead>
<tbody>
<?php foreach($products['products'] as $product): ?>
<?php
if (isset($product['options']) && $product['options'] !=''){
$prod_options = '';
foreach ($product['options'] as $prod_opt){
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
}
}
?>
<tr>
<td><?=${$product['meta']['name']} ?? $product['meta']['name']?></td>
<td><?=implode(", ", $product['options'])?></td>
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
<td><?=$product['quantity']?></td>
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>

View File

@@ -2,8 +2,8 @@
//(defined(security_key) or defined('admin')) or exit; ?>
<?=template_order_email_header()?>
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
<?=template_order_email_header($user_language)?>
<?php include './custom/translations/translations_'.strtoupper($user_language).'.php';?>
</tr>
<tr><td><br></td></tr>
<tr>
@@ -39,9 +39,18 @@
<tbody>
<?php
foreach($invoice_cust['products'] as $product): ?>
<?php
if (isset($product['options']) && $product['options'] !=''){
$prod_options = '';
foreach ($product['options'] as $prod_opt){
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
}
}
?>
<tr>
<td><?=${$product['product_name']} ?? $product['product_name'] ?></td>
<td><?=implode(", ", $product['options'])?></td>
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
<td><?=$product['quantity']?></td>
<td><?=currency_code?> <?=number_format($product['price'],2)?></td>
<td style="text-align:right;"><?=currency_code?> <?=number_format($product['line_total'],2)?></td>

View File

@@ -1,6 +1,6 @@
<?php defined(security_key) or exit; ?>
<?=template_order_email_header()?>
<?=template_order_email_header('')?>
<?php include './custom/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';?>
</tr>
@@ -19,8 +19,8 @@
<h1><?=$order_email_message_1?></h1>
<p><?=$order_email_message_2?></p></td>
<td>
<p>Order: <?=$order_id?></p>
<p>Date: <?php echo date("Y-m-d");?></p></td>
<p><?=$order_invoice_text ?? 'Invoice'?>: <?=$order_id?></p>
<p><?=$order_date_text ?? 'Date'?>: <?php echo date("Y-m-d");?></p></td>
</tr>
</table>
</div>
@@ -40,9 +40,17 @@
</thead>
<tbody>
<?php foreach($products['products'] as $product): ?>
<?php
if (isset($product['options']) && $product['options'] !=''){
$prod_options = '';
foreach ($product['options'] as $prod_opt){
$prod_options .= (${$prod_opt} ?? $prod_opt).', ';
}
}
?>
<tr>
<td><?=${$product['product_name']} ?? $product['product_name']?></td>
<td><?=implode(", ", $product['options'])?></td>
<td><?=htmlspecialchars(substr($prod_options, 0,-2), ENT_QUOTES)?></td>
<td><?=$product['quantity']?></td>
<td><?=currency_code?><?=number_format($product['options_price'],2)?></td>
<td style="text-align:right;"><?=number_format($product['options_price'] * $product['quantity'],2)?></td>

View File

@@ -17,6 +17,7 @@ define('age_verification_enabled',false);
define('veliti_analytics',false);
// Default logtraffic
define('log_usage',false);
/* Banners */
// Show offer at home page
define('show_offer_home_page',true);
@@ -24,7 +25,6 @@ define('show_offer_home_text','Free shipping on all of our watches');
// Show offer at products page
define('show_offer_product_page',true);
define('show_offer_product_text','Free shipping on all of our watches');
//Banner at site entry
define('banner_enabled',false);
define('banner_wow','Introduction offer');
@@ -33,6 +33,14 @@ define('banner_link','https://www.kickstarter.com/projects/morvalwatches/morval-
define('banner_btn_1','Continue@Kickstarter');
define('banner_btn_2','Stay@MorvalWatches');
/*Appearance*/
//Icon
define('icon_image','custom/assets/MORVALFavicon.svg');
define('color','#005655c2');
define('color_accent','#2FAC66');
//EMAIL LOGO
define('emaillogo','custom/assets/MORVALFavicon.svg');
/* Detailed settings */
// Homepage highlightedproducts
define('category_id_highlighted_products_1','6');
@@ -93,8 +101,6 @@ define('about_morval_image_1','custom/assets/morval_about_morval_monument_detail
define('about_morval_image_2','custom/assets/morval_about_morval_bordje.png');
// ABOUT MORVAL image 3
define('about_morval_image_3','custom/assets/morval_about_morval_monument_overzicht.png');
//Icon
define('icon_image','custom/assets/MORVALFavicon.svg');
//Banner
define('banner_background','custom/assets/morval_banner.jpg');
@@ -133,8 +139,6 @@ define('mail_enabled',true);
define('email','info@gewoonlekkerspaans.nl');
// Receive email notifications?
define('email_notifications',false);
//EMAIL LOGO
define('emaillogo','custom/assets/MORVALFavicon.svg');
//Additional phpmailer-settings
define('email_host_name','gewoonlekkerspaans.nl');
define('email_reply_to','info@gewoonlekkerspaans.nl');
@@ -152,10 +156,10 @@ define('db_pass','4~gv71bM6');
// Database name
define('db_name','shoppingcart_advanced'); //morvalwatches
/* API */
define('clientID','paul@veliti.nl'); //morvalwatches
define('clientsecret','test1234'); //morvalwatches
define('clientID','MorvalWatches'); //morvalwatches
define('clientsecret','MW2024!'); //morvalwatches
define('api_url','https://dev.veliti.nl/api.php'); //morvalwatches
define('img_url',substr(api_url, 0, -8));
define('img_url','https://dev.veliti.nl/');
/* Payment options */
//Pay on Delivery