<?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/integral_add_ajax/" method="post">
					<input name="uid" type="hidden" value="<?php echo $this->user['uid']; ?>">
					<fieldset>
					<p>
						<label>Username: <span style="font-weight:normal"><?php echo $this->user['user_name']; ?></span></label>
					</p>
					<p>
						<label>Current credits: <span style="font-weight:normal;"><?php echo $this->user['integral']; ?></span></label>
					</p>
					<p>
						<label>Increase credit:</label>
						<input name="integral" class="text-input small-int" type="text" value=""/>
					</p>
					<p id="after_integral" style="display:none;">
						<label>Current credits: <span style="font-weight:normal;" rel="value"></span></label>
					</p>
					<p>
						<label>Reason:</label>
						<input name="note" class="text-input small-input" type="text" value="Administrator to increase the credit"/>
					</p>
					<p>
						<input class="button" type="button" onClick="ajax_post($('#_save_form'), _form_process);" value="  Submitted  " />
					</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>

<script type="text/javascript">

var USER_INTEGRAL = <?php echo $this->user['integral']; ?>;

	$(':input[name=integral]').keyup(function()
	{
		var add_integral = Number($(':input[name=integral]').val());
		
		if(add_integral > 0)
		{
			$('#after_integral').show().find('span[rel=value]').html(USER_INTEGRAL + add_integral);
		}
		else
		{
			$('#after_integral').hide();
		}		
	});
	
</script>

</body>
</html>