<?php
// ---BOF--Hide product from groups ------------------------------------//
?>
<tr align="top"><td><? echo TEXT_HIDE_PRODUCTS_FROM_GROUP; ?></td>
<td class="dataTableContent">
<table border="0" cellpadding="0" cellspacing="0">
<?php
#Check which groups should be hidden
if ($product_id != NULL){
$product_hide_from_group_query = tep_db_query("select products_hide_from_groups from ".TABLE_PRODUCTS." where products_id =".$HTTP_GET_VARS['pID']);
$hide_these_products = tep_db_fetch_array($product_hide_from_group_query);
$hide = explode(',',$hide_these_products['products_hide_from_groups']);
}
$customers_groups_query = tep_db_query("select distinct customers_groups_id, customers_groups_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_groups_id != '" . 0 . "' order by customers_groups_id");
$i=1;
while ($customers_groups = tep_db_fetch_array($customers_groups_query)) {
foreach($hide as $h){
if($h == $customers_groups['customers_groups_id']){
$check_hidden = true;
break;
}else{
$check_hidden = false;
}
}
#print the checkbox field
echo '<tr class="dataTableContent"><td>'.
($i).'. '.
tep_draw_checkbox_field(
'hide[' . ($i++) . ']',
$customers_groups['customers_groups_id'] ,
$check_hidden) . ' '
. $customers_groups['customers_groups_name'].'</td></tr>';
}#End of while
?>
</table>
</td></tr>
<?php
//---EOF--Hide product from groups -----------------------------------//
?>