Hello
I have a problem which i hope someone can help me with. I have a website where customers can login and their current and previous orders.
What i need now is for the customers to look through their orders. I kind of already have a script for this:
[code=php]$recordcount = mssql_num_rows( $result);
$pagecount = $recordcount / $displayPerPage ;
$r = fmod($recordcou nt, $displayPerPage );
if ($r > 0) {
$pagecount = floor($pagecoun t) + 1;
}
if ($pagecount < 1) { $pagecount = 1; }
if (mssql_num_rows ($result) > 0) {
if (isset($_GET['offset']) && $_GET['offset'] != 0 ) {
mssql_data_seek ($result, $_GET['offset']);
$rowsLeft -= $_GET['offset'];
$currentPage = ($recordcount - $rowsLeft) / $displayPerPage ;
$r = fmod(($recordco unt - $rowsLeft), $displayPerPage );
if ($r > 0) {
$currentPage = floor($currentP age) + 1;
}
}[/code]
I also have a script that shows the customer how many orders that were found and on how many pages the orders are shown at. ex. 67 orders found, page 1 of 7.
[HTML]<?php print $recordcount ?> orders found, page <?php print $currentPage ?> of <?php print $pagecount ?>[/HTML]
I also have a next and previous button script:
[HTML]<?php
if (isset($_GET['offset']) && $_GET['offset'] != 0 ) {
echo "<a href=\"?offset= " . ($_GET['offset'] - $displayPerPage ) . "\">" . "Previous</a>";
}
?>
<?php
if ($rowsLeft > 0) {
echo "<a href=\"?offset= " . (@$_GET['offset'] + $displayPerPage ) . "\">" . "Next</a>";
}
?>[/HTML]
What i need is numbers with links in between the previous and next buttons that the customer can click to go that exact page of the order view. Ex.
1 2 3 4 5 6 7 Next
Can anyone help me making these number links.......... ..?
Thanks in advance...
I have a problem which i hope someone can help me with. I have a website where customers can login and their current and previous orders.
What i need now is for the customers to look through their orders. I kind of already have a script for this:
[code=php]$recordcount = mssql_num_rows( $result);
$pagecount = $recordcount / $displayPerPage ;
$r = fmod($recordcou nt, $displayPerPage );
if ($r > 0) {
$pagecount = floor($pagecoun t) + 1;
}
if ($pagecount < 1) { $pagecount = 1; }
if (mssql_num_rows ($result) > 0) {
if (isset($_GET['offset']) && $_GET['offset'] != 0 ) {
mssql_data_seek ($result, $_GET['offset']);
$rowsLeft -= $_GET['offset'];
$currentPage = ($recordcount - $rowsLeft) / $displayPerPage ;
$r = fmod(($recordco unt - $rowsLeft), $displayPerPage );
if ($r > 0) {
$currentPage = floor($currentP age) + 1;
}
}[/code]
I also have a script that shows the customer how many orders that were found and on how many pages the orders are shown at. ex. 67 orders found, page 1 of 7.
[HTML]<?php print $recordcount ?> orders found, page <?php print $currentPage ?> of <?php print $pagecount ?>[/HTML]
I also have a next and previous button script:
[HTML]<?php
if (isset($_GET['offset']) && $_GET['offset'] != 0 ) {
echo "<a href=\"?offset= " . ($_GET['offset'] - $displayPerPage ) . "\">" . "Previous</a>";
}
?>
<?php
if ($rowsLeft > 0) {
echo "<a href=\"?offset= " . (@$_GET['offset'] + $displayPerPage ) . "\">" . "Next</a>";
}
?>[/HTML]
What i need is numbers with links in between the previous and next buttons that the customer can click to go that exact page of the order view. Ex.
1 2 3 4 5 6 7 Next
Can anyone help me making these number links.......... ..?
Thanks in advance...
Comment