<?
$C_126cmsadmin_tname = 'group_config';

include(dirname(__FILE__)."/global.php");




@$job=$submitted_vars['job'];
@$gptype=$submitted_vars['gptype'];


	if($gptype==1){
		$gptype_str = '超级管理员';
	}else if($gptype==2){
		$gptype_str = '管理员';
	}else if($gptype==3){
		$gptype_str = '网站编辑';
	}




if($job == "edit"){

  $adgrdb = $_POST['adgrdb'];
  
  $powerdb=serialize($adgrdb);
  
  $query="UPDATE `w6_admin_group` 
          SET `powerdb`='".$powerdb."' 
		  WHERE `gptype`=".$gptype; 
		  
  $result = mysql_query($query) or die(mysql_error());
  
  if ($result)
     {
       $showmsg = "后台管理组权限修改成功！";
	   $formurl = "group_edit.php?&gptype=$gptype";
     }
  else
     {
       $showmsg = "后台管理组权限修改失败！";
	   $formurl = "group_edit.php?&gptype=$gptype";
     }
	 
  include('showmsg.php');
  exit;
  


}



	$query="SELECT * FROM `w6_admin_group` WHERE `gptype` ='$gptype'";

  	$result=mysql_query($query) or die("Could not connect: " . mysql_error());
	
	$gid        =  stripslashes(mysql_result($result,"0","gid"));
	$powerdb        =  stripslashes(mysql_result($result,"0","powerdb"));
	
	$adgrdb = unserialize($powerdb);



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: underline;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
.font_hs {
	color: #999999;
}
-->
</style>
</head>

<body>
<div align="center" class="font12">
  <table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#A4B6D7">
    <tr>
      <td width="100%" height="22" align="center" background="images/titlebg.jpg">&nbsp;</td>
    </tr>
  </table>
  <br />
  <table width="100%" height="25" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td align="left" bgcolor="#FFFFFF"> [<a href="group.php" class="a_bt">后台管理组</a>] </td>
    </tr>
  </table>
  <br />
  <br />
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tr>
      <td height="22" align="left" class="head">后台管理组编辑</td>
    </tr>
    <tr>
      <td height="24" align="left">
	  <br /></td>
    </tr>
    <tr>
      <td align="center">
	  <FORM name="form_work" action="" method="post">
  <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr>
          <td height="30" colspan="8" align="left" background="images/titlebg.jpg">&nbsp;修改用户组: <strong><?=$gptype_str?></strong></td>
          </tr>
		        <tr >
          <td colspan="8" align="left" bgcolor="#FFFFFF" style="color: #FF0000;">
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[center_config]" value="1" <? if($adgrdb['center_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">核心设置</a> </span>          
          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[MakeHtml_config]" value="1" <? if($adgrdb['MakeHtml_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">静态网页设置</a> </span>          
          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[menu_config]" value="1" <? if($adgrdb['center_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">导航菜单设置</a> </span>          
          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[sort_config]" value="1" <? if($adgrdb['sort_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">栏目管理</a> </span>          
          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[article_config]" value="1" <? if($adgrdb['article_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">发表文章</a> </span>          
          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[group_config]" value="1" <? if($adgrdb['group_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">后台管理组设置</a> </span>          
          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[wnm_config]" value="1" <? if($adgrdb['wnm_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">万能模块管理</a> </span>          
          
              <span style="display:block;width:200px;height:25px;float:left;overflow:hide;">
              <input type="checkbox" name="adgrdb[dbsql_config]" value="1" <? if($adgrdb['dbsql_config'] == 1) echo 'checked';?> >
              <a href="index.php?lfj=center&job=config" target="_blank">数据库备份</a> </span>          
          
          </td>
          </tr>
        
		        <tr>
          <td height="30" colspan="8" align="center" bgcolor="#FFFFFF">  <a href="javascript:" onClick="CheckAll('all')">全选</a>/<a href="javascript:" onClick='CheckAll()'>反选</a>  
        <input type="submit" name="Submit" value="提交">
        <input name="job" type="hidden" id="job" value="edit" />
        <input name="gptype" type="hidden" id="gptype" value="<?=$gptype?>" /></td>
        </tr>
      </table>
	  </form>
      
<SCRIPT LANGUAGE="JavaScript">
<!--
function postdo(va){
	document.form_work.jobs.value=va
	document.form_work.submit();
}
function CheckAll(va){
	form=document.form_work
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if(e.className=='myadgrdb')continue;
		if(va=='all'){
			e.checked = true;
		}else{
			e.checked == true ? e.checked = false : e.checked = true;
		}
	}
}
//-->
</SCRIPT>
      
      </td>
    </tr>
  </table>
  </div>
</body>
</html>
