This topic is locked

User Input variables

8/20/2007 7:13:49 PM
PHPRunner General questions
H
horsey_kim author

I am also thinking of a series of screens for inputing, since you can't edit or add with inner joins.
first screen is a add screen that allows the person to enter customer data for the customer table.
This would also generate an invoice number, that would need to be used on each product item they choose in the next screens.
(I assume I would use the event process to send them to the next screen)
The next screen would need to be a search screen that allowed them to pick out a category to get the list down.
They pick the category and up pops the list of products.
once the list came up they could use the inline edit feature to select each item they wanted.
[color=#FF00FF]But how would I be able to get the inline edit to pick up invoice number with out them having to select from drop down or input it?
Once they edit the info they need on the products and some how the invoice number is now in the field of each products field, they could save all. If they wanted to do more items I will have a link at the top to do another search and continue.
But the biggy for me is getting it automated so that they don't have to enter the invoice number all the time.
Clueless, Hope some advice could help.
Kim NEWBIE - just enough knowledge to be a pain! Sorry

Sergey Kornilov admin 8/21/2007

You need to use session variables for this purpose.
In AfterAdd event get the value of invoice number (I assume we are talking about autoincrement field) and save it in Session variable:
function AfterAdd(&$values,&$keys)

{
$_SESSION["Invoice"] = $keys["Invoice"];
}
After that you can use $_SESSION["Invoice"] as a default value for the invoice number in child tables.

H
horsey_kim author 8/28/2007

Thanks - I will give it a try.
Your great!
Kim

H
horsey_kim author 10/24/2007

Okay I put this in the afteradd of the add page.
$_SESSION["blueid"] = $keys["blueid"];
//** Redirect to another page ****

header("Location: pickblue_list.php");
exit();
Then in the pick blue list using ONLINE EDIT - I put default value of text field as:
$_SESSION["blueid"]
However it does not auto fill in.

Alexey admin 10/25/2007

Make sure $keys["blueid"] is not empty.
Comment out your redirect code and add this line to see $keys array contents:

print_r($keys);

H
horsey_kim author 10/25/2007

Yes it is filling in - I get this message at the top of the add page when it pops up that record was added.
Array ( [blueid] => 11 )
So why would it not fill in on the online edit when I click to open the line items?

H
horsey_kim author 11/7/2007

Yes it is filling in - I get this message at the top of the add page when it pops up that record was added.

Array ( [blueid] => 11 )
So why would it not fill in on the online edit when I click to open the line items?


Humm guess no one knows why?

J
Jane 11/8/2007

Kim,
default values don't work on the edit page.

To assign default value on the edit page use Edit page: Before display event.

Here is a sample code:

$smarty->assign("value_FieldName",$_SESSION["blueid"]);