This topic is locked

Event - list other orders on edit-page

8/16/2006 9:49:37 AM
PHPRunner General questions
scuba author

haven't been here for quite a while, hi everyone <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=3191&image=1&table=forumtopics' class='bbc_emoticon' alt=';)' />

In Demo3 there is this list of all related orders to a certain customers shown on edit-page. Is that possible with standard-events or a custom code?

What do I have to do to make that happen?

thanks in advance!!

J
Jane 8/17/2006

Hi,
this event is described in the PHPRunner Help:

PHPRunner Help
Here is event code:

function EditOnLoad($where)

{
global $conn;
$rs = db_query("select CustomerID from orders where ".$where, $conn);

$data = db_fetch_numarray($rs);

$CustomerID = $data[0];

echo "Orders placed by " .$CustomerID. "
";
$rsOrders = db_query("select * from orders where CustomerID='".$CustomerID."'", $conn);

while($data=db_fetch_array($rsOrders))

{

echo "<a target=_blank href=orders_edit.php?editid=".$data["OrderID"]. ">". $data["OrderID"]."</a> ".$data["OrderDate"]."
";

}

}