This topic is locked

Previous and Next buttons on the View page, How to add buttons to the

1/27/2009 10:43:03 AM
PHPRunner Tips and Tricks
J
Jane author

Here is a detailed instruction for PHPRunner 5.0:

  1. proceed to the Visual Editortab, switch to HTML mode and add following code in any place where you want to show these buttons:
    {$PreviousButton} {$NextButton}


2. add View page: Before display event on theEvents tab.

Here is a sample code:

global $dal;

//Previous button

$rs = $dal->TableName->Query("RecordID<".$values["RecordID"],"RecordID DESC");

if ($data = db_fetch_array($rs))

{

$str = "<input type=button class=button value=Previous onclick=\"window.location.href='TableName_view.php?editid1=".$data["RecordID"]."';\">";

$xt->assign("Previous",$str);

}
//Next Button

$rs = $dal->TableName->Query("RecordID>".$values["RecordID"],"RecordID ASC");

if ($data = db_fetch_array($rs))

{

$str = "<input type=button class=button value=Next onclick=\"window.location.href='TableName_view.php?editid1=".$data["RecordID"]."';\">";

$xt->assign("NextButton",$str);

}



where TableName is your actual table name, RecordID is your actual field name where key value is stored.