Contents

 
Home
PHPRunner 6.1 manual
Prev Page Next Page
 
 

Show list of customer orders

 

Show list of all orders placed by this customer on Order Edit page.

Use toolbar_snippet (Insert PHP code snippet) button to add this event on the Visual Editor page.

yellowbulbNote: Change the values listed in red to match your specific needs.

global $dal;

$tblOrders = $dal->Table("Orders");
$rs = $tblOrders->Query("OrderID=".$_REQUEST["editid1"],"");
$data = db_fetch_array($rs);
$CustomerID = $data["CustomerID"];
echo "Orders placed by " .$CustomerID. "<br>";
$rsOrders = $tblOrders->Query("customerid='".$CustomerID."'","");
while($data=db_fetch_array($rsOrders))
{
echo "<a target=_blank href=Orders_edit.php?editid1=".$data["OrderID"].
 ">". $data["OrderID"]."</a> ".$data["OrderDate"]."<br>";
}

For more information about using Data Access Layer (DAL), see Data Access Layer.

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)