<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=account_notifications.<br />
 * Allows customer to manage product notifications
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_account_notifications_default.php 3206 2006-03-19 04:04:09Z birdbrain $
 */
?>
<div class="centerColumn" id="accountNotifications">
<?php echo zen_draw_form('account_notifications', zen_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')) . zen_draw_hidden_field('action', 'process'); ?>

<p class="notice important"><?php echo MY_NOTIFICATIONS_DESCRIPTION; ?></p>
<br>

<h3 class="section-title"><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></h3>
<div class="checkbox">
	<label class="checkboxLabel" for="globalnotify">
	<?php echo zen_draw_checkbox_field('product_global', '1', (($global->fields['global_product_notifications'] == '1') ? true : false), 'id="globalnotify"'); ?>
	<?php echo GLOBAL_NOTIFICATIONS_DESCRIPTION; ?></label>
</div>
<br><br>

<?php
  if ($flag_global_notifications != '1') {
?>
<h3 class="section-title"><?php echo NOTIFICATIONS_TITLE; ?></h3>

<?php
    if ($flag_products_check) {
?>
<p class="notice"><?php echo NOTIFICATIONS_DESCRIPTION; ?></p>
<?php
/**
 * Used to loop thru and display product notifications
 */
  foreach ($notificationsArray as $notifications) { 
?>
<div class="checkbox">
	<label class="checkboxLabel" for="<?php echo 'notify-' . $notifications['counter']; ?>">
	<?php echo zen_draw_checkbox_field('notify[]', $notifications['products_id'], true, 'id="notify-' . $notifications['counter'] . '"'); ?>
	<?php echo $notifications['products_name']; ?>
	</label>
</div>
<br><br>
<?php
  }
?>

<div class="buttonRow pull-right"><input class="button" type="submit" value="<?php echo BUTTON_UPDATE_ALT; ?>"></div>
<div class="buttonRow pull-left"><?php echo '<a class="button button-inverse" href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . BUTTON_BACK_ALT . '</a>'; ?></div>

<?php
    } else {
?>
<p class="notice"><?php echo NOTIFICATIONS_NON_EXISTING; ?></p>
<br><br>

<div class="buttonRow pull-right"><input type="submit" value="<?php echo BUTTON_UPDATE_ALT; ?>" class="button"></div>
<div class="buttonRow pull-left"><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" class="button button-inverse">' . BUTTON_BACK_ALT . '</a>'; ?></div>
<?php
    }
?>

<?php
  }
?>

</form>    
</div>
