<?php
/*
  osCommerce, Open Source E-Commerce Solutions 
http://www.oscommerce.com 

Copyright (c) 2003 osCommerce 

osCommRes, Services Oline 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare 

Released under the GNU General Public License
*/
// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
?>
<!-- notifications //-->
<?php

  if (isset($HTTP_GET_VARS['products_id'])) {
    if (tep_session_is_registered('customer_id')) {
      $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "' and global_product_notifications = '1'");
      $check = tep_db_fetch_array($check_query);
      if ($check['count'] <= 0) {
?>
          <tr>
            <td>
<?php
	if(!defined('BOX_HEADING_NOTIFICATIONS'))define('BOX_HEADING_NOTIFICATIONS', 'Notifications');
	$info_box_contents = array();
    $info_box_contents[] = array('text'  => BOX_HEADING_NOTIFICATIONS );
  new infoBoxHeading($info_box_contents, true, true );

  $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['products_id'])) . "' and customers_id = '" . tep_db_input($customer_id) . "'");
  $check = tep_db_fetch_array($check_query);

  $info_box_contents = array();
  if ($check['count'] > 0) {
    $info_box_contents[] = array('align' => 'left',
                                 'text'  => '<table border="0" cellpadding="2" cellspacing="1"><tr><td class="infoBoxNavigationContent"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxNavigationContent"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', 'NONSSL') . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
  } else {
    $info_box_contents[] = array('align' => 'left',
                                 'text'  => '<table border="0" cellpadding="2" cellspacing="1"><tr><td class="infoBoxNavigationContent"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxNavigationContent"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', 'NONSSL') . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
  }
   new infoBox($info_box_contents);


$info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
                              );
  new infoboxFooter($info_box_contents, true, true);
}}
?>
            </td>
          </tr>
<?php

}
?>
<!-- notifications_eof //-->
