This topic is locked

page count link

6/28/2006 7:42:34 AM
PHPRunner General questions
adamdidthis author

Is it possible to get to appear at the top of the list page as well as the bottom?

Alexey admin 6/28/2006

Adam,
yes, it's possible.
Open ..._list.php file with a text editor, find this code snippet there:

<script language="JavaScript">WritePagination(<?php echo $mypage;?>,<?php echo $maxpages;?>);</script>



Cut and paste it to the place you need.

You can move it anywhere in the file not before this snippet:

<?php

// Pagination: Control Variables

$iNumberOfRows =0;

$maxRecords = 0;

$maxpages = 0;

if (!$mypage)

$mypage=1;

if((integer)$mypage<1)

$mypage=1;

?>

O
osluk 6/28/2006

Alexa too high up and it doesnt show up
So by trial and error i got it here - really good result for me.
(For next time how about some comments to help find things in the code).
Might not work if you have a lot of pages but this is perfect for me.

<OPTION value=500 <?php if($PageSize==500) echo " selected";?>>500

<OPTION value=750 <?php if($PageSize==750) echo " selected";?>>750

</select>

<?php } ?>
<script language="JavaScript">WritePagination(<?php echo $mypage;?>,<?php echo $maxpages;?>);</script>
<!--START-->

<script language="JavaScript">DisplayHeader();</script>



Cheers Chris
PS a couple of people have asked if the titles can be fixed (Excel freeze pane) so they do not scroll and forget which column is which. I try to use a little italic and bold to help with this.
I fobbed off the users and said it could not be done - BUT could it???
Thanks again!

O
osluk 6/28/2006

OK bad idea there as it is not always visible!


Not sure when the header boxes are 3 deep.

So can it safely go in the space shown below?

adamdidthis author 6/28/2006

OK bad idea there as it is not always visible!


Not sure when the header boxes are 3 deep.

So can it safely go in the space shown below?


Yep I managed to get it in there

O
osluk 6/28/2006

Can you post 2 lines above and below so we can document it for new projects.
Cheers Chris

adamdidthis author 7/3/2006

few more lines than you asked for but here you go:

<input type=text size=20 name=SearchFor value="<?php if(@$_SESSION[$strTableName."_search"]==1 && @$_SESSION[$strTableName."_searchfor"]!="") echo htmlspecialchars(@$_SESSION[$strTableName."_searchfor"]);?>">

<input type=button class=button name="SearchButton" value="Search"

onClick="java script: document.forms.frmSearch.a.value = 'search';

document.forms.frmSearch.submit();">

<input type=button class=button value="Show all" onClick="java script: document.forms.frmSearch.a.value = 'showall';

document.forms.frmSearch.submit();">

<a href="orderform_search.php">Advanced search</a><br>Select page<script language="JavaScript">WritePagination(<?php echo $mypage;?>,<?php echo $maxpages;?>);</script> </td>

</form>

<!-- How many records found-->

<td align=center class=shade>

Details found: <?php echo $maxRecords?> <br>Page <?php echo $mypage?> of <?php echo $maxpages?>
</td>

<td align=center class=shade>

<!--Records per page-->

Records Per Page::<br>

<SELECT id=PageSizeSelect onChange="java script: document.forms.frmAdmin.a.value='pagesize'; document.forms.frmAdmin.elements['value'].value = document.getElementById('PageSizeSelect').options[document.getElementById('PageSizeSelect').selectedIndex].value;document.forms.frmAdmin.submit();">

<OPTION value=10 <?php if($PageSize==10) echo " selected";?>>10

<OPTION value=20 <?php if($PageSize==20) echo " selected";?>>20

<OPTION value=30 <?php if($PageSize==30) echo " selected";?>>30
O
osluk 7/6/2006

Thanks more is easier to see the relevant bit