Skip to content

Commit

Permalink
little fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ClicShopping authored and ClicShopping committed Nov 25, 2020
1 parent 481203d commit 8698cf5
Show file tree
Hide file tree
Showing 32 changed files with 125 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class="col-md-4 text-md-center float-md-left"><?php echo HTMLOverrideAdmin::file
//***********************************
// extension
//***********************************
echo $CLICSHOPPING_Hooks->output('Categories', 'Page', null, 'display');
echo $CLICSHOPPING_Hooks->output('Categories', 'PageContent', null, 'display');
?>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class="col-md-4 text-md-center float-md-left"><?php echo HTMLOverrideAdmin::file
//***********************************
// extension
//***********************************
echo $CLICSHOPPING_Hooks->output('Categories', 'Page', null, 'display');
echo $CLICSHOPPING_Hooks->output('Categories', 'PageContent', null, 'display');
?>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class="col-1 col-form-label"><?php echo $CLICSHOPPING_Manufacturers->getDef('tit
<?php echo $CLICSHOPPING_Hooks->output('Manufacturers', 'ManufacturersTab4', null, 'display'); ?>
</div>
</div>
<?php echo $CLICSHOPPING_Hooks->output('Manufacturers', 'ManufacturersTab5', null, 'display'); ?>
<?php echo $CLICSHOPPING_Hooks->output('Manufacturers', 'PageContent', null, 'display'); ?>
</div>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$CLICSHOPPING_Manufacturers = Registry::get('Manufacturers');
$CLICSHOPPING_Page = Registry::get('Site')->getPage();
$CLICSHOPPING_Language = Registry::get('Language');
$CLICSHOPPING_Hooks = Registry::get('Hooks');

$languages = $CLICSHOPPING_Language->getLanguages();

Expand Down Expand Up @@ -46,7 +47,7 @@ class="col-md-4 pageHeading"><?php echo '&nbsp;' . $CLICSHOPPING_Manufacturers->
<div class="row">
<div class="col-md-12">
<div class="card-deck">
<?php echo $CLICSHOPPING_Hooks->output('Manufacturers', 'StatsManufacturers'); ?>
<?php echo $CLICSHOPPING_Hooks->output('Stats', 'StatsManufacturers', null, 'display'); ?>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
</div>
</div>
<?php
echo $CLICSHOPPING_Hooks->output('Preview', 'PreviewContent', null, 'display');
echo $CLICSHOPPING_Hooks->output('Preview', 'PageContent', null, 'display');
}
} else {
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class="col-md-1 pageHeading"><?php echo '&nbsp;' . $CLICSHOPPING_Products->getDe
<?php echo HTML::link($CLICSHOPPING_Products->link('Preview&pID=' . $Qproducts->valueInt('products_id') . '?page=' . $page . '&cPath=' . $cPath), HTML::image($CLICSHOPPING_Template->getImageDirectory() . 'icons/preview.gif', $CLICSHOPPING_Products->getDef('icon_preview'))); ?>
<?php echo $CLICSHOPPING_Image->getSmallImageAdmin($Qproducts->valueInt('products_id')); ?>
</td>
<td class="text-md-left"><?php echo HTML::link($CLICSHOPPING_Products->link('Edit&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id')), $Qproducts->value('products_name') . ' [' . $Qproducts->value('products_model') . ']'); ?></td>
<td><?php echo $Qproducts->value('products_name') . ' [' . $Qproducts->value('products_model') . ']'; ?></td>
<td class="text-md-left"><?php echo $Qproducts->value('products_sku'); ?></td>
<td class="text-md-center">
<?php
Expand All @@ -244,6 +244,8 @@ class="col-md-1 pageHeading"><?php echo '&nbsp;' . $CLICSHOPPING_Products->getDe
<td class="text-md-right"><?php echo $Qproducts->valueInt('products_sort_order'); ?></td>
<td class="text-md-right">
<?php
echo HTML::link($CLICSHOPPING_Products->link('Edit&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id')), HTML::image($CLICSHOPPING_Template->getImageDirectory() . 'icons/edit.gif', $CLICSHOPPING_Products->getDef('icon_edit')));
echo '&nbsp;';
echo HTML::link($CLICSHOPPING_Products->link('CopyTo&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id')), HTML::image($CLICSHOPPING_Template->getImageDirectory() . 'icons/copy.gif', $CLICSHOPPING_Products->getDef('icon_copy_to')));
echo '&nbsp;';
echo HTML::link($CLICSHOPPING_Products->link('Move&cPath=' . $cPath . '&pID=' . $Qproducts->valueInt('products_id')), HTML::image($CLICSHOPPING_Template->getImageDirectory() . 'icons/move.gif', $CLICSHOPPING_Products->getDef('icon_move')));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$CLICSHOPPING_Template = Registry::get('TemplateAdmin');
$CLICSHOPPING_ProductsAdmin = Registry::get('ProductsAdmin');
$CLICSHOPPING_Language = Registry::get('Language');
$CLICSHOPPING_Hooks = Registry::get('Hooks');

$CLICSHOPPING_ProductsAttributesAdmin = new ProductsAttributesAdmin;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
$CLICSHOPPING_Language = Registry::get('Language');
$CLICSHOPPING_Address = Registry::get('Address');
$CLICSHOPPING_Suppliers = Registry::get('Suppliers');
$CLICSHOPPING_Hooks = Registry::get('Hooks');
$CLICSHOPPING_Template = Registry::get('TemplateAdmin');

$CLICSHOPPING_Page = Registry::get('Site')->getPage();

Expand Down Expand Up @@ -306,7 +308,7 @@ class="col-md-4 text-md-center float-md-left"><?php echo HTMLOverrideAdmin::file
</div>
</div>
<div class="separator"></div>
<?php echo $CLICSHOPPING_Hooks->output('Catalog', 'SuppliersTab4', null, 'display'); ?>
<?php echo $CLICSHOPPING_Hooks->output('Suppliers', 'PageContent', null, 'display'); ?>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$CLICSHOPPING_Template = Registry::get('TemplateAdmin');
$CLICSHOPPING_Suppliers = Registry::get('Suppliers');
$CLICSHOPPING_Page = Registry::get('Site')->getPage();
$CLICSHOPPING_Hooks =Registry::get('Hooks');

$page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,19 @@ class="col-md-5 pageHeading"><?php echo '&nbsp;' . $CLICSHOPPING_Newsletter->get
while ($Qnewsletters->fetch()) {
// Permettre l'affichage des groupes en mode B2B
if (MODE_B2B_B2C == 'true') {

$QcustomersGroup = $CLICSHOPPING_Newsletter->db->prepare('select customers_group_name
from :table_customers_groups
where customers_group_id = :customers_group_id
');
$QcustomersGroup->bindInt(':customers_group_id', $Qnewsletters->valueInt('customers_group_id'));
$QcustomersGroup->execute();

$customers_group = $QcustomersGroup->fetch();

if ($customers_group['customers_group_name'] == '') {
if (empty($QcustomersGroup->value('customers_group_name'))) {
$customers_group['customers_group_name'] = $CLICSHOPPING_Newsletter->getDef('text_all_customers');
}
}

if ($Qnewsletters->valueInt('languages_id') != 0) {

$QnewslettersLanguages = $CLICSHOPPING_Newsletter->db->prepare('select name
from :table_languages
where languages_id = :language_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ class="col-md-3 pageHeading float-md-left"><?php echo '&nbsp;' . $CLICSHOPPING_C
<th data-checkbox="true" data-field="state"></th>
<th data-field="selected" data-sortable="true" data-visible="false" data-switchable="false"><?php echo $CLICSHOPPING_Customers->getDef('id'); ?></th>
<th data-sortable="true"><?php echo $CLICSHOPPING_Customers->getDef('table_heading_customers_id'); ?></th>

<th data-field="lastname"><?php echo $CLICSHOPPING_Customers->getDef('table_heading_lastname'); ?></th>
<th data-field="firstname"><?php echo $CLICSHOPPING_Customers->getDef('table_heading_firstname'); ?></th>
<th data-field="company"><?php echo $CLICSHOPPING_Customers->getDef('table_heading_entry_company'); ?></th>
<?php
// Permettre le changement de groupe en mode B2B
Expand Down Expand Up @@ -161,7 +159,6 @@ class="col-md-3 pageHeading float-md-left"><?php echo '&nbsp;' . $CLICSHOPPING_C

$Qcustomers->setPageSet((int)MAX_DISPLAY_SEARCH_RESULTS_ADMIN);
$Qcustomers->execute();

} else {
$Qcustomers = $CLICSHOPPING_Customers->db->prepare('select SQL_CALC_FOUND_ROWS c.customers_id,
c.customers_company,
Expand All @@ -188,87 +185,86 @@ class="col-md-3 pageHeading float-md-left"><?php echo '&nbsp;' . $CLICSHOPPING_C

if ($listingTotalRow > 0) {

while ($Qcustomers->fetch()) {
while ($Qcustomers->fetch()) {
// suppression du membre non approuvé
$Qinfo = $CLICSHOPPING_Customers->db->prepare('select customers_info_date_account_created as date_account_created,
customers_info_date_account_last_modified as date_account_last_modified,
customers_info_date_of_last_logon as date_last_logon,
customers_info_number_of_logons as number_of_logons
from :table_customers_info
where customers_info_id = :customers_id
');
$Qinfo->bindInt(':customers_id', $Qcustomers->valueInt('customers_id'));
$Qinfo->execute();

$info = $Qinfo->fetch();

$QcustColl = $CLICSHOPPING_Customers->db->prepare('select customers_group_id,
customers_group_name
from :table_customers_groups
where customers_group_id = :customers_group_id
$Qinfo = $CLICSHOPPING_Customers->db->prepare('select customers_info_date_account_created as date_account_created,
customers_info_date_account_last_modified as date_account_last_modified,
customers_info_date_of_last_logon as date_last_logon,
customers_info_number_of_logons as number_of_logons
from :table_customers_info
where customers_info_id = :customers_id
');
$QcustColl->bindInt(':customers_group_id', $Qcustomers->valueInt('customers_group_id'));
$QcustColl->execute();
$Qinfo->bindInt(':customers_id', $Qcustomers->valueInt('customers_id'));
$Qinfo->execute();

$cust_ret = $QcustColl->fetch();
$info = $Qinfo->fetch();

if ($QcustColl->valueInt('customers_group_id') == 0) {
$cust_ret['customers_group_name'] = $CLICSHOPPING_Customers->getDef('visitor_name');
}
$QcustColl = $CLICSHOPPING_Customers->db->prepare('select customers_group_id,
customers_group_name
from :table_customers_groups
where customers_group_id = :customers_group_id
');
$QcustColl->bindInt(':customers_group_id', $Qcustomers->valueInt('customers_group_id'));
$QcustColl->execute();

if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ((int)$_GET['cID'] === $Qcustomers->valueInt('customers_id')))) && !isset($cInfo)) {
$cust_ret = $QcustColl->fetch();

$Qcountry = $CLICSHOPPING_Customers->db->prepare('select countries_name
from :table_countries
where countries_id = :countries_id
');
if ($QcustColl->valueInt('customers_group_id') == 0) {
$cust_ret['customers_group_name'] = $CLICSHOPPING_Customers->getDef('visitor_name');
}

$Qcountry->bindInt(':countries_id', $Qcustomers->valueInt('entry_country_id'));
$Qcountry->execute();
$country = $Qcountry->fetch();
if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ((int)$_GET['cID'] === $Qcustomers->valueInt('customers_id')))) && !isset($cInfo)) {

$Qreviews = $CLICSHOPPING_Customers->db->prepare('select count(*) as number_of_reviews
from :table_reviews
where customers_id = :customers_id
$Qcountry = $CLICSHOPPING_Customers->db->prepare('select countries_name
from :table_countries
where countries_id = :countries_id
');

$Qreviews->bindInt(':customers_id', $Qcustomers->valueInt('customers_id'));
$Qreviews->execute();
$reviews = $Qreviews->fetch();
$Qcountry->bindInt(':countries_id', $Qcustomers->valueInt('entry_country_id'));
$Qcountry->execute();
$country = $Qcountry->fetch();

// recover from bad records
if (!is_array($Qcountry->fetch())) {
$country = array('Country is NULL');
}
$Qreviews = $CLICSHOPPING_Customers->db->prepare('select count(*) as number_of_reviews
from :table_reviews
where customers_id = :customers_id
');

if (!is_array($Qinfo->fetch())) {
$info = ['Info is NULL'];
}
$Qreviews->bindInt(':customers_id', $Qcustomers->valueInt('customers_id'));
$Qreviews->execute();
$reviews = $Qreviews->fetch();

if (!is_array($Qreviews->fetch())) {
$reviews = ['Customers is NULL'];
}
// recover from bad records
if (!is_array($Qcountry->fetch())) {
$country = array('Country is NULL');
}

if (!is_array($Qinfo->fetch())) {
$info = ['Info is NULL'];
}

$Qorders = $CLICSHOPPING_Customers->db->prepare('select count(*) as number_of_orders
from :table_orders
where customers_id = :customers_id
');
if (!is_array($Qreviews->fetch())) {
$reviews = ['Customers is NULL'];
}

$Qorders->bindInt(':customers_id', $Qcustomers->valueInt('customers_id'));
$Qorders->execute();
$Qorders = $CLICSHOPPING_Customers->db->prepare('select count(*) as number_of_orders
from :table_orders
where customers_id = :customers_id
');

$customer_info = array_merge(array($country), array($info), array($reviews), $Qorders->toArray());
$cInfo_array = array_merge($Qcustomers->toArray(), (array)$customer_info, (array)$cust_ret);
$Qorders->bindInt(':customers_id', $Qcustomers->valueInt('customers_id'));
$Qorders->execute();

$cInfo = new ObjectInfo($cInfo_array);
}
$customer_info = array_merge(array($country), array($info), array($reviews), $Qorders->toArray());
$cInfo_array = array_merge($Qcustomers->toArray(), (array)$customer_info, (array)$cust_ret);

$cInfo = new ObjectInfo($cInfo_array);
}
?>
<td></td>
<td><?php echo $Qcustomers->valueInt('customers_id'); ?></td>

<th scope="row"><?php echo $Qcustomers->valueInt('customers_id'); ?></th>
<td><?php echo $Qcustomers->value('customers_lastname'); ?></td>
<td><?php echo $Qcustomers->value('customers_firstname'); ?></td>
<td><?php echo $Qcustomers->value('customers_lastname') . ' ' . $Qcustomers->value('customers_firstname'); ?></td>
<td><?php echo $Qcustomers->value('entry_company'); ?></td>
<?php
// Permettre le changement de groupe en mode B2B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function execute()
}

// Module de paiement autorise
if ($_POST['payment_unallowed']) {
if (isset($_POST['payment_unallowed'])) {
$group_payment_unallowed = '';

foreach ($_POST['payment_unallowed'] as $key => $val) {
Expand All @@ -74,7 +74,7 @@ public function execute()
}

// Module de livraison autorise
if ($_POST['shipping_unallowed']) {
if (isset($_POST['shipping_unallowed'])) {
$group_shipping_unallowed = '';

foreach ($_POST['shipping_unallowed'] as $key => $val) {
Expand All @@ -86,14 +86,15 @@ public function execute()
$group_shipping_unallowed = substr($group_shipping_unallowed, 0, strlen($group_shipping_unallowed) - 1);
}

$CLICSHOPPING_Groups->db->save('customers_groups', ['customers_group_name' => $customers_groups_name,
'customers_group_discount' => (float)$customers_groups_discount,
'color_bar' => $color_bar,
'group_payment_unallowed' => $group_payment_unallowed,
'group_shipping_unallowed' => $group_shipping_unallowed,
'group_tax' => $group_tax,
'group_order_taxe' => (int)$group_order_taxe,
'customers_group_quantity_default' => (int)$customers_group_quantity_default
$CLICSHOPPING_Groups->db->save('customers_groups', [
'customers_group_name' => $customers_groups_name,
'customers_group_discount' => (float)$customers_groups_discount,
'color_bar' => $color_bar,
'group_payment_unallowed' => $group_payment_unallowed,
'group_shipping_unallowed' => $group_shipping_unallowed,
'group_tax' => $group_tax,
'group_order_taxe' => (int)$group_order_taxe,
'customers_group_quantity_default' => (int)$customers_group_quantity_default
]
);

Expand Down
Loading

0 comments on commit 8698cf5

Please sign in to comment.