This topic is locked

complicated Import process

9/29/2010 12:05:20 PM
PHPRunner General questions
J
jasonfrew author

Hi all
I have a table of products that are attached to an order or a quote.
some of the orders have many products.
the product table stores each product in a single row.
What i would like to be able to do is use the import process in the following way.
The user creates an order or quote.

The user clicks into the product page then clicks on import

i would like the process to ask the user what order number the import is for. The user enters the number

the process would then ask what .csv/.xls the user would like to import

the user would browse to the file.

the process would attach the order number to each record in the .xls/.csv and import all the rows from the .xls/.csv to the products table
Im using PHPRunner 5.2

Wamp server on windows server 2003

and sql server 2005
thanks in advance
Jason

Sergey Kornilov admin 9/29/2010

Just an idea of how you can make it work.
You can save user input to a session variable. Then, using Import page BeforeInsert event you can add this saved value to each imported record.

J
jasonfrew author 9/30/2010

hi thanks for the suggestion
im a complete beginner to php.

Can you give me an example code please
Regards
Jason

Sergey Kornilov admin 9/30/2010

An excerpt from manual topic above:
To access specific field value use $values["FieldName"].
This means in BeforeInsert event you can use the following:

$values["FieldName"] = $_SESSION["Something"];


Where $_SESSION["Something"] is session variable where you saved user input.

J
jasonfrew author 10/1/2010

Hi thanks for the reply
im really new to this so i dont fully understand what you mean
can you give me a step by step breakdown.
thanks
Jason

Sergey Kornilov admin 10/1/2010

Jason,
Step 1:

you (or somebody else) needs to write the code that will ask user to enter order number and save it to session variable $_SESSION["OrderNumber"]
Step 2:

add the following to BeforeInsert event:

$values["FieldName"] = $_SESSION["OrderNumber"];
If you want us to write this code for you - contact support team directly. Our rates can be found at http://xlinesoft.com/buy_support.htm

J
jasonfrew author 10/4/2010



Jason,
Step 1:

you (or somebody else) needs to write the code that will ask user to enter order number and save it to session variable $_SESSION["OrderNumber"]
Step 2:

add the following to BeforeInsert event:

$values["FieldName"] = $_SESSION["OrderNumber"];
If you want us to write this code for you - contact support team directly. Our rates can be found at http://xlinesoft.com/buy_support.htm


thanks for the info. your rates are very good. if i cant figure it out i will be in contact.

Thanks
Jason