羽恒梦工厂个人中心
这个页面是个人中心
下面是代码yhfukuanjilu.php
<?php session_start(); include("../dbda.class.php"); $db = new DBDA(); ?> <!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=utf-8" /> <script src="jquery-1.11.2.min.js"></script> <title>无标题文档</title> <link href="dingdancss.css" rel="stylesheet" type="text/css" /> </head> <body> <!--顶部导航--> <div id="top"> <div id="dlxx"> </div> <div id="logo"><img src="img/logo.png" /></div> <div id="dhl_wai"> <?php $dhlb = "select * from leibie"; $dh = $db->Query($dhlb); foreach($dh as $k=>$v){ $class = $k==3?"dhl right":"dhl" ; echo "<div class='{$class}' code='{$v[0]}'>{$v[2]}</div>"; } ?> </div> </div> <!--中间图片--> <div id="second"></div> <!--付款记录部分--> <div id="Paymentrecords"> <div id="records_wai"> <div id="records_left"> <div class="Payment Payment1" bs="1" xs="1">全部记录</div> <div class="Payment" bs="2" xs="0">未审核记录</div> <div class="Payment" bs="3" xs="0">已审核记录</div> <div class="Payment" bs="4" xs="0">可观看记录</div> <div class="Payment" bs="5" xs="0">可下载记录</div> </div> <div id="records_right"> <div id="records_title"> <div id="records_titlel" style=" font-size:28px; position:relative;left:300px">会员中心</div> <div id="records_titley" style="position:relative;left:600px">商品名:<input type="text" id="shpmcx" /></div> </div> <div id="records_form"> <div id="records_tou"> <div class="header header1">编 号</div> <div class="header header2">商品名称</div> <div class="header header3">购买类型</div> <div class="header header4">购买时间</div> <div class="header header5">状 态</div> </div> <div id="records_nr"> </div> <!--分页开始--> <center> <div id="fyh"> <ul class="pagination" id="fy_list"> </ul> </div> <input type="hidden" value="1" id="fy_n" /> </center> <!--分页结束--> </div> </div> </div> </div> <!--尾部--> <div id="bottom"> <div id="bottomlogo"><img src="img/bottomlogo.png" /></div> <div id="contact"> <div id="tell">联系电话:13738482570</div> <div id="qq">QQ号: 3157945123</div> <div id="jszc">技术支持:天启网络</div> </div> </div> </body> <script type="text/javascript"> $(document).ready(function(e){ dengluxx(); JiaZai(); //确定总页数的变量 var zys = 0; //查询数据 $(".Payment").click(function(){ $("#fy_n").val(1); bs = $(this).attr("bs"); JiaZai(); }) }); //加载数据方法 function JiaZai() { var n = $("#fy_n").val(); var b = $(".Payment"); for(var i=0;i<b.length;i++){ if(b.attr("xs")==1){ bs = b.attr("bs"); } } var shmp = $("#shpmcx").val(); $.ajax({ url:"./chuli/chuli.php", data:{bs:bs,n:n,shmp:shmp}, type:"POST", dataType:"TEXT", success: function(data){ var s =""; var hang = data.split("|"); var strs = ""; for(var i=0;i<hang.length;i++) { var lie = hang[i].split("^"); var shenhe = lie[4]==1?"已审核":"未审核"; var shhys = lie[4]==1?"#0F0":"#F00"; strs+="<div class='content content1'>"+lie[0]+"</div><div class='content content2'>"+lie[1]+"</div><div class='content content3'>"+lie[2]+"</div><div class='content content4'>"+lie[3]+"</div><div class='content content5' style='color:"+shhys+"'>"+shenhe+"</div>"; } if(data==""){ $("#records_nr").html(""); }else{ $("#records_nr").html(strs);} } }); $("#shpmcx").keyup(function(){ var n = $("#fy_n").val(); var b = $(".Payment"); for(var i=0;i<b.length;i++){ if(b.attr("xs")==1){ bs = b.attr("bs"); } } var shmp = $(this).val(); $.ajax({ url:"./chuli/chuli.php", data:{bs:bs,n:n,shmp:shmp}, type:"POST", dataType:"TEXT", success: function(data){ var s =""; var hang = data.split("|"); var strs = ""; for(var i=0;i<hang.length;i++) { var lie = hang[i].split("^"); var shenhe = lie[4]==1?"已审核":"未审核"; var shhys = lie[4]==1?"#0F0":"#F00"; strs+="<div class='content content1'>"+lie[0]+"</div><div class='content content2'>"+lie[1]+"</div><div class='content content3'>"+lie[2]+"</div><div class='content content4'>"+lie[3]+"</div><div class='content content5' style='color:"+shhys+"'>"+shenhe+"</div>"; } if(data==""){ $("#records_nr").html(""); }else{ $("#records_nr").html(strs);} } }); $.ajax({ url:"./chuli/yschuli.php", data:{bs:bs,shmp:shmp}, type:"POST", dataType:"TEXT", success: function(data){ //总页数 var ys = Math.ceil(data/10); zys = ys; var cd = zys*48; if(zys<5){ $("#fyh").css("width",cd+"px"); }else{ $("#fyh").css("width","235px"); } var s = ""; //var s = "<li><a id='fy_shang'>«</a></li>"; var dangqian = parseInt($("#fy_n").val()); //当前页数 if(dangqian==1){ for(var i=dangqian;i<=dangqian+4;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else if(dangqian==2){ for(var i=dangqian-1;i<=dangqian+3;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else if(dangqian==zys){ for(var i=dangqian-4;i<=dangqian;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else if(dangqian==zys-1){ for(var i=dangqian-3;i<=dangqian+1;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else{ for(var i=dangqian-2;i<=dangqian+2;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } } //s += "<li><a id='fy_xia'>»</a></li>"; $("#fy_list").html(s); //给分页列表加事件 JiaShiJian(); } }) }); //获取分页数(列表) $.ajax({ url:"./chuli/yschuli.php", data:{bs:bs,shmp:""}, type:"POST", dataType:"TEXT", success: function(data){ //总页数 var ys = Math.ceil(data/10); zys = ys; var cd = zys*48; if(zys<5){ $("#fyh").css("width",cd+"px"); }else{ $("#fyh").css("width","235px"); } var s = ""; //var s = "<li><a id='fy_shang'>«</a></li>"; var dangqian = parseInt($("#fy_n").val()); //当前页数 if(dangqian==1){ for(var i=dangqian;i<=dangqian+4;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else if(dangqian==2){ for(var i=dangqian-1;i<=dangqian+3;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else if(dangqian==zys){ for(var i=dangqian-4;i<=dangqian;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else if(dangqian==zys-1){ for(var i=dangqian-3;i<=dangqian+1;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } }else{ for(var i=dangqian-2;i<=dangqian+2;i++){ if(i>0 && i<=ys) { if(dangqian==i) { s+="<li class='active fy_zhong' style='background-color:#faa66a; color:#FFF'><a>"+i+"</a></li>"; } else { s+="<li class='fy_zhong'><a>"+i+"</a></li>" } } } } //s += "<li><a id='fy_xia'>»</a></li>"; $("#fy_list").html(s); //给分页列表加事件 JiaShiJian(); } }) } //给分页列表加事件的方法 function JiaShiJian() { $("#fy_shang").click(function(){ var n = $("#fy_n").val(); if(n>1) { n--; } else { n=1; } $("#fy_n").val(n); //加载数据 JiaZai(); }) $("#fy_xia").click(function(){ var n = $("#fy_n").val(); if(n<zys) { n++; } else { n=zys; } $("#fy_n").val(n); //加载数据 JiaZai(); }) $(".fy_zhong").click(function(){ var n = $(this).text(); $("#fy_n").val(n); //加载数据 JiaZai(); }) } /*************************************/ $(".Payment").click(function(){ var xs = $(".Payment"); for(var i=0;i<xs.length;i++){ xs.eq(i).attr("xs",0); xs.eq(i).css("background-color","#FFF"); xs.eq(i).css("color","#000"); } $(this).attr("xs",1); $(this).css("background-color","#faa66a"); $(this).css("color","#FFF"); }); $(".Payment").mouseover(function(){ var xs = $(".Payment"); for(var i=0;i<xs.length;i++){ if(xs.eq(i).attr("xs")==0){ xs.eq(i).css("background-color","#FFF"); xs.eq(i).css("color","#000"); } } $(this).css("background-color","#faa66a"); $(this).css("color","#FFF"); }); $(".Payment").mouseout(function(){ var xs = $(".Payment"); for(var i=0;i<xs.length;i++){ if(xs.eq(i).attr("xs")==0){ xs.eq(i).css("background-color","#FFF"); xs.eq(i).css("color","#000"); } } }); function shenhe(){ var shh = $(".content5"); for(var i=0;i<shh.length;i++){ if(shh.eq(i).attr(shh)==1){ shh.eq(i).css("color","#0F0"); }else{ shh.eq(i).css("color","#F00"); } } } function dengluxx(){ $.ajax({ url:"./chuli/htshjchuli.php", async:false, data:{tp:4}, type:"POST", dataType:"TEXT", success: function(data){ $("#dlxx").html(data); } }); var yh = $("#yonghuming").width(); var zx = $("#zhuxiao").width(); var hyzx = $("#huiyuanzhx").width(); var dl = $("#dl").width(); var zc = $("#zc").width(); $("#dlxx").width(yh+zx+hyzx+dl+zc+26); $("#dl").click(function(){ window.location.href="login2.php"; }); $("#zc").click(function(){ window.location.href="zhuce.php"; }); $("#zhuxiao").click(function(){ $.ajax({ url:"./chuli/htshjchuli.php", data:{tp:5}, type:"POST", success: function(data){ window.location.href="login2.php"; } }); }); $("#huiyuanzhx").click(function(){ window.location.href="yhfukuanjilu.php"; }); $("#yonghuming").click(function(){ window.location.href="xiugaimm.php"; }); $("#logo").click(function(){ window.location.href="main.php"; }); $(".dhl").click(function(){ var code = $(this).attr("code"); window.location.href="buju.php?code="+code+""; }); } </script> </html>
下面是分页需要的页面chuli.php
<?php session_start(); include("../../dbda.class.php"); $db = new DBDA(); $uid = $_SESSION["uid"]; $n = $_POST["n"]; $bs = $_POST["bs"]; $shmp= $_POST["shmp"]; $tj2="1=1"; if($shmp!=""){ $tj2 = " main.main_name like '%{$shmp}%' "; } $tj = "1=1"; if(!empty($bs)){ switch($bs){ case 1: $tj = "1=1"; break; case 2: $tj = "shenhe=0"; break; case 3: $tj = "shenhe=1"; break; case 4: $tj = "goumai.leixingcode='k001'"; break; case 5: $tj = "goumai.leixingcode='k002'"; break; } } $tg = ($n-1)*10; $xxlb = "select goumai.number,main.main_name,leixing.leixingname,goumai.time,goumai.shenhe from goumai,main,leixing where goumai.code=main.code and goumai.leixingcode=leixing.leixingcode and {$tj} and {$tj2} and uid='{$uid}' order by number desc limit {$tg},10"; echo $db->STRQuery($xxlb);