租房子练习

<!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" />
<title>无标题文档</title>
<style type="text/css">
.qylist
{
    float:left;
}
.zllist
{
    float:left;
}
.fwlist
{
    float:left;
}
</style>
</head>

<body>
<?php
    include("DBDA.php");
    $db = new DBDA();
    
    @$qytj = $_POST["qy"];
    @$zltj = $_POST["zl"];
    @$fwtj = $_POST["fw"];
    @$key = $_POST["key"];
    
    //造查询字符串
    $str1 = " 1=1";
    $str2 = " 1=1";
    $str3 = " 1=1";
    $str4 = " 1=1";
    
    //判断第一个条件是否有值
    if(count($qytj)>0)
    {
        $ss = implode("','",$qytj);
        $str1 = " Area in ('{$ss}')";
    }
    //判断租赁类型
    if(count($zltj)>0)
    {
        $ss = implode("','",$zltj);
        $str2 = " RentType in ('{$ss}')";
    }
    //判断房屋类型
    if(count($fwtj)>0)
    {
        $ss = implode("','",$fwtj);
        $str3 = " HouseType in ('{$ss}')";
    }
    //判断关键字
    if($key!="")
    {
        $str4 = " KeyWord like '%{$key}%'";
    }
    
    $sqltj = " where".$str1." and".$str2." and".$str3." and".$str4;
    
    
?>

<form action="0329House.php" method="post">
<div>
    <div style="margin-top:10px">区域:<input type="checkbox" id="qyall" name="qyall" οnclick="CheckAll(this,'qy')" />全选</div>
    <div>
        <?php
        $sqlqy = "select distinct(Area) from HouseDB";
        $attrqy = $db->Query($sqlqy);
        for($i=0;$i<count($attrqy);$i++)
        {
            echo "<div class='qylist'>
            <input type='checkbox' name='qy[]' class='qy' value='{$attrqy[$i][0]}' />
            {$attrqy[$i][0]}
            </div>";
        }
        ?>
    </div>
    <div style="clear:both"></div>  <!--截断流  用来清除float-->
    <div style="margin-top:20px;">租赁类型:<input type="checkbox" id="zlall" name="zlall" οnclick="CheckAll(this,'zl')" />全选</div>
    
    <div>
        <?php
        $sqlzl = "select distinct(RentType) from HouseDB";
        $attrzl = $db->Query($sqlzl);
        for($i=0;$i<count($attrzl);$i++)
        {
            echo "<div class='zllist'>
            <input type='checkbox' name='zl[]' class='zl' value='{$attrzl[$i][0]}' />
            {$attrzl[$i][0]}
            </div>";
        }
        ?>
    </div>
    <div style="clear:both"></div>  
    <div style="margin-top:20px">房屋类型:<input type="checkbox" id="fwall" name="fwall" οnclick="CheckAll(this,'fw')" />全选</div>
    
       <div>
        <?php
        $sqlfw = "select distinct(HouseType) from HouseDB";
        $attrfw = $db->Query($sqlfw);
        for($i=0;$i<count($attrfw);$i++)
        {
            echo "<div class='fwlist'>
            <input type='checkbox' name='fw[]' class='fw' value='{$attrfw[$i][0]}' />
            {$attrfw[$i][0]}
            </div>";
        }
        ?>
    </div>
    <div style="clear:both"></div>
    
    <div style="margin:20px 0px 20px 0px">关键字:<input type="text" name="key" /> &nbsp;<input type="submit" value="搜索" /></div>
    
</div>
</form>

<table width="100%" border="1" cellpadding="0" cellspacing="0">
    <tr>
        <td>关键字</td>
        <td>区域</td>
        <td>面积</td>
        <td>租金</td>
        <td>租赁类型</td>
        <td>房屋类型</td>
    </tr>
    
    <?php
        
        $sqlall = "select * from HouseDB".$sqltj;
        $rall = $db->Query($sqlall);
        
        for($i=0;$i<count($rall);$i++)
        {
            echo "<tr>
            <td>{$rall[$i][1]}</td>
            <td>{$rall[$i][2]}</td>
            <td>{$rall[$i][3]}</td>
            <td>{$rall[$i][4]}</td>
            <td>{$rall[$i][5]}</td>
            <td>{$rall[$i][6]}</td>
            </tr>";
            
        }
    
    ?>
    
</table>

</body>
<script type="text/javascript">
function CheckAll(ck,cname)
{
    var all = document.getElementsByClassName(cname);
    for(var i=0;i<all.length;i++)
    {
        all[i].checked = ck.checked;
    }
    
}
</script>
</html>

 

转载于:https://www.cnblogs.com/zhanghaozhe8462/p/5343615.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
登陆系统:用户通过用户编号和密码登录系统,调用表tb_Admin,同时在每次登陆的时候生成一条日志记录,添加记录到tb_LoginLog,同时显示主界面,根据登陆的用户的身份角色不同,在主界面显示的操作控件会有微小差异 主界面设计与后台:界面的控件布局,美化设计,主界面的后台控制 包含功能菜单: 前台:(可返回登录时的主页面,主页面显示所有房间的状态。下级子菜单:在住顾客,今日在住客人,今日离店客人,今日到+今日离,今日明细表(当日盈利),房态分析表,在住查账) 订单:(单击预定打开所有订单查询页面,子菜单:预定,转入住,入住,取消预定,换房,退房,购买(购买商品的时候需要提供R_RoomId(房间编号,通过这个就可以确定是什么人),C_ConsumeId(商品编号)这些信息。))) 报表:(子菜单:盈利报表,登录日志,住客分析,发票表单) 提醒: 宾客在登记订单的时候会填写预住多少天,时间在到之前(次日11时给服务员发出某房间将要到期的提醒)会提示时间要到了,以提醒宾客提前办理退房手续,弹出消息提示框提示。如有超过预定时间的,将会添加一条违约记录到超时表中 商品管理: 添加商品:新进商品需要登记信息,添加到表tb_ConsumeInfo,需要连接表tb_ConsumeType 更改商品信息 删除商品 设置(管理员权限) 备份设置 计费设置 用户设置 商品设置 房间设置 锁屏 报表:(图表与列表) 盈利报表(按天,按周,按月,按季度,按年,指定日期)(按客房汇总,按商品汇总) 登录日志(查询指定日期的登录日志) 住客分析(分类汇总查询,查询当日某类型房的住客率,楼层住客信息查询) 电子发票(结账时候对个人产生的消费记录)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值