| Author |
Topic Search Topic Options
|
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Topic: Batch Processing Posted: 12 June 2003 at 1:14am |
|
How do I do batch processing? Eg, if I want to add a quantity, I will first search for the item, get the item id and if not found in db, add to db. How do I make it when I search, list of searched item came, and next to each item got a textbox that user can key in quantity of few items in the same screen and once click the "Done" button, all those item will be added. I can do multiple delete by deleting all selected (checkbox) items, but in this case, I really don't know how. Anyway can help? Thanks.
|
 |
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2003 at 1:46am |
|
Ok, I have an idea. Since I managed to get the multiple id, what about using for loop? First, count how many id (records) are they. Eg, if got 4 id, it will loop 4 times creating a form for me to key in a quantity. After the forth, it's done. Is this workable? This is what I have in mind.
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2003 at 8:37am |
|
I usually pass the ID field to the script as comma delineated string and use the Split function to create an array. I then Loop through the array and update the information as necessary.
|
|
|
 |
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2003 at 7:11pm |
|
Do you have a simple example or any resources (url) about this? Thanks, ljamal.
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2003 at 8:10pm |
If you use the shopping cart update function at Bull City Comics, you will see an example of it.
|
|
|
 |
ngaisteve1
Groupie
Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2003 at 10:04pm |
|
Hey ljamal, it won't update quantity. It can only delete when quantity is zero
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2003 at 10:37pm |
Read the page, the inventory management system doesn't let you increase the quantity beyond what is available. So if there is only 1 you will not be able to increase your quantity above one. If you order something like this that has an inventory greater than 1, then you will be able to update the quantity.
Back on topic, the delete and update function both use the batch system, I described earlier.
Edited by ljamal
|
|
|
 |