query("insert into {$dbtbpre}enewsbuygroup(gname,gmoney,gfen,gdate,ggroupid,gzgroupid,buygroupid,gsay,myorder) values('$add[gname]','$add[gmoney]','$add[gfen]','$add[gdate]','$add[ggroupid]','$add[gzgroupid]','$add[buygroupid]','$add[gsay]','$add[myorder]');"); $id=$empire->lastid(); if($sql) { //操作日志 insert_dolog("id=$id&gname=$add[gname]&gfen=$add[gfen]&gdate=$add[gdate]"); printerror('AddBuyGroupSuccess','AddBuyGroup.php?enews=AddBuyGroup'.hReturnEcmsHashStrHref2(0)); } else { printerror('DbError',''); } } //修改充值类型 function EditBuyGroup($add,$userid,$username){ global $empire,$dbtbpre; //验证权限 CheckLevel($userid,$username,$classid,"buygroup"); $id=(int)$add['id']; $add=ReturnBuyGroupVar($add); if(!$id||!$add[gname]||!$add[gmoney]) { printerror('EmptyBuyGroup','history.go(-1)'); } $sql=$empire->query("update {$dbtbpre}enewsbuygroup set gname='$add[gname]',gmoney='$add[gmoney]',gfen='$add[gfen]',gdate='$add[gdate]',ggroupid='$add[ggroupid]',gzgroupid='$add[gzgroupid]',buygroupid='$add[buygroupid]',gsay='$add[gsay]',myorder='$add[myorder]' where id='$id'"); if($sql) { //操作日志 insert_dolog("id=$id&gname=$add[gname]&gfen=$add[gfen]&gdate=$add[gdate]"); printerror('EditBuyGroupSuccess','ListBuyGroup.php'.hReturnEcmsHashStrHref2(1)); } else { printerror('DbError',''); } } //删除充值类型 function DelBuyGroup($id,$userid,$username){ global $empire,$dbtbpre; //验证权限 CheckLevel($userid,$username,$classid,"buygroup"); $id=(int)$id; if(!$id) { printerror('EmptyBuyGroupid',''); } $r=$empire->fetch1("select id,gname,gfen,gdate from {$dbtbpre}enewsbuygroup where id='$id'"); if(!$r[id]) { printerror('EmptyBuyGroupid',''); } $sql=$empire->query("delete from {$dbtbpre}enewsbuygroup where id='$id'"); if($sql) { //操作日志 insert_dolog("id=$id&gname=$r[gname]&gfen=$r[gfen]&gdate=$r[gdate]"); printerror('DelBuyGroupSuccess','ListBuyGroup.php'.hReturnEcmsHashStrHref2(1)); } else { printerror('DbError',''); } } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } if($enews=='AddBuyGroup')//增加充值类型 { AddBuyGroup($_POST,$logininid,$loginin); } elseif($enews=='EditBuyGroup')//修改充值类型 { EditBuyGroup($_POST,$logininid,$loginin); } elseif($enews=='DelBuyGroup')//删除充值类型 { DelBuyGroup($_GET['id'],$logininid,$loginin); } $search=$ecms_hashur['ehref']; $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $line=25; $page_line=25; $offset=$line*$page; $totalquery="select count(*) as total from {$dbtbpre}enewsbuygroup"; $num=$empire->gettotal($totalquery); $query="select id,gname,gmoney,gfen,gdate from {$dbtbpre}enewsbuygroup"; $query.=" order by myorder,id limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?>
位置:管理充值类型 |
ID |
类型名称 |
金额(元) |
点数 |
有效期(天) |
操作 |
=$r[id]?>
|
=$r[gname]?>
|
=$r[gmoney]?>
|
=$r[gfen]?>
|
=$r[gdate]?>
|
|
=$returnpage?> | |||||
前台充值地址:=$public_r[newsurl].'e/member/buygroup/'?> |