query("insert into {$dbtbpre}enewsvg(gname,gids,ingids,agids,mlist) values('$gname','$gids','$ingids','$agids',0);"); if($sql) { $vgid=$empire->lastid(); insert_dolog("vgid=$vgid&gname=$gname");//操作日志 printerror("AddViewGroupSuccess","AddViewGroup.php?enews=AddViewGroup".hReturnEcmsHashStrHref2(0)); } else { printerror("DbError","history.go(-1)"); } } //修改会员访问组 function EditViewGroup($add,$userid,$username){ global $empire,$dbtbpre; $vgid=intval($add['vgid']); if(empty($add['gname'])||!$vgid) { printerror('EmptyViewGroup','history.go(-1)'); } $gname=hRepPostStr($add['gname'],1); $gids=ReturnAddViewMemberGroup($add['membergroup']); $ingids=ReturnAddViewMemberGroup($add['ingroup']); $agids=ReturnAddViewMemberGroup($add['madmingroup']); //会员白名单 $membernum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsvglist where vgid='$vgid'"); $mlist=$membernum?1:0; $sql=$empire->query("update {$dbtbpre}enewsvg set gname='$gname',gids='$gids',ingids='$ingids',agids='$agids',mlist='$mlist' where vgid='$vgid'"); if($sql) { insert_dolog("vgid=$vgid&gname=$gname");//操作日志 printerror("EditViewGroupSuccess","ListViewGroup.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //删除会员访问组 function DelViewGroup($add,$userid,$username){ global $empire,$dbtbpre; $vgid=intval($add['vgid']); if(!$vgid) { printerror('EmptyViewGroupid','history.go(-1)'); } $r=$empire->fetch1("select vgid,gname from {$dbtbpre}enewsvg where vgid='$vgid'"); if(!$r['vgid']) { printerror('EmptyViewGroupid','history.go(-1)'); } $sql=$empire->query("delete from {$dbtbpre}enewsvg where vgid='$vgid'"); $msql=$empire->query("delete from {$dbtbpre}enewsvglist where vgid='$vgid'"); if($sql) { insert_dolog("vgid=$vgid&gname=$r[gname]");//操作日志 printerror("DelViewGroupSuccess","ListViewGroup.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } if($enews=="AddViewGroup") { AddViewGroup($_POST,$logininid,$loginin); } elseif($enews=="EditViewGroup") { EditViewGroup($_POST,$logininid,$loginin); } elseif($enews=="DelViewGroup") { DelViewGroup($_GET,$logininid,$loginin); } $search=$ecms_hashur['ehref']; $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $line=16;//每页显示条数 $page_line=25;//每页显示链接数 $offset=$page*$line;//总偏移量 $query="select * from {$dbtbpre}enewsvg"; $totalquery="select count(*) as total from {$dbtbpre}enewsvg"; $num=$empire->gettotal($totalquery);//取得总条数 $query=$query." order by vgid desc limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?>
位置:管理会员访问组 |
ID |
组名称 |
允许会员白名单 |
操作 |
=$r['vgid']?>
|
=$r['gname']?>
|
||
=$returnpage?> |