<?php
/*=================================================
分页涵数 
初固定传递 $page 与 $random 外，
还可额外传递两个参数$para_name与$para_name1 其值分别为$para_value与$para_value1	
=================================================
*/
function page_search($unit,$info,$para_name,$para_value,$para_name1,$para_value1,$para_name2,$para_value2,$para_name3,$para_value3,$para_name4,$para_value4){
	global $page,$total,$page_count,$page_size,$random,$lang;
	$str="";
	$prev_page=$page-1;
	$next_page=$page+1;
?>
	<table width="100%" border="0" cellspacing="2" cellpadding="0" align="center">
		<form name="search_form" method="post">
		<tr>
			<td colspan="2" align="right">
			<?=$lang['pagelist.str1']?>:<?=$page_size." ".$unit?><?=$lang['pagelist.str2']?> <b><?=$total?></b> <?=$unit.$info?>
			</td>
		</tr>
			<input type="hidden" name="random" value="<?=$random?>">
			<!--================额外条件还可以再添加===================-->
			<?
			if ($para_name!=""){
				$str.="&".$para_name."=".$para_value;
			?>
				<input type="hidden" name="<?=$para_name?>" value="<?=$para_value?>">
			<?
			}
			if ($para_name1!=""){
				$str.="&".$para_name1."=".$para_value1;
			?>
				<input type="hidden" name="<?=$para_name1?>" value="<?=$para_value1?>">
			<?
			}
			if ($para_name2!=""){
				$str.="&".$para_name2."=".$para_value2;
			?>
				<input type="hidden" name="<?=$para_name2?>" value="<?=$para_value2?>">
			<?
			}
			if ($para_name3!=""){
				$str.="&".$para_name3."=".$para_value3;
			?>
				<input type="hidden" name="<?=$para_name3?>" value="<?=$para_value3?>">
			<?
			}
			if ($para_name4!=""){
				$str.="&".$para_name4."=".$para_value4;
			?>
				<input type="hidden" name="<?=$para_name4?>" value="<?=$para_value4?>">
			<?
			}
			?>
			<tr>
				<td><?=$lang['pagelist.str3']?><font color="red"><?=$page?></font>/<?=$page_count?> <?=$lang['pagelist.str10']?>&nbsp;</td>
				<td align="right"><?=$lang['pagelist.str4']?>
				<?
				if ($page<=1){
				?>
					<?=$lang['pagelist.str5']?>&nbsp;<?=$lang['pagelist.str6']?>
				<?
				}
				else{
				?>
					<a class="asp" href="<?=$PATH_INFO?>?page=1<?=$str?>"><?=$lang['pagelist.str5']?></a>&nbsp;
					<a class="asp" href="<?=$PATH_INFO?>?page=<?=$prev_page.$str?>"><?=$lang['pagelist.str6']?></a>
					<?
				}
					?>
				&nbsp;
				<?
				if ($next_page>$page_count){
				?>
					<?=$lang['pagelist.str7']?>&nbsp;<?=$lang['pagelist.str8']?>
				<?
				}
				else{
				?>
					<a class="asp" href="<?=$PATH_INFO?>?page=<?=$next_page.$str?>"><?=$lang['pagelist.str7']?></a>&nbsp;
					<a class="asp" href="<?=$PATH_INFO?>?page=<?=$page_count.$str?>"><?=$lang['pagelist.str8']?></a>
				<?
				}
				?>
				&nbsp;&nbsp;<?=$lang['pagelist.str9']?>
				<input type="text" name="page" size="2"><?=$lang['pagelist.str10']?>
				<input type="submit" value="GO!" name="cndok">
			</td>
		</tr>
		</form>
	</table>
<?
}
?>