<extend name="Public:base" />
<block name="head_script">
 <link href="__CSS__/login.css" rel="stylesheet" type="text/css">	
</block>
<block name="content">
<section id="content-container">
<div class="container">
	<div class="row">

		<?php if(isset($error)) { ?>		
			<div class="alert alert-danger" role="alert">
			  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			  <div id="fail"><?php echo $error; ?></div>
			</div>		
		<?php } ?>
		<div id="content" class="col-md-24 col-sm-24 col-xs-24">
			<h1>注册用户</h1>
			<form class="register" method="post" action="{:U('/register')}">
				<div class="left">
					<h2 class="first">请填写您的帐号资料</h2>
					<div class="content">
						<table class="form">
				        <tr>
				          <td>用户名<span class="required">*</span></td>
						</tr>
						
						<tr>
				          <td><input class="form-control" type="text" name="uname" value="{$uname}" />
				            <?php if ($error_uname) { ?>
				            <span class="error"><?php echo $error_uname; ?></span>
				            <?php } ?></td>
				        </tr>
						<tr>
							<td>邮箱<span class="required">*</span></td>
						</tr>
						<tr>
				          <td><input class="form-control" type="text" name="email" value="{$email}" />
				            <?php if ($error_email) { ?>
				            <span class="error"><?php echo $error_email; ?></span>
				            <?php } ?></td>
				        </tr>
				        
				        <tr>
							<td>密码<span class="required">*</span></td>
						</tr>
						<tr>
				          <td><input class="form-control" type="password" name="pwd" value="{$pwd}" />
				            <?php if ($error_pwd) { ?>
				            <span class="error"><?php echo $error_pwd; ?></span>
				            <?php } ?></td>
				        </tr>
				        <tr>
							<td>确认密码<span class="required">*</span></td>
						</tr>
						<tr>
				          <td><input class="form-control" type="password" name="repwd" value="{$repwd}" />
				            <?php if ($error_repwd) { ?>
				            <span class="error"><?php echo $error_repwd; ?></span>
				            <?php } ?></td>
				        </tr>
				        <tr>
							<td>验证码<span class="required">*</span></td>
						</tr>
						<tr>
				          <td><input class="form-control" type="text" name="code" />
				            <?php if ($error_code) { ?>
				            <span class="error"><?php echo $error_code; ?></span>
				            <?php } ?></td>
				        </tr>
				        <tr>
							<td><img class="verifyimg reloadverify" alt="点击切换" src="{:U('Public/verify')}"></td>
						</tr>

				        
						</table>
						    <div class="buttons">
						      <div class="left">
						        <input type="submit" value="提交" class="btn btn-primary btn-continue" />
						      </div>
						    </div>
					</div>
					
				</div>				
			</form>
		</div>
		
	</div>	
</div>	
</section>
<style>
	.verifyimg{cursor:pointer;}
</style>
<script>
	//刷新验证码
	var verifyimg = $(".verifyimg").attr("src");
    $(".reloadverify").click(function(){
        if( verifyimg.indexOf('?')>0){
            $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
        }else{
            $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
        }
    });	
</script>
</block>