Example #1
0
<?php
require ("share.php");
require ("../config.php");
//config.php调用了分页类
	
if(isset($_COOKIE["Job_COOKIE"])){

//企业记录
$sql = "SELECT * FROM fair limit 0,10 ";   
$page = new Page($sql,10);
$sql =  $page->StartPage("fair_id",false,true,'down');//调用分页函数
$result = $db->query($sql);
$fair_list = array(); 
while ($row = $db->fetch_array($result)) {// 取一条数据 
	if($row['name'] == ""){
		$row['name'] = "<font color=red>招聘会名称为空</font>";
	}
	if($row['date'] == ''){
		$row['date'] = "<font color=red>日期为空!</font>";
	} 
	if($row['address'] == ''){
		$row['address'] = "<font color=red>地点为空!</font>";
	} 
	$fair_list[] = $row;
}

$db->free_result($result);
$ButtonArray = array("首页","上一页","下一页","末页");
$db->close();
$strHtml = $page->EndPage($ButtonArray,"select",true);//html分页条
$smarty->assign('pagePanel',$strHtml);