Bootstrap

租房管理系统 php,php出租房数据管理及搜索页面

php数据访问例子:租房信息管理,具体内容如下

a8aaaaa51460d7443cc828e46103f3e6.png

979d2d9e35cb4f3e5987dec0bc397d1b.png

1.数据库建表

84222af04d59d51d9d1a85228f6385f6.png

2. zufangzi.php

租房子

区域:全选

require "DBDA.class1.php";

$db = new DBDA();

$sqy = "select distinct area from house";//写SQL语句,并去重

$aqy = $db->query($sqy);

foreach($aqy as $v)

{

echo "{$v[0]}";

}

?>

租赁类型:全选

$szl = "select distinct renttype from house";

$azl = $db->query($szl);

foreach($azl as $v)

{

echo "{$v[0]}";

}

?>

房屋类型:全选

$sfw = "select distinct housetype from house";

$afw = $db->query($sfw);

foreach($afw as $v)

{

echo "{$v[0]}";

}

?>

关键字:
关键字区域建筑面积租金租赁类型房屋类型

$tj1 = " 1=1 ";

$tj2 = " 1=1 ";

$tj3 = " 1=1 ";

$tj4 = " 1=1 ";

if(!empty($_POST["qy"]))

{

$aqy = $_POST["qy"];

$sqy = implode("','",$aqy);

$tj1 = " area in ('{$sqy}') ";

}

if(!empty($_POST["zl"]))

{

$azl = $_POST["zl"];

$szl = implode("','",$azl);

$tj2 = " renttype in ('{$szl}') ";

}

if(!empty($_POST["fw"]))

{

$afw = $_POST["fw"];

$sfw = implode("','",$afw);

$tj3 = " housetype in ('{$sfw}') ";

}

if(!empty($_POST["key"]))

{

$k = $_POST["key"];

$tj4 = " keyword like '%{$k}%' ";

}

$sql = "select * from house where {$tj1} and {$tj2} and {$tj3} and {$tj4}";

echo $sql;

$arr = $db->query($sql);

foreach($arr as $v)

{

echo "

{$v[1]}{$v[2]}{$v[3]}{$v[4]}{$v[5]}{$v[6]}";

}

?>

function quanxuan(qx,a)

{

//找到该全选按钮对应的checkbox列表

var ck = document.getElementsByClassName(a);

//找全选按钮选中状态

if(qx.checked)

{

for(var i=0;i

{

ck[i].setAttribute("checked","checked");

}

}

else

{

for(var i=0;i

{

ck[i].removeAttribute("checked");

}

}

}

;