This topic is locked

FAO Jane Please

4/16/2008 2:15:24 AM
PHPRunner General questions
S
swanside author

Hi Jane,
Hiow can I get this code to work on a view page?

<select onchange="window.open(this.options[this.selectedIndex].value);"><option value=>Invoice</option><option value="Basic_Invoice_list.php?{$row.1Basic_Invoice_masterkeys}">Basic Invoice</option><option value="Part_Invoice_list.php?{$row.1Part_Invoice_masterkeys}">Intermediate Invoice</option><option value="Full_Invoice_list.php?{$row.1Full_Invoice_masterkeys}">Full Invoice</option></select>


CHeers

Paul.

J
Jane 4/16/2008

Paul,
there isn't $row array on the view page.

You need to fill masterkeys variables in the View page: Before display event.

Here is a sample:

$smarty->assign("Basic_Invoice_masterkeys","mastertable=TableName&masterkey1=".$_REQUEST["editid1"]);

$smarty->assign("Part_Invoice_masterkeys","mastertable=TableName&masterkey1=".$_REQUEST["editid1"]);

$smarty->assign("Full_Invoice_masterkeys","mastertable=TableName&masterkey1=".$_REQUEST["editid1"]);


Then use this code:

<select onchange="window.open(this.options[this.selectedIndex].value);"><option value=>Invoice</option><option value="Basic_Invoice_list.php?{$Basic_Invoice_masterkeys}">Basic Invoice</option><option value="Part_Invoice_list.php?{$Part_Invoice_masterkeys}">Intermediate Invoice</option><option value="Full_Invoice_list.php?{$Full_Invoice_masterkeys}">Full Invoice</option></select>

S
swanside author 4/16/2008

Thanks Jane.
I did that, but, it still brings back all the details of 33256 invoices showing 1 of 1663 and not the individual invoices?

J
Jane 4/16/2008

Hi,
make sure that this code construct correct URL parameters:

echo "mastertable=TableName&masterkey1=".$_REQUEST["editid1"];

echo "mastertable=TableName&masterkey1=".$_REQUEST["editid1"];

echo "mastertable=TableName&masterkey1=".$_REQUEST["editid1"];
$smarty->assign("Basic_Invoice_masterkeys","mastertable=TableName&masterkey1=".$_REQUEST["editid1"]);

$smarty->assign("Part_Invoice_masterkeys","mastertable=TableName&masterkey1=".$_REQUEST["editid1"]);

$smarty->assign("Full_Invoice_masterkeys","mastertable=TableName&masterkey1=".$_REQUEST["editid1"]);



Perhaps you have to select foreign key and replace $_REQUEST["editid1"] with it.

S
swanside author 4/16/2008

Hi,

make sure that this code construct correct URL parameters:
Perhaps you have to select foreign key and replace $_REQUEST["editid1"] with it.


Wow, You lost me now.
WIll let you know how it goes.
Thanks Jane