<?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">
				<li><a class="default-tab current" href="#tab1">Member group</a></li>
				<li><a class="" href="#tab2">System group</a></li>
			</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 method="post" action="admin/user_manage/group_save_ajax/" id="mem_groups">
					<fieldset>
					<table class="list">
						<thead>
							<tr>
								<th style="width:25px;"><input class="check-all" type="checkbox" /></th>
								<th style="width:25px;">ID</th>
								<th style="width:140px;">Member group name</th>
								<th style="width:150px;">Reputation between</th>
								<th style="width:80px;">Reputation coefficient</th>
								<th style="width:500px;"></th>
							</tr>
						</thead>
						<tbody style="border-bottom: 1px solid #ddd;">
							<?php foreach ($this->mem_group AS $key => $val) { ?>
							<tr>
								<td><input type="checkbox" value="<?php echo $val['group_id'];?>" name="group_ids[]"></td>
								<td><?php echo $val['group_id']; ?></td>
								<td><input type="text" size="16" name="group[<?php echo $val['group_id'];?>][group_name]" class="text-input" value="<?php echo $val['group_name'];?>" style="width:100px;"/></td>
								<td><input type="text" size="6" name="group[<?php echo $val['group_id'];?>][reputation_lower]" class="text-input small-input" value="<?php echo $val['reputation_lower'];?>"/>
									~
									<input type="text" size="6" name="group[<?php echo $val['group_id'];?>][reputation_higer]" class="text-input small-input" value="<?php echo $val['reputation_higer'];?>"/></td>
								<td><input type="text" size="6" name="group[<?php echo $val['group_id'];?>][reputation_factor]" class="text-input small-input" value="<?php echo $val[reputation_factor];?>"/></td>
								<td><a href="admin/user_manage/group_edit/group_id-<?php echo $val['group_id']; ?>">Permission to edit</a></td>
							</tr>
							<?php } ?>
							<tr>
								<td colspan="2">&nbsp;</td>
								<td colspan="4"><div><a class="addtr" onClick="addrow($(this))" href="javascript:;">+Add new usergroup</a><span style="display:none;color:#57A000">&nbsp;(Usergroup permissions after adding default to the lowest, add post-editing Usergroup Permissions)</span></div></td>
							</tr>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="6"><input class="check-all" type="checkbox" />
									Delete all?
									&nbsp;&nbsp;&nbsp;&nbsp;
									<input class="button" type="button" onClick="ajax_post($('#mem_groups'), _form_process);" value="  Submit  " />
								</td>
							</tr>
						</tfoot>
					</table>
					<p> </p>
					</fieldset>
				</form>
			</div>
			<div id="tab2" style="display:none;">
				<form method="post" action="admin/user_manage/group_save_ajax/" id="system_groups">
					<fieldset>
					<table>
						<thead>
							<tr>
								<th style="width:25px;">ID</th>
								<th style="width:140px;">System group name</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							<?php foreach ($this->system_group AS $key => $val) { ?>
							<tr>
								<td><?php echo $val['group_id']; ?></td>
								<td><?php echo $val['group_name'];?></td>
								<td><a href="admin/user_manage/group_edit/group_id-<?php echo $val['group_id']; ?>">Permission to edit</a></td>
							</tr>
							<?php } ?>
						</tbody>
						<tfoot>
						</tfoot>
					</table>
					</fieldset>
				</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" src="<?php echo GET_STATIC_URL; ?>/admin/js/group.js"></script>

</body>
</html>