<?php
# Name: PHP版程氏文章CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../../lib/cs_label.php");
include_once("../loginstate.php");
SystemPer('0_1');
$ac=CS_Request("ac");
$op=CS_Request("op");
$id=CS_Request("id");
?>
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>chshdjcms management</title>
<link href="../res/css/admin_style.css" rel="stylesheet" />
<link href="../../public/css/webox.css" rel="stylesheet" />
<script type="text/javascript" src="../res/js/ajax.js"></script>
<script language="javascript" src="../res/js/jquery.js"></script>
<script src="../../public/js/webox.js"></script>
<script language="javascript"> 
 
function del(_id){ 
  if (confirm("确定删除吗？")){
    window.location='?op=del&id='+_id;
    return true;
  }else{
     return false;
  }		
}
</script>
</head>
<body>
<div class="wrap">
<div class="h_a">会员充值明细</div>
<form class="J_ajaxForm" action="?op=delall" method="post" name="formb">
<div class="table_list">
<table width="100%" id="dellist">
		<thead>
			<tr>
				<td><label>选</label></td>
				<td>充值定单</td>
				<td><span>充值方式</span></td>
				<td><span>充值会员</span></td>
				<td><span>金额</span></td>
				<td><span>充值IP</span></td>
				<td><span>状态</span></td>
				<td><span>充值时间</span></td>
				<td>删除</td>
			</tr>
		</thead>
<?php
		global $db;
                $sql="select * from ".Getdbname('pay')." order by CS_AddTime desc";
		$dancenum=$db->num_rows($db->query($sql));
		$Arr=getpagerow($sql,20);//sql,每页显示条数
		$result=$db->query($Arr[2]);
	if($dancenum==0){
                   echo '<tr><td class="tac" colspan="6">啊哦，没有符合条件的内容！</td></tr>';
        }else{
                if($result){
	                 while ($row = $db ->fetch_array($result)){
                        if($row['CS_PID']!=0){
				$UOK="<img src=\"../res/images/yes.gif\" title=\"充值成功\" style=\"cursor:pointer\">";
			}else{
				$UOK="<img src=\"../res/images/no.gif\" title=\"充值失败\" style=\"cursor:pointer\">";
			}
?>
			   <tr>
				<td><input type="checkbox" class="J_check" name="CS_ID[]" value="<?php echo $row['CS_ID']?>" id="CS_ID"/>&nbsp;<?php echo $row['CS_ID']?></td>
				<td><?php echo $row['CS_Dingdan']?></td>
				<td><?php echo $row['CS_Type']?></td>
				<td><?php echo $row['CS_User']?></td>
				<td><?php echo $row['CS_RMB']?></td>
				<td><?php echo $row['CS_Ip']?></td>
				<td><?php echo $UOK?></td>
				<td><?php echo $row['CS_AddTime']?></td>
				<td><a style="cursor:pointer;"  onclick="del(<?php echo $row['CS_ID']?>)">删除</a></td>
			   </tr>
<?php
	                 }
                }
        }
?>
	</table>
			<div class="p10">
				<div class="pages">
				     <?php if($dancenum>20) echo $Arr[0];?>
                                </div>
			</div>
</div>
<div class="btn_wrap">
	<div class="btn_wrap_pd">
                <label class="mr20"><input type="checkbox" class="J_check_all" id="chkall" onClick="return CheckAll(this.form)" value="on">全选</label>
		<input name="button1" type="button" class="btn J_ajax_submit_btn" value="批量删除" onClick="DelInfo(this.form)">
                <div class="tips_error" id="Msg"></div>
	</div>
</div>
</form>
</div>
<?php 
          //删除
          if($op=='del'){
		global $db;
		$CS_ID=CS_Request("id");
                $sql="delete from ".Getdbname('pay')." where CS_ID=".$CS_ID;
		if($db->query($sql)){
                        echo '<script>document.getElementById("Msg").className="tips_success";$("#Msg").text("恭喜,删除成功!").css("color","#026E12");</script>';
	                echo "<script>setTimeout(\"window.location='javascript:history.go(-1);'\",2000);</script>";
		}
          }

          //批量删除
          if($op=='delall'){
		global $db;
		$CS_ID=CS_RequestBox("CS_ID");
	        $Arr=explode(',',$CS_ID);
		for($i=0;$i<count($Arr);$i++){
			$db->query("delete from ".Getdbname('pay')." where CS_ID=".$Arr[$i]."");
		}
                        echo '<script>document.getElementById("Msg").className="tips_success";$("#Msg").text("恭喜,删除成功!").css("color","#026E12");</script>';
	                echo "<script>setTimeout(\"window.location='javascript:history.go(-1);'\",2000);</script>";
          }

?>
</div>
</body>
</html>
 


