|
//==初始化分页变量================
$keywords=trim($keywords);
$currentdate = date('Y-m-d', time());
$tablename="publish ";
$pageSize=10;
$goPage=$goPage;
$selcetFields="*";
$sqlConditions="and flag='Y' ";
if (trim($dateRange)!="") {
$minDate = date("Y-m-d",time() - 24*60*60*$dateRange);
$sqlConditions.="and reg_time>='$minDate' ";
}
if (trim($pt)!="#" && trim($pt)!="") {$sqlConditions.="and pt='$pt' ";}
if (trim($pct)!="#" && trim($pct)!="") {$sqlConditions.="and pct='$pct' ";}
if (trim($info_type)!="#" && trim($info_type)!="") {$sqlConditions.="and info_type='$info_type' ";}
if (trim($keywords)!="") {$sqlConditions.="and title like '%$keywords%' ";}
if (trim($province)!="#" && trim($province)!="") {$sqlConditions.="and province='$province' ";}
if (trim($city)!="#" && trim($city)!="") {$sqlConditions.="and city='$city' ";}
if (trim($sqlConditions)!="") {$sqlConditions=substr($sqlConditions,3);}
$sqlOrders=" order by id desc ";
$url="$PHP_SELF?$oriVARS"; //===
//建立数据库连接
$db = new DB_sql;
$db->connect(); //===
//返回第一条记录位置、总行数、当前页码和总页码
list($firstRow,$totleRows,$currentPage,$totalPages)=
divpage($tablename,$sqlConditions,$totleRows,$pageSize,$goPage);
//建立并执行查询语句
$strQuery="select $selcetFields from $tablename ";
if (trim($sqlConditions)!=""){$strQuery.="where $sqlConditions ";}
if (trim($sqlOrders)!=""){$strQuery.=" $sqlOrders";}
$strQuery .=" limit $firstRow, $pageSize ";
$db->query($strQuery);
if ($db->num_rows()==0) {echo "Sorry,暂时符合条件的没有记录!"; die();}
//===
?>
符合条件的信息 共 条
//循环取出数据
$i=1;
while ($db->next_record()){
list ($id,$m_id,$info_type,$pt,$pct,$title,$content,$validate,$company,$province,$city,$address,$code,
$contact,$tel,$fax,$email,$flag,$reg_time)=$db->Record;
?>
|
|
、>
【 echo $array_info_type[$info_type];?>
】 |
[
]
[>详细信息]
$i++;
}?>
|
|
|
|