<?php
/*
  $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');
// needs to be included earlier to set the success message in the messageStack
  //require(DIR_WS_LANGUAGES . $language . '/' . 'cancel_email.php');

  if ($subname=="cancel"){
  
  }
  else
  if ($subname=="cancelemail"){
  		if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$",$useremail))
		{
       		echo '<script language="javascript">alert("email error!");history.go(-1)</script>';
		}
		else
		{
  			$can_sql="update get_email set flag=2 where email = '" . mysql_real_escape_string($useremail) . "' limit 1";
			echo $can_sql;
			$message=$_POST["whycancel"];
			tep_db_query($can_sql);
			mail("365@75365.com", "email cancel", $message);
	  	}
  }
  else
  	  tep_redirect(HTTP_SERVER);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="style.css">
<?php require('includes/form_check.js.php'); ?>
</head>
<body>
<div id="pg">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<div id="bdmain" class="layout">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
<!-- body_text //-->
<div id="bdcenter"><?php if ($_GET['subname']=="cancelemail"){
echo '<p style="width:600px;height:200px;">'.tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . 'TEXT_SUCCESS'.'</p>';
}else if ($_GET['subname']=="cancel"){
?>
  <p class="pageHeading"><?php echo 'Welcome';?></p>
  <table width="645" height="80"  border="0" align="center" cellpadding="4" cellspacing="0">
    <form name="cancelemail" action="cancel_email.php" method="post" id="cancelemail">
      <tr valign="middle">
        <input type="hidden" name="subname" value="cancelemail">
        <td align="right"><strong>Your email : </strong></td>
        <td><input type="text" name="useremail" value="<? echo $useremail;?>"></td>
      </tr>
      <tr valign="middle">
        <td align="right"><strong>&nbsp;</strong></td>
        <td><textarea name="whycancel" cols="50" rows="6" id="whycancel"></textarea></td>
      </tr>
      <tr valign="middle">
        <td>&nbsp;</td>
        <td><input name="image" type="image" title="cancel " src="includes/languages/english/images/buttons/go_banner.gif" alt="cancel" border="0"></td>
      </tr>
    </form>
  </table>
  <?php
}
?>
<br>
<br><!--TEXT_MAIN_CENTER_TOP-->
          <?php include(DIR_WS_BOXES . 'center_output2.php');?>
          <!--TEXT_MAIN_CENTER_BOM-->
</div>
<!-- body_text_eof //-->
    
<!-- right_navigation //-->
<?php include(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
<!-- body_eof //-->
</div>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</div>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
