{include file="page_header.htm"}
{insert_scripts files="../js/utils.js"}


<form enctype="multipart/form-data" name="theForm" action="privilege.php" method="post" onsubmit="return validate()">
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table_form1" >	
	<tr>
	<td style="padding-left:10px;">
		{foreach from=$permission_arr item=val key=key}
		<div style="width:25%;float:left;margin-bottom:10px;">
		<label for="{$key}">
		<input type="checkbox" name="action_code[]" value="{$key}" id="{$key}" class="checkbox" {if $permission[$key] == 1} checked="checked" {/if} />
		{$val}</label>
		</div>
		{/foreach}
	</td>
	</tr>
	
	<tr>
	<td style="border:none;" align="center">
	<div style="width:100%;text-align:center;margin-top:10px;">
	<label><input type="checkbox" name="checkall" value="checkbox" onclick="checkAll(this.form, this);" class="checkbox" /> 全选</label>
	<input type="submit"   name="Submit"   value=" 保存 " class="bginput" />
	<input type="hidden" name="act" value="do_permission" />
	<input type="hidden"   name="user_id"    value="{$user_id}" />
	</div>
	</td>
	</tr> 
</table>
</form>

<script type="text/javascript">
{literal}
function checkAll(frm, checkbox)
{
  for (i = 0; i < frm.elements.length; i++){
    if (frm.elements[i].name == 'action_code[]')
    {
      frm.elements[i].checked = checkbox.checked;
    }
  }
}
{/literal}
</script>
{insert_scripts files="validator.js"}
{include file="page_footer.htm"}