<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content">
			<div id="notification_box" class="notification success png_bg" style="display:none;"> <a class="close" href="javascript:;"></a>
				<div name="notification_content"></div>
			</div>
			<div class="tab-content default-tab" id="tab1">
				<form id="_save_form" action="admin/user_manage/user_save_ajax/" method="post">
					<input name="uid" type="hidden" value="<?php echo $this->user['uid']; ?>">
					<fieldset>
					<p>
						<label>Username:</label>
						<input name="user_name" class="text-input small-input" type="text" value="<?php echo $this->user['user_name']; ?>"/>
					</p>
					<p>
						<label>Password:</label>
						<input name="password" class="text-input small-input" type="text" value=""/> &nbsp; (Leave blank if no change)</p>
					<p>
						<label>Mailbox:</label>
						<input name="email" class="text-input small-input" type="text" value="<?php echo $this->user['email']; ?>"/>
					</p>
					<p>
						<label>Write a description:</label>
						<input name="signature" class="text-input small-input" type="text" value="<?php echo $this->user['signature']; ?>"/>
					</p>
					<p>
						<label>Credit: <span style="font-weight:normal;"><?php echo $this->user['integral']; ?></span>&nbsp;&nbsp;<a href="admin/user_manage/integral/uid-<?php echo $this->user['uid']; ?>">[Manage credit]</a></label>
					</p>
					<p>
						<label>Email activation status:</label>
						<input type="radio" name="valid_email" value="1" <?php if($this->user['valid_email']=='1'){ ?> checked="true"<?php } ?>/>
						Yes
						<input type="radio" name="valid_email" value="0" <?php if($this->user['valid_email']=='0'){ ?> checked="true"<?php } ?>/>
						No </p>
					<p>
						<label><input type="checkbox" name="verified" value="1" <?php if($this->user['verified']=='1'){ ?> checked="true"<?php } ?>/>Verified user
						</label>
					</p>
					<p>
						<label>Avatar:</label>
						<img src="<?php echo get_avatar_url($this->user['uid'], 'max'); ?>"/><br/>
						<input name="delete_avatar" type="checkbox" value="1">
						Delete profile photo </p>
					<?php if($this->user_info['group_id'] == '1'){ ?>
					<p>
						<label>Usergroup:</label>
						<select class="small-input" name="group_id">
							<?php foreach($this->system_group as $skey => $val){ ?>
							<option value="<?php echo $val['group_id']; ?>"<?php if($this->user['group_id'] == $val['group_id']){ ?> selected=true<?php } ?>><?php echo $val['group_name']; ?></option>
							<?php } ?>
						</select>
					</p>
					<?php } ?>
					<p>
						<label>Forbid user:</label>
						<input type="radio" name="forbidden" value="1" <?php if($this->user['forbidden']=='1'){ ?> checked="true"<?php } ?>/>
						Yes
						<input type="radio" name="forbidden" value="0" <?php if($this->user['forbidden']=='0'){ ?> checked="true"<?php } ?>/>
						No </p>
					<p>
						<label>Register time:</label>
						<input name="reg_time" class="text-input small-input" type="text" value="<?php if($this->user['reg_time']){ echo date("Y-m-d H:i:s", $this->user['reg_time']); } ?>"/>
					</p>
					<p>
						<label>Sign up IP:</label>
						<input name="reg_ip" class="text-input small-input" type="text" value="<?php if($this->user['reg_time']){ echo long2ip($this->user['reg_ip']); } ?>"/>
					</p>
					<p>
						<label>Last vist time:</label>
						<input name="last_login" class="text-input small-input" type="text" value="<?php if($this->user['last_login']){ echo date("Y-m-d H:i:s", $this->user['last_login']); } ?>"/>
					</p>
					<p>
						<label>Last visit IP:</label>
						<input name="last_ip" class="text-input small-input" type="text" value="<?php if($this->user['last_ip']){ echo long2ip($this->user['last_ip']); } ?>"/>
					</p>
					<p>
						<label>Gender:</label>
						<input type="radio" name="sex" value="1" <?php if($this->user['sex']=='1'){ ?> checked="true"<?php } ?>/>
						Male
						<input type="radio" name="sex" value="2" <?php if($this->user['sex']=='2'){ ?> checked="true"<?php } ?>/>
						Female
						<input type="radio" name="sex" value="3" <?php if($this->user['sex']=='3'){ ?> checked="true"<?php } ?>/>
						Secret </p>
					<p>
						<label>Date of birth:</label>
						<input name="birthday" class="text-input small-input" type="text" value="<?php if($this->user['birthday']){ echo date("Y-m-d H:i:s", $this->user['birthday']); } ?>"/>
					</p>
					<p>
						<label>Invitations left:</label>
						<input name="invitation_available" class="text-input small-input" type="text" value="<?php echo $this->user['invitation_available']; ?>"/>
					</p>
					<p>
						<input class="button" type="button" onClick="ajax_post($('#_save_form'), _form_process);" value="Save" />
					</p>
					</fieldset>
					<div class="clear"></div>
				</form>
			</div>
		</div>
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="Close" /></a>
			<div id="notf_cont"></div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>