<!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=gb2312" />
<title>{#$title#}</title>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<link rel="shortcut icon" href="{#$QISHI.site_dir#}favicon.ico" />
<meta name="author" content="骑士CMS" />
<meta name="copyright" content="74cms.com" />
<link href="{#$QISHI.site_template#}css/user.css" rel="stylesheet" type="text/css" />
<script src="{#$QISHI.site_template#}js/jquery.js" type='text/javascript' language="javascript"></script>
<script src="{#$QISHI.site_template#}js/jquery.validate.min.js" type='text/javascript' language="javascript"></script>
<script src="{#$QISHI.site_template#}js/jquery.idTabs.min.js" type='text/javascript' language="javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#Form1").validate({
// debug: true,
// onsubmit:false,
//onfocusout :true,
   rules:{
   account:{
    required: true
   },
   pwd: {
	required:true
   }
   {#if $verify_gifts=="1"#}
   ,
   postcaptcha: {
   IScaptchastr:true,
   required:true,
   remote:{     
	url:"{#$QISHI.site_dir#}include/imagecaptcha.php",     
	type:"post",    
	data:{"postcaptcha":function (){return $("#postcaptcha").val()},"act":"verify","time":function (){return new Date().getTime()}}     
	}
   }
   {#/if#} 
	},
    messages: {
    account: {
    required: "请输入卡号"
   },
   pwd: {
    required: "请输入密码"
   }
   {#if $verify_gifts=="1"#}
   ,
   postcaptcha: {
    required: jQuery.format("请输入验证码"),
	 remote: jQuery.format("验证码错误")
   }
   {#/if#}
  },
  errorPlacement: function(error, element) {
    if ( element.is(":radio") )
        error.appendTo( element.parent().next().next() );
    else if ( element.is(":checkbox") )
        error.appendTo ( element.next());
    else
        error.appendTo(element.parent());
	}
    });
	jQuery.validator.addMethod("IScaptchastr", function(value, element) {
	var str="点击获取验证码";
	var flag=true;
	if (str==value)
	{
	flag=false;
	}
	return  flag || this.optional(element) ;
	}, "请填写验证码");


function imgcaptcha(inputID,imgdiv)
{
	$(inputID).focus(function(){
		if ($(inputID).val()=="点击获取验证码")
		{
		$(inputID).val("");
		$(inputID).css("color","#333333");
		}
		$(inputID).parent("div").css("position","relative");
		//设置验证码DIV
		$(imgdiv).css({ position: "absolute", left:  $(inputID).width(), "bottom": "0px" , "z-index": "10", "background-color": "#FFFFFF", "border": "1px #A3C8DC solid","display": "none","margin-left": "15px"});
		$(imgdiv).show();
		if ($(imgdiv).html()=='')
		{
		$(imgdiv).append("<img src=\"{#$QISHI.site_dir#}include/imagecaptcha.php?t={#$random#}\" id=\"getcode\" align=\"absmiddle\"  style=\"cursor:pointer; margin:3px;\" title=\"看不请验证码？点击更换一张\"  border=\"0\"/>");
		}
		$(imgdiv+" img").click(function()
		{
			$(imgdiv+" img").attr("src",$(imgdiv+" img").attr("src")+"1");		
		});
		$(document).unbind().click(function(event)
		{
			var clickid=$(event.target).attr("id");
			if (clickid!="getcode" &&  clickid!="postcaptcha")
			{
			$(imgdiv).hide();
			$(inputID).parent("div").css("position","");
			$(document).unbind();
			}			
		});
	});
}
imgcaptcha("#postcaptcha","#imgdiv");
});
</script>
</head>
<body>
{#include file="member_company/header.htm"#}
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:8px;" >
  <tr>
    <td width="173" valign="top" class="link_bk">
	{#include file="member_company/left.htm"#}
	</td>
    <td valign="top">
	<div class="user_right_box">
		<div class="user_right_top_tit_bg">		
		  <h1>礼品卡</h1>
		</div>
		 <div class="us_tab">
			<a href="javascript:void(0);" class="select" style="width:120px;">用礼品卡充值</a>
       
			  <div class="clear"></div>
			  </div>
		<form action="?act=gifts_apy" method="post" id="Form1" >
		<table width="90%" border="0" align="center" cellpadding="3" cellspacing="3" style=" margin-bottom:30px;">
             <tr>
                <td width="100" align="right">请输入卡号：</td>
                <td  >
				
				<input name="account" type="text" class="input_text_200" id="account" />
				
				</td>
            </tr>
              <tr>
                <td align="right">请输入密码：</td>
                <td>
				
				<input name="pwd" type="text" class="input_text_200" id="pwd" />
				
				</td>
              </tr>
			  
			  {#if $verify_gifts=="1"#}
	  <tr>
      <td align="right">验证码：</td>
      <td> 
	  
	  <div>
	  <div id="imgdiv"></div>
			<input  class="input_text_200" name="postcaptcha" id="postcaptcha" type="text" value="点击获取验证码" style="color:#999999" />
			
			</div>
	  
	  </td>
      </tr>
	  {#/if#}
              <tr>
                <td align="right" valign="top">&nbsp;</td>
                <td><input type="submit" name="Submit" value="充值"  class="user_submit" /></td>
              </tr>
        </table></form>
			
	 
		<div class="us_tab">
			<a href="javascript:void(0);" class="select" style="width:120px;">我用过的礼品卡</a><div class="clear"></div>
			</div>
			{#if $gifts#}
        <table width="95%" border="0" align="center" cellpadding="6" cellspacing="1" bgcolor="#B8DCED">
              <tr>
			  <td bgcolor="#EDFBFE"><strong>类型</strong></td>
                <td bgcolor="#EDFBFE"><strong>卡号</strong></td>
                <td bgcolor="#EDFBFE"><strong>使用时间</strong></td>
                <td bgcolor="#EDFBFE"><strong>面值</strong>({#$QISHI.points_byname#})</td>
              </tr>
			  {#foreach from=$gifts item=list#}
              <tr>
			  <td bgcolor="#FFFFFF">{#$list.giftsname#}</td>
                <td bgcolor="#FFFFFF">{#$list.account#}</td>
                <td bgcolor="#FFFFFF">{#$list.usetime|date_format:"%Y-%m-%d %H:%M"#}</td>
                <td bgcolor="#FFFFFF">{#$list.giftsamount#}</td>
              </tr>
			   {#/foreach#}
        </table><br />
		{#else#}
<div class="us_list_no_content">您没有使用过礼品卡</div><br />
		{#/if#}

 
    
	  
	  </div>
    </td>
  </tr>
</table>
{#include file="footer.htm"#}
</body>
</html>
