<?
include_once "../includes/define.php";
require_once('../includes/configure.php');

if(isset($_POST['BtnLogin'])) {
	
			$sql = "SELECT * from ivc_members WHERE im_cardno='$user' and im_pwd='".md5($pwd)."' and im_active='Yes'";
			$result =mysql_query($sql)or die(mysql_error());
			if(mysql_num_rows($result)==0)print("<script type='text/javascript'>alert('Invalid membership UserID or password !!')</script>");	
			else{
				while($myrow=MySQL_fetch_array($result))
				{
					$_SESSION["egoMemberID"]=$myrow["im_id"];
					$_SESSION["egoMemberNo"]=$myrow["im_formno"];		
					$_SESSION["egoMemberCard"]=$myrow["im_cardno"];					
					$_SESSION["egoMemberName"]=$myrow["im_name"];
					$_SESSION["egoMemberEmail"]=$myrow["im_email"];
					$_SESSION["egoLang"]="ENG";
				}
				
			
				print("<script type='text/javascript'>location.href='../member/index.php'</script>");

			}
	}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=TITLE?></title>
<!-- SmartMenus 6 config and script core files -->
<script type="text/javascript" src="c_config.js"></script>
<script type="text/javascript" src="c_smartmenus.js"></script>

<!-- SmartMenus 6 config and script core files -->
<script src="../includes/validation.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="styles.css" >

</head>

<body>
<table width="1000" height="600" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr>
    <td height="82" background="images/iconic_01.jpg"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="91%" height="30" align="right"><? include_once "includes/topmenu.php"; ?></td>
        <td width="9%" rowspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="4"></td>
      </tr>
      <tr>
        <td height="14" align="right">
          <? include_once "includes/menu.php"; ?>
</td>
        <td height="29" rowspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td height="3" align="right"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="500" valign="top" background="../images/login_bg.jpg" style="background-repeat: no-repeat">
    
      <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="647" height="340" valign="bottom"><span class="title1">&#20250;&#21592;&#30331;&#24405; </span></td>
        </tr>
        <tr>
          <td height="21" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td ><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="789" ><form action="<?=$PHP_SELF ?>" method="post"  name="formLogin" id="formLogin" onsubmit="return ValidateLoginForm(this)">
                <table width="100%" border="0" cellpadding="1" cellspacing="1">
                  <tr>
                    <td width="227" class="subItem"><div align="right" class="text1">&#20250;&#21592; 卡号 :</div></td>
                    <td width="573" ><input name="user" type="text" id="user"/></td>
                    </tr>
                  <tr>
                    <td height="3" colspan="2"><div align="center"></div></td>
                    </tr>
                  <tr>
                    <td class="subItem"><div align="right" class="text1">密码 :</div></td>
                    <td width="573" class="subItem"><input name="pwd" type="password" id="pwd"/></td>
                    </tr>
                  <tr>
                    <td><div align="center"></div></td>
                    <td height="30"><input name="BtnLogin" type="submit" class="btn" id="BtnLogin" value="&#30331;&#24405;" /></td>
                    </tr>
                  <tr>
                    <td></td>
                    <td><div id="submenu"><a href="forgotPwd.php">忘记密码 ?</a></div></td>
                    </tr>
                  <tr>
                    <td colspan="2">&nbsp;</td>
                    </tr>
                  </table>
                </form></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table>            <p class="text1">&nbsp;</p></td>
        </tr>
        <tr>
          <td >&nbsp;</td>
        </tr>
    
    </table>
    
    
    </td>
  </tr>
  <tr>
    <td><? include_once "includes/bottom.php" ?></td>
  </tr>
</table>
</body>
</html>
