Hi all ,
I have using PEAR:Pager , to do paging .
Everthing are ok . Except the running no will always start from 1 to 10 .
Anyway to increase the running number when user click next page for
example Page 1 : 1 to 10,
Page 2 : 11 to 20, and so on
Thanks
below is the code , the running number is the variable k.
<?php
while (list($name, $value) = each($chassisresult)) {
$model = $value['chasis_model'];
$serialno = $value['serial_no'];
$hostname = $value['host_name'];
$country = $value['country'];
$city = $value['city'];
$building = $value['building'];
$other = $value['other'];
$chasis_user_field_1 = $value['chasis_user_field_1'];
$chasis_user_field_2 = $value['chasis_user_field_2'];
$chasis_user_field_3 = $value['chasis_user_field_3'];
$status = $value['status'];
$chasiseos = $value['chasis_eos'];
$chasiseol = $value['chasis_eol'];
$countrynamestr = $serialno . "country[]";
$citynamestr = $serialno . "city[]";
$buildingnamestr = $serialno . "building[]";
$othernamestr = $serialno . "other[]";
$hostnamestr = $serialno . "hostname[]";
$modelnamestr = $serialno . "model[]";
$userfield1name = $serialno . "userfield1[]";
$userfield2name = $serialno . "userfield2[]";
$userfield3name = $serialno . "userfield3[]";
$statusname = $serialno . "status[]";
$eosname = $serialno . "eos[]";
$eolname = $serialno . "eol[]";
$checkboxname = "selected[]";
?>
<tr>
<td align="center" class="std1"><input name="<?php echo
$checkboxname?>" type="checkbox" value="<?php echo $i ?>"></td>
<td align="center" class="std1"><?php echo $k += 1 ?><input
name="<?php echo $countrynamestr?>" type="hidden" value="<?php echo
$country ?>"></td>
<td class="std2"><?php echo $country == '' ? ' ' : $country
?><input name="<?php echo $citynamestr?>" type="hidden" value="<?php
echo $city ?>"></td>
<td class="std2" ><?php echo $city == '' ? ' ' : $city ?><input
name="<?php echo $buildingnamestr?>" type="hidden" value="<?php echo
$building ?>"></td>
<td class="std2"><?php echo $building == '' ? ' ' : $building
?><input name="<?php echo $othernamestr?>" type="hidden" value="<?php
echo $other ?>"></td>
<td class="std2"><?php echo $other == '' ? ' ' : $other ?></td>
<td class="std2"><?php echo $hostname == '' ? ' ' : $hostname
?><input name="<?php echo $hostnamestr?>" type="hidden" value="<?php
echo $hostname ?>"></td>
<td class="std2" ><?php echo $model == '' ? ' ' : $model
?><input name="<?php echo $modelnamestr?>" type="hidden" value="<?php
echo $model ?>"></td>
<td class="std2"><?php echo $serialno ?><input name="Serialno[]"
type="hidden" value="<?php echo $serialno ?>"></td>
<td class="std2"> </td>
<td class="std2"> </td>
<td class="std2"> </td>
<td class="std2"><?php echo $chasiseos == '' ? ' ' :
dateconvert($chasiseos,2) ?><input name="<?php echo $eosname?>"
type="hidden" value="<?php echo $chasiseos ?>"></td>
<td class="std2"><?php echo $chasiseol == '' ? ' ' :
dateconvert($chasiseol,2) ?><input name="<?php echo $eolname?>"
type="hidden" value="<?php echo $chasiseol ?>"></td>
<td class="std2"><?php echo $chasis_user_field_1 == '' ? ' ' :
$chasis_user_field_1 ?><input name="<?php echo $userfield1name?>"
type="hidden" value="<?php echo $chasis_user_field_1 ?>"></td>
<td class="std2" ><?php echo $chasis_user_field_2 == '' ? ' ' :
$chasis_user_field_2 ?><input name="<?php echo $userfield2name?>"
type="hidden" value="<?php echo $chasis_user_field_2 ?>"></td>
<td class="std2" ><?php echo $chasis_user_field_3 == '' ? ' ' :
$chasis_user_field_3 ?><input name="<?php echo $userfield3name?>"
type="hidden" value="<?php echo $chasis_user_field_3 ?>"></td>
<input name="<?php echo $statusname?>" type="hidden" value="<?php
echo $status ?>">
</tr>
<?php
$i += 1;
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php