This topic is locked

reducing steps required - adding record to new record

11/6/2008 11:44:44 AM
PHPRunner General questions
W
wfcentral author

I have created a database for a client - Dry Cleaners
tbl_customers (id, customer name)
tbl_locations (id, customer_ID, rack number)
The idea is that they have a thousand locations where a customers dry cleaning gets placed... they enter a customer into the system and then add locations to that customer for each item of clothing on the rack.
Works great...
Now, they ask me if I can "reduce" the number of steps required in the following scenario...
Here's what they have to do now...
New customer comes in - they go to the customer list and start typing customer name into search box and see that nothing comes back

They now have to click "add new" so they can add new customer. They have to type the name again and save.

Now they have to search for that customer again so they can add "locations" to them.
How they would like it to work...

do a search for a customer such as "Charlie Brown" - nothing shows up in ajax dropdown of search box so they click "add customer" and it takes them to the add page with the name "Charlie Brown" already in the box - they click "save" and it takes them to the add location page for customer Charlie Brown.
Now sure how much of this is even possible in phpRunner since it would involve capturing a record ID as it is created and passing it to the next page.
Robert

C
chaintm 11/6/2008

Actually I am going to do the same thing, I figured it out (just haven't tried it yet)..
What I have currently is this..














in a test as you can see in the pic, I used pulldown menus.. so zipcode is the main menu... bill state and city work off of that. So when a zipcode is entered a list comes up with possible selections, once done the other parts fill in automaticly.

The other thing I did was checkbox the "allow to add new value on the fly".. so if I missed a zipcode on my database they can add on the fly to that category. I allow this "on the fly" on all those menus that are related. After the submit button is hit, it saves it to that current record, but on exit it also submits new values if current values don't match prior ones. IE searches the other tables that I have customer backup info on (basicly a duplicate table that has all the same fields) so that this information can be then called back in the future. Now if all your customer info is in one location this could be an issue for you and you would need to make another table that echos the current.
So for me (I haven't implemented all this yet ) However the test run for zipcode/city/state worked, so I don't see why doing the same for the customer name etc wouldn't work as well. You just need to duplicate the file so when the next order comes in for the same customers they just do the same ajax search and now that customer is on that given menu list. Does that make sense ?
The images above in the actual code shows how to carry over a value of my subtotal, but in principle this works the same way that my zipcode relations and soon my customer info relations will work.. just need to add it all, but in this excample if you know a bit of code (enough to be dangerous) as myself, you can see from the pics what I mean). If you need a bit more clarity let me know, I will see if I can answer you. When my project is done at the end of the month, I am going to submit a thread with a ton of modified code along with explenation so people can use it. I don't care if people have my code, more should be open to help others we are in the business togather, I have plenty of work and don't need to worry about my next paycheck if everyone has my code <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=34844&image=8&table=forumreplies' class='bbc_emoticon' alt=':)' /> Hope I start a trend <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=34844&image=9&table=forumreplies' class='bbc_emoticon' alt=':)' />

W
wfcentral author 11/13/2008

I read over your example - thanks - I understand some of it, not all of it - haven't had time to read and try it first hand.
I do have the "add new" option in my customer field and personally - I think it is a pretty workable solution that I have in place now.
They go to "add location" and start typing in a customer name - the ajax populator shows them if the customer is already in the system. If not, they just hit "add new" and put in the the new customer name and hit OK. When the pop up closes they are looking at the location page with the just added customer name in the box and they just finish putting in the location of their clothes on which rack and hit ok.
Well, they do not like the face that they have to type in "charlie brown" once to see if he is in the database, then when they hit "add new" they have to type it in again.
Kinda like giving someone a car and they are not happy because they have to open the door to get in...
Anyway, they would like it if they could just put in the name anyway like they are searching and when he doesn't show up just put in his clothes location and hit save and it updates two tables... one with the location and the other with the new customer.