query("insert into {$dbtbpre}enewsingroup(gname,myorder) values('$add[gname]','$add[myorder]');"); //更新缓存 GetMemberLevel(); if($sql) { $gid=$empire->lastid(); insert_dolog("gid=$gid&gname=$add[gname]");//操作日志 printerror("AddInGroupSuccess","AddInGroup.php?enews=AddInGroup".hReturnEcmsHashStrHref2(0)); } else { printerror("DbError","history.go(-1)"); } } //修改会员内部组 function EditInGroup($add,$userid,$username){ global $empire,$dbtbpre; $gid=intval($add['gid']); if(empty($add['gname'])||!$gid) { printerror('EmptyInGroup','history.go(-1)'); } $add['gname']=hRepPostStr($add['gname'],1); $add['myorder']=(int)$add['myorder']; $sql=$empire->query("update {$dbtbpre}enewsingroup set gname='$add[gname]',myorder='$add[myorder]' where gid='$gid'"); //更新缓存 GetMemberLevel(); if($sql) { insert_dolog("gid=$gid&gname=$add[gname]");//操作日志 printerror("EditInGroupSuccess","ListInGroup.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } //删除会员内部组 function DelInGroup($add,$userid,$username){ global $empire,$dbtbpre; $gid=intval($add['gid']); if(!$gid) { printerror('EmptyInGroupid','history.go(-1)'); } $r=$empire->fetch1("select gid,gname from {$dbtbpre}enewsingroup where gid='$gid'"); if(!$r['gid']) { printerror('EmptyInGroupid','history.go(-1)'); } $sql=$empire->query("delete from {$dbtbpre}enewsingroup where gid='$gid'"); //更新缓存 GetMemberLevel(); if($sql) { insert_dolog("gid=$gid&gname=$r[gname]");//操作日志 printerror("DelInGroupSuccess","ListInGroup.php".hReturnEcmsHashStrHref2(1)); } else { printerror("DbError","history.go(-1)"); } } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } if($enews=="AddInGroup") { AddInGroup($_POST,$logininid,$loginin); } elseif($enews=="EditInGroup") { EditInGroup($_POST,$logininid,$loginin); } elseif($enews=="DelInGroup") { DelInGroup($_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}enewsingroup"; $totalquery="select count(*) as total from {$dbtbpre}enewsingroup"; $num=$empire->gettotal($totalquery);//取得总条数 $query=$query." order by gid desc limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?>
位置:管理会员内部组 |
ID |
组名称 |
会员数 |
操作 |
=$r[gid]?>
|
=$r[gname]?>
|
||
=$returnpage?> |