This topic is locked

Help on selecting custom view from Dropdown Box

5/22/2009 3:57:12 AM
PHPRunner General questions
S
swanside author

Hello.
My database has a table called "reports", in this table it has over 500 fields.
I am going to create 15 custom views based on this table (reports), but each custom view will have a selection of the fields that is in the reports table.

Reason is, we have 15 different engineers job sheet dependant on what the type of job is, and who the customer is.
The engineers go out armed with a PDA, fill in the report on the PDA this sends back only the fields that have been populated via a CSV file.

This CSV file then gets imported and stored in the reports table with the field Job_No as the Primary key. This is now a child to the job table which uses Job_No as a primary key, so Job_No 1002223 will show report 1002223 as a child link.
I now need to break this information down for viewing using custom view, 15 of these will be created to show the different fields from different job sheets.
What I want to get to is. On the edit page for Job_No 1002223, I want a drop down box which shows a list of custom views, so I will have on the drop dow, Report A, Report B, Report C and so on. When the drop down is slected and the user selects the report, it is to open the View page of the report, so it will show something like Test/Report_A_view.php?editid1=1002223 in the address bar?
How can I do this please?
Thanks
Paul.

S
swanside author 5/25/2009

Any Ideas anybody?

J
Jane 5/26/2009

Hi,
you can create this dropdown in the custom event (Insert PHP code snippet option on the Visual Editor tab).

Here is just a sample:

$id = @$_REQUEST["editid1"];

$str = "<select onchange=\"java script: window.location=this.options[this.selectedIndex].value+'_list.php?editid1=".$id."';\">";

$str.="<option value=customview1>customview1</option>";

$str.="<option value=customview2>customview2</option>";

$str.="</select>";

S
swanside author 5/26/2009

Thanks Jane, But I can not seem to get it to work.
I have a main table called "job" and a child table called"report"
From that table (report) I have made two custom views. "DTD" and "Trend".
I also have linked to job two more tables. material and labour.

On my job_edit.php?editid1=1021129 page I have a snippet field which has this code in it. > if (@$_REQUEST["editid1"])

echo "<a target=_blank href=\"labour_list.php?mastertable=job&masterkey1=".$_REQUEST["editid1"]."\">Labour</a>";



and > if (@$_REQUEST["editid1"])

echo "<a target=_blank href=\"material_list.php?mastertable=job&masterkey1=".$_REQUEST["editid1"]."\">Material</a>";


These open the links to the correct pages in a new window.
From my job_edit.php?editid1=1021129 I now need to have a dropdown box that will take me to the view pages for the DTD and Trend, as well as the two other snippets for two other links, materials and Labour.
Is this a valid option?
Thanks

Paul
Edited.
Or even if I can leave the links for my Labour and Materials as they are, and just have a dropdown box to open the view page of DTD or Trend pages in a new window from the edit page?

J
Jane 5/26/2009

Hi,
please make sure there is no whitespace in the javascript word in your code.

If it doesn't help publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

S
swanside author 5/26/2009

Thanks Jane.

I have checked and there are no white spaces. I have sent it into the support dept.
Thanks

Paul.

M
michaelmac 7/23/2009

Hey Support
I think this snippet will work for an app I am doing, BUT where do I add the submit button code once a selection has BEEN made?
Thanks as always
Mike

S
swanside author 7/23/2009

Y0ou dont have a submit button, once you select the value, it opens the page up