Skip to content

Commit 87804ff

Browse files
PSR-2
1 parent 7328a59 commit 87804ff

3 files changed

Lines changed: 750 additions & 745 deletions

File tree

controllers/admin/AdminGanalyticsAjax.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@
2626

2727
class AdminGanalyticsAjaxController extends ModuleAdminController
2828
{
29-
public $ssl = true;
29+
public $ssl = true;
3030

31-
public function init()
32-
{
33-
$order = new Order((int)Tools::getValue('orderid'));
34-
$context = Context::getContext();
35-
if (Validate::isLoadedObject($order) && (isset($context->employee->id) && $context->employee->id))
36-
{
37-
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET sent = 1, date_add = NOW() WHERE id_order = '.(int)Tools::getValue('orderid'));
38-
die('OK');
39-
}
40-
die('KO');
41-
}
31+
public function init()
32+
{
33+
$order = new Order((int)Tools::getValue('orderid'));
34+
$context = Context::getContext();
35+
if (Validate::isLoadedObject($order) && (isset($context->employee->id) && $context->employee->id)) {
36+
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET sent = 1, date_add = NOW() WHERE id_order = '.(int)Tools::getValue('orderid'));
37+
die('OK');
38+
}
39+
die('KO');
40+
}
4241
}

controllers/front/ajax.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@
2626

2727
class ps_googleanalyticsAjaxModuleFrontController extends ModuleFrontController
2828
{
29-
public $ssl = true;
30-
/*
31-
* @see FrontController::initContent()
32-
*/
33-
public function initContent()
34-
{
35-
parent::initContent();
29+
public $ssl = true;
30+
/*
31+
* @see FrontController::initContent()
32+
*/
33+
public function initContent()
34+
{
35+
parent::initContent();
3636

37-
$order = new Order((int)Tools::getValue('orderid'));
38-
if (!Validate::isLoadedObject($order) || $order->id_customer != (int)Tools::getValue('customer'))
39-
die;
40-
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET sent = 1, date_add = NOW() WHERE id_order = '.(int)Tools::getValue('orderid').' LIMIT 1');
41-
die;
42-
}
37+
$order = new Order((int)Tools::getValue('orderid'));
38+
if (!Validate::isLoadedObject($order) || $order->id_customer != (int)Tools::getValue('customer')) {
39+
die;
40+
}
41+
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET sent = 1, date_add = NOW() WHERE id_order = '.(int)Tools::getValue('orderid').' LIMIT 1');
42+
die;
43+
}
4344
}

0 commit comments

Comments
 (0)