This topic is locked

CHART PROBLEM AGAIN

11/18/2007 4:47:53 PM
PHPRunner General questions
J
joesjnr author

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

Hello all
I have another chart problem since the last problem, http://www.asprunner.com/forums/index.php?showtopic=6829 , I could not make it work.
Now, I want to make bar chart based on branch by branch where branch is selectable by the user. When a user select a branch from the dropdown list where this dropdown list is dependent on the "branch" table (Branch_Name field), then the chart for that branch will show its sales status and count.
The user selectable list is important as my users do not like to find via the Advanced search function.
How do I do this using PHPRunner?
A million Thanks in advance.
wr,

JOE

Alexey admin 11/19/2007

Hi,
you can do this using Events and Visual Editor.
Add this code to the Chart page in HTML mode in Visual Editor:

<select onchange="window.location='..._chart.php?a=filter&branch='+escape(this.options[this.selectedIndex].value);">

<option value="Branch 1">Branch 1</option>

<option value="Branch 2">Branch 2</option>

...

</select>



Add this code to Chart page: Before processevent:

if(@$_GET["a"]=="filter")

$_SESSION["branch"]=@$_GET["branch"];



And this to Chart page:Before SQL Query

if(@$_SESSION["branch"])

$strWhereClause = whereAdd($strWhereClause,"branch_name='".$_SESSION["branch"]."'");

J
joesjnr author 11/20/2007

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

Thanks!
can the dropdown list for the branch be a dependent list from the branch table in this case?