This topic is locked

How to put summary on Menu page

11/5/2007 8:35:12 PM
PHPRunner General questions
J
joesjnr author

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6734&image=1&table=forumtopics' class='bbc_emoticon' alt=':ph34r:' />

Hello all,
Need some guidance.
I need to put a summary on the menu page like
Products sold to date

Product A : 12 units

Product B: 10 units
How do I do this?
Thanks

J
Jane 11/6/2007

Hi,
yuo can do it using custom event (Insert PHP code snippet option on the Visual Editor tab) on the menu page.

Here is a sample code:

global $conn;

$mess = "";

$strSelect = "select * from TableName where DateField=now()";

$rs = db_query($strSelect,$conn);

while ($data = db_fetch_array($rs))

{

$mess.= "Product ".$data["ProductName"]." : ".$data["Quantity"]." units"."
";

}

echo $mess;



where DateField, ProductName and Quantity are your actual field names, TableName is your actual table name.

J
joesjnr author 11/10/2007

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=23207&image=1&table=forumreplies' class='bbc_emoticon' alt=':ph34r:' />

Thanks.
I found another of doing it using "Event".

After successful login, jump to page and that page is the summary report.

although not what i want but users accept it, so it's ok this way.