} else { tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } if (!is_array($notify)) { $notify = array($notify); } for ($i = 0, $n = sizeof($notify); $i < $n; $i++) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] < 1) { tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())"); } } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } break; case 'notify_remove': if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['count'] > 0) { tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'"); } tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')))); } else { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); }
/** * セッションIDがパラメータとしてわたってきていない場合は * セッション付きURLでリロード */ function initSession() { global $session_started; if ($this->isMobile() && !isset($_POST[zen_session_name()]) && !isset($_GET[zen_session_name()])) { require_once DIR_WS_CLASSES . 'navigation_history.php'; $navigation = new navigationHistory(); $navigation->add_current_page(); $navigation->set_snapshot(); $snapshot_parameter_array = $navigation->snapshot['get']; $self_href = zen_href_link($navigation->snapshot['page'], zen_array_to_string($snapshot_parameter_array), $navigation->snapshot['mode']); //$self_href .= "&" . zen_session_name() . '=' . zen_session_id(); zen_redirect($self_href); } return true; }