zoukankan      html  css  js  c++  java
  • 每日博客5.27

    <?php 
    session_start();
    include_once 'conn.php';

    ?>
    <!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=gb2312" />
    <title>购买车</title>
    <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
    <link rel="stylesheet" href="css.css" type="text/css">
    </head>
    <!--hxsglxiangdxongjxs-->
    <body>

    <p>已有购买车列表:</p>
    <form id="form1" name="form1" method="post" action="">
    搜索: 商品编号:<input name="shangpinbianhao" type="text" id="shangpinbianhao" style='border:solid 1px #000000; color:#666666;80px' /> 商品名称:<input name="shangpinmingcheng" type="text" id="shangpinmingcheng" style='border:solid 1px #000000; color:#666666;80px' /> 品牌:<input name="pinpai" type="text" id="pinpai" style='border:solid 1px #000000; color:#666666;80px' />
    <input type="submit" name="Submit" value="查找" style='border:solid 1px #000000; color:#666666' />
    </form>
    <table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#00FFFF" style="border-collapse:collapse">
    <tr>
    <td width="25" bgcolor="#CCFFFF">序号</td>
    <td bgcolor='#CCFFFF'>商品编号</td>
    <td bgcolor='#CCFFFF'>商品名称</td>
    <td bgcolor='#CCFFFF'>品牌</td>
    <td bgcolor='#CCFFFF'>价格</td>
    <td bgcolor='#CCFFFF'>库存数量</td>
    <td bgcolor='#CCFFFF'>购买数量</td>
    <td bgcolor='#CCFFFF'>购买人</td>
    <td bgcolor='#CCFFFF'>金额</td>
    <td bgcolor='#CCFFFF' width='80' align='center'>是否已结算</td>

    <!--dpinglun1-->
    <td width="120" align="center" bgcolor="#CCFFFF">添加时间</td>
    <td width="120" align="center" bgcolor="#CCFFFF">操作</td>
    </tr>
    <?php
    $sql="select * from goumaiche where 1=1";

    if ($_POST["shangpinbianhao"]!=""){$nreqshangpinbianhao=$_POST["shangpinbianhao"];$sql=$sql." and shangpinbianhao like '%$nreqshangpinbianhao%'";}
    if ($_POST["shangpinmingcheng"]!=""){$nreqshangpinmingcheng=$_POST["shangpinmingcheng"];$sql=$sql." and shangpinmingcheng like '%$nreqshangpinmingcheng%'";}
    if ($_POST["pinpai"]!=""){$nreqpinpai=$_POST["pinpai"];$sql=$sql." and pinpai like '%$nreqpinpai%'";}
    $sql=$sql." order by id desc";

    $query=mysql_query($sql);
    $rowscount=mysql_num_rows($query);
    if($rowscount==0)
    {}
    else
    {
    $pagelarge=10;//每页行数;
    $pagecurrent=$_GET["pagecurrent"];
    if($rowscount%$pagelarge==0)
    {
    $pagecount=$rowscount/$pagelarge;
    }
    else
    {
    $pagecount=intval($rowscount/$pagelarge)+1;
    }
    if($pagecurrent=="" || $pagecurrent<=0)
    {
    $pagecurrent=1;
    }

    if($pagecurrent>$pagecount)
    {
    $pagecurrent=$pagecount;
    }
    $ddddd=$pagecurrent*$pagelarge;
    if($pagecurrent==$pagecount)
    {
    if($rowscount%$pagelarge==0)
    {
    $ddddd=$pagecurrent*$pagelarge;
    }
    else
    {
    $ddddd=$pagecurrent*$pagelarge-$pagelarge+$rowscount%$pagelarge;
    }
    }
    //youzuiping1
    for($i=$pagecurrent*$pagelarge-$pagelarge;$i<$ddddd;$i++)
    {
    $jinez=$jinez+floatval(mysql_result($query,$i,jine));

    //txixgihxngjs
    //youzuiping2

    ?>
    <tr>
    <td width="25"><?php echo $i+1;?></td>
    <td><?php echo mysql_result($query,$i,shangpinbianhao);?></td>
    <td><?php echo mysql_result($query,$i,shangpinmingcheng);?></td>
    <td><?php echo mysql_result($query,$i,pinpai);?></td>
    <td><?php echo mysql_result($query,$i,jiage);?></td>
    <td><?php echo mysql_result($query,$i,kucunshuliang);?></td>
    <td><?php echo mysql_result($query,$i,goumaishuliang);?></td>
    <td><?php echo mysql_result($query,$i,goumairen);?></td>
    <td><?php echo mysql_result($query,$i,jine);?></td>
    <td width='80' align='center'><?php echo mysql_result($query,$i,"issh")?></td>
    <!--dpinglun2-->
    <td width="120" align="center"><?php echo mysql_result($query,$i,"addtime");?></td>
    <td width="120" align="center"><a href="del.php?id=<?php echo mysql_result($query,$i,"id");?>&tablename=goumaiche" onclick="return confirm('真的要删除?')">删除</a> <a href="goumaiche_updt.php?id=<?php echo mysql_result($query,$i,"id");?>">修改</a> <a href="goumaichedetail.php?id=<?php echo mysql_result($query,$i,"id");?>" target="_blank">详细</a> </td>
    </tr>
    <?php
    }
    }
    ?>
    </table>
    <p>以上数据共<?php echo $rowscount;?>条,共计金额:<?php echo $jinez?>; <!--youzuiping3-->
    <input type="button" name="Submit2" onclick="javascript:window.print();" value="打印本页" style='border:solid 1px #000000; color:#666666' /> <input type="button" name="Submit3" onclick="javascript:location.href='goumaiche_listxls.php';" value="导出EXCEL" style='border:solid 1px #000000; color:#666666' />
    </p>
    <p align="center"><a href="goumaiche_list.php?pagecurrent=1">首页</a>, <a href="goumaiche_list.php?pagecurrent=<?php echo $pagecurrent-1;?>">前一页</a> ,<a href="goumaiche_list.php?pagecurrent=<?php echo $pagecurrent+1;?>">后一页</a>, <a href="goumaiche_list.php?pagecurrent=<?php echo $pagecount;?>">末页</a>, 当前第<?php echo $pagecurrent;?>页,共<?php echo $pagecount;?>页 </p>
    <?php
    //yoxutixinxg if($kucddduntx>0)
    //yoxutixinxg{
    //yoxutixinxg tsgehxdhdm
    //yoxutixinxg}
    ?>
    </body>
    </html>

  • 相关阅读:
    1.时间复杂度与空间复杂度分析
    数据结构与算法之重头再来
    MySQL时间字段与业务代码取出的时间不一致问题
    [redtiger]在线靶场level3
    win10 卡顿 MsMpEng.exe进程
    react 笔记 局部打印 print
    react table td 自动换行
    kali apt-get update release文件过期
    ubuntu怎么切换到root用户,切换到root账号方法
    winscp连接kali 使用预置密码验证 拒绝访问
  • 原文地址:https://www.cnblogs.com/wanghaoning/p/14914891.html
Copyright © 2011-2022 走看看