update
This commit is contained in:
BIN
autoload/.DS_Store
vendored
Normal file
BIN
autoload/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
autoload/front/.DS_Store
vendored
Normal file
BIN
autoload/front/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$database['host'] = 'localhost';
|
$database['host'] = 'localhost';
|
||||||
$database['user'] = 'admin_pomysloweprezenty-pl';
|
$database['user'] = 'host700513_pomysloweprezenty-pl';
|
||||||
$database['password'] = 'JW5SxYfYXphpgVdE2zxu';
|
$database['password'] = 'QBVbveHAzR78UN8pc7Um';
|
||||||
$database['name'] = 'admin_pomysloweprezenty-pl';
|
$database['name'] = 'host700513_pomysloweprezenty-pl';
|
||||||
$database['time_debug'] = true;
|
$database['time_debug'] = true;
|
||||||
$database['long_query_time'] = 0.1;
|
$database['long_query_time'] = 0.1;
|
||||||
|
|
||||||
@@ -16,4 +16,7 @@ $config['redis']['port'] = 7001;
|
|||||||
$config['redis']['password'] = 'Tg%79Eex!!ZtJEK';
|
$config['redis']['password'] = 'Tg%79Eex!!ZtJEK';
|
||||||
|
|
||||||
$config['debug']['apilo'] = false;
|
$config['debug']['apilo'] = false;
|
||||||
|
|
||||||
|
$config['trustmate']['enabled'] = true;
|
||||||
|
$config['trustmate']['uid'] = '34eb36ba-c715-4cdc-8707-22376c9f14c7';
|
||||||
?>
|
?>
|
||||||
|
|||||||
95
cron-turstmate.php
Normal file
95
cron-turstmate.php
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
use shop\Order;
|
||||||
|
|
||||||
|
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT ^ E_WARNING ^ E_DEPRECATED );
|
||||||
|
|
||||||
|
function __autoload_my_classes( $classname )
|
||||||
|
{
|
||||||
|
$q = explode( '\\', $classname );
|
||||||
|
$c = array_pop( $q );
|
||||||
|
$f = 'autoload/' . implode( '/', $q ) . '/class.' . $c . '.php';
|
||||||
|
|
||||||
|
if ( file_exists( $f ) )
|
||||||
|
require_once( $f );
|
||||||
|
}
|
||||||
|
|
||||||
|
spl_autoload_register( '__autoload_my_classes' );
|
||||||
|
date_default_timezone_set( 'Europe/Warsaw' );
|
||||||
|
|
||||||
|
require_once 'config.php';
|
||||||
|
require_once 'libraries/medoo/medoo.php';
|
||||||
|
require_once 'libraries/phpmailer/class.phpmailer.php';
|
||||||
|
require_once 'libraries/phpmailer/class.smtp.php';
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if ( !isset( $_SESSION[ 'check' ] ) )
|
||||||
|
{
|
||||||
|
session_regenerate_id();
|
||||||
|
$_SESSION[ 'check' ] = true;
|
||||||
|
$_SESSION[ 'ip' ] = $_SERVER[ 'REMOTE_ADDR' ];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $_SESSION[ 'ip' ] !== $_SERVER[ 'REMOTE_ADDR' ] )
|
||||||
|
{
|
||||||
|
session_destroy();
|
||||||
|
header( 'Location: /' );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mdb = new medoo( [
|
||||||
|
'database_type' => 'mysql',
|
||||||
|
'database_name' => $database[ 'name' ],
|
||||||
|
'server' => $database[ 'host' ],
|
||||||
|
'username' => $database[ 'user' ],
|
||||||
|
'password' => $database[ 'password' ],
|
||||||
|
'charset' => 'utf8'
|
||||||
|
] );
|
||||||
|
|
||||||
|
if ( !$config['trustmate']['enabled'] )
|
||||||
|
{
|
||||||
|
echo 'TrustMate is not enabled.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$settings = \front\factory\Settings::settings_details();
|
||||||
|
|
||||||
|
$order_id = $mdb -> get( 'pp_shop_orders', '*', [ 'AND' => [ 'status' => 6, 'trustmate_send' => 0 ] ] );
|
||||||
|
if ( is_array( $order_id ) and $order_id['id'] )
|
||||||
|
{
|
||||||
|
$order = \front\factory\ShopOrder::order_details( $order_id['id'] );
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>TrustMate Cron</title>
|
||||||
|
<script>
|
||||||
|
TRUST_MATE_USER_NAME = '<?= $order['client_name'];?>';
|
||||||
|
TRUST_MATE_USER_EMAIL = '<?= $order['client_email'];?>';
|
||||||
|
TRUST_MATE_ORDER_NUMBER = '<?= $order['id'];?>';
|
||||||
|
TRUST_MATE_COMPANY_UUID = '<?= $config['trustmate']['uid'];?>';
|
||||||
|
TRUSTMATE_PRODUCTS = [
|
||||||
|
<? foreach ( $order['products'] as $product ):?>
|
||||||
|
{
|
||||||
|
'local_id': <?= (int)$product['product_id'];?>,
|
||||||
|
'name': '<?= $product['name'];?>',
|
||||||
|
'product_url': 'https://pomysloweprezenty.pl<?= \front\factory\ShopProduct::product_url( new \shop\Product( $product['product_id'] ) );?>',
|
||||||
|
"image_url": "https://pomysloweprezenty.pl<?= \front\factory\ShopProduct::product_image( $product['product_id'] );?>"
|
||||||
|
}<? if ( $product != end( $order['products'] ) ) echo ',';?>
|
||||||
|
<? endforeach;?>
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src='https://trustmate.io/api/invitation/script'></script>
|
||||||
|
<script type="text/javascript">var getCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var s=r[n];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""},getUserId=function(){var e=getCookie("twd_u");return""===e?"":e},userId=getUserId(),xhr=new XMLHttpRequest;xhr.open("GET","https://trafficscanner.pl/ws2/index.php/?action=noscript&dt=77&cid=3655&user_id="+userId),xhr.send(); </script><script type="text/javascript" src="https://trafficscanner.pl/ws2/script/setSaleCookie.js"></script>
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>TrustMate Cron</h1>
|
||||||
|
<p>Wysłano zaproszenie do TrustMate dla zamówienia nr <?= $order['id'];?>.</p>
|
||||||
|
<?
|
||||||
|
$mdb -> update( 'pp_shop_orders', [ 'trustmate_send' => 1 ], [ 'id' => $order['id'] ] );
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<?
|
||||||
|
}
|
||||||
BIN
templates/.DS_Store
vendored
Normal file
BIN
templates/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
templates_user/.DS_Store
vendored
Normal file
BIN
templates_user/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
templates_user/components/.DS_Store
vendored
Normal file
BIN
templates_user/components/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -195,25 +195,4 @@
|
|||||||
<? unset( $_SESSION['google-adwords-purchase'] );?>
|
<? unset( $_SESSION['google-adwords-purchase'] );?>
|
||||||
<? endif;?>
|
<? endif;?>
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<? if ( \S::get_session('google-analytics-purchase') ):?>
|
|
||||||
<script>
|
|
||||||
TRUST_MATE_USER_NAME = '<?= $this -> order['client_name'];?>';
|
|
||||||
TRUST_MATE_USER_EMAIL = '<?= $this -> order['client_email'];?>';
|
|
||||||
TRUST_MATE_ORDER_NUMBER = '<?= $this -> order['id'];?>';
|
|
||||||
TRUST_MATE_COMPANY_UUID = '34eb36ba-c715-4cdc-8707-22376c9f14c7';
|
|
||||||
TRUSTMATE_PRODUCTS = [
|
|
||||||
<? foreach ( $this -> order['products'] as $product ):?>
|
|
||||||
{
|
|
||||||
'local_id': <?= (int)$product['product_id'];?>,
|
|
||||||
'name': '<?= $product['name'];?>',
|
|
||||||
'product_url': 'https://pomysloweprezenty.pl<?= \front\factory\ShopProduct::product_url( new \shop\Product( $product['product_id'] ) );?>',
|
|
||||||
"image_url": "https://pomysloweprezenty.pl<?= \front\factory\ShopProduct::product_image( $product['product_id'] );?>"
|
|
||||||
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
|
|
||||||
<? endforeach;?>
|
|
||||||
];
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src='https://trustmate.io/api/invitation/script'></script>
|
|
||||||
<script type="text/javascript">var getCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var s=r[n];" "==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return s.substring(t.length,s.length)}return""},getUserId=function(){var e=getCookie("twd_u");return""===e?"":e},userId=getUserId(),xhr=new XMLHttpRequest;xhr.open("GET","https://trafficscanner.pl/ws2/index.php/?action=noscript&dt=77&cid=3655&user_id="+userId),xhr.send(); </script><script type="text/javascript" src="https://trafficscanner.pl/ws2/script/setSaleCookie.js"></script>
|
|
||||||
<? unset( $_SESSION['google-analytics-purchase'] );?>
|
|
||||||
<? endif;?>
|
|
||||||
Reference in New Issue
Block a user