• 0509租房子联系


    <?php
    include("../0507jia/db.class.php");   封装好的类
    $db=new db1();
    $sqla="1=1";
    if(!empty($_POST["qy"]))
    {
       $shuzu1=$_POST["qy"];
       $str1 = implode("','",$shuzu1);
       $sqla=" area in('{$str1}') ";
    }
    $sqlb="2=2";
    if(!empty($_POST["zp"]))
    {
       $shuzu2=$_POST["zp"];
       $str2 = implode("','",$shuzu2);
       $sqlb=" renttype in ('{$str2}')"; 
    }
    $sqlc="3=3";
    if(!empty($_POST["fw"]))
    {
       $shuzu3=$_POST["fw"];
       $str3 = implode("','",$shuzu3);
       $sqlc=" hosetype in ('{$str3}')";
    }
    $value4="";
    $sqld="1=1";
    if(!empty($_POST["name"]))
    {
       $shuzu4=$_POST["name"];
       $sqld=" keyword like '%{$shuzu4}%'";
       $value4="{$shuzu4}";
    }
    ?>
    <form action="Untitled-1.php" method="post">
    <span>区  域:</span> <input type="checkbox" id="qyqx" onclick="chuli1()" />全选</br>
    <?php
    $sql="select distinct area from fz";
    $jieguo=$db->hanshu($sql);
    foreach($jieguo as $v1)
    {
       echo"<input type='checkbox' name='qy[]' class='qy' value='{$v1[0]}'/>{$v1[0]}  ";	
    }
    ?></br></br></br>
    <span>租聘类型:</span> <input type="checkbox" id="zpqx" onclick="chuli2()" />全选</br>
    <?php
    $sql1="select distinct renttype from fz";
    $jieguo1=$db->hanshu($sql1);
    foreach($jieguo1 as $v2)
    {
       echo"<input type='checkbox' name='zp[]' class='zp' value='{$v2[0]}'/>{$v2[0]}  ";	
    }
    ?></br></br></br>
    <span>房屋类型:</span> <input type="checkbox" id="fwqx" onclick="chuli3()" />全选</br>
    <?php
    $sql2="select distinct hosetype from fz";
    $jieguo2=$db->hanshu($sql2);
    foreach($jieguo2 as $v3)
    {
       echo"<input type='checkbox' name='fw[]' class='fw' value='{$v3[0]}'/>{$v3[0]}  ";	
    }
    ?></br></br></br>
    <span>关键字:</span> <input type="text" name="name" value="<?php echo $value4 ?>" />
    <input type="submit" value="提交" />
    </form>
    </br></br></br></br></br></br>
    <?php
    $sqlz="select * from fz where $sqla and $sqlb and $sqlc and $sqld";
    $zjg=$db->hanshu($sqlz);
    echo"<table border='1' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr>
    	 <td>关键字</td>
    	 <td>区域</td>
    	 <td>建筑面积</td>
    	 <td>租金</td>
    	 <td>租聘类型</td>
    	 <td>房屋类型</td>
    	 </tr>";
    	 foreach($zjg as $v4)
    	 {
    	 echo "<tr>
    	 <td>{$v4[1]}</td>
    	 <td>{$v4[2]}</td>
    	 <td>{$v4[3]}</td>
    	 <td>{$v4[4]}</td>
    	 <td>{$v4[5]}</td>
    	 <td>{$v4[6]}</td>
    	 </tr>"; 
    	 }
    echo"</table>";
    	 
    
    ?>
    </body>
    <script type="text/javascript">
    function chuli1()
    {
        var qx1=document.getElementById("qyqx").checked;
    	var qy1=document.getElementsByClassName("qy");
    	for(var i=0;i<qy1.length;i++)
    	{
    	   qy1[i].checked=qx1;	
    	}
    }
    function chuli2()
    {
        var qx2=document.getElementById("zpqx").checked;
    	var qy2=document.getElementsByClassName("zp");
    	for(var i=0;i<qy2.length;i++)
    	{
    	   qy2[i].checked=qx2;	
    	}
    }
    function chuli3()
    {
        var qx3=document.getElementById("fwqx").checked;
    	var qy3=document.getElementsByClassName("fw");
    	for(var i=0;i<qy3.length;i++)
    	{
    	    qy3[i].checked=qx3;	
    	}
    }
    
    
    </script>
    效果:
    
    

      

  • 相关阅读:
    [Tutorial] How to check and kill running processes in Ubuntu
    [Tutorial] Getting started with Gazebo in ROS
    Linux基础命令
    Linux安装系统
    vue 前后端数据交互问题解决
    如何在cmd中启动MongoDB服务器和客户端
    selenuim模块的使用 解析库
    beautifhulsoup4的使用
    浅谈scrapy框架安装使用
    自动登录 点赞 评论 抽屉网
  • 原文地址:https://www.cnblogs.com/wcc731546227/p/5476736.html
Copyright © 2020-2023  润新知