Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Creating an Invoice Form in the cloud

  1. #11
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Dear Daniel: Thanks for the great info. This is exactly what I need to solve possibly a few of my dilemmas. I need to try one at a time. Starting with the concept of Sessions, could that be used to pass a client ID# from page to page? Or is it better to use $_GET variables? I made a page with several tabs with the idea that an agent could do all things related to a particular client from the one page. I tried to upload a screenshot as an attachment so you could see what I am talking about, so hopefully you can see it.

    Because there are over 35,000 clients, it takes a few seconds to locate the client ID# so I don't want the agent to have to keep choosing the client from a drop-down list for each function. What is the best way to handle this?

    Mahalo! e

  2. #12
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That's a very difficult question to answer.

    A session is the only tool in PHP that will NOT change a variable when the page reloads. But the downside of this is that it also then will not be dependent on which page you access. Therefore, sometimes it is confusing.

    If the ID is part of the "session" (general timespan of accessing the site) then that is a good idea. If it is dependent on single pages (even many single pages), it probably should not be stored in a session in this way-- the session is a value across an entire site.

    For example, a shopping cart is perfect for sessions because you only have one. If you needed to have several shopping carts, you might need to find another approach based on what part of the site you were accessing.


    However, since you are using a dropdown list, I suggest pre-setting that to the last accessed value in $_SESSION. Loop through your values to generate it and if it is equal to the last used value (store this in $_SESSION first!), then append select="selected" to the end of the select option.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #13
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Oh, it seems Sessions would not work as the agent would be accessing many different clients from the time they first log in to the end of their shift.

    I'm not sure how to do this...

    However, since you are using a dropdown list, I suggest pre-setting that to the last accessed value in $_SESSION. Loop through your values to generate it and if it is equal to the last used value (store this in $_SESSION first!), then append select="selected" to the end of the select option.
    The dropdown list is created dynamically from the database of 35K clients and causes a delay. This is what I want to avoid. Is there a better way to pass the variable between the tabs? Thanks.

  4. #14
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What I suggested will automatically pick out the right entry but not force that entry. That way, it will save time but not limit the user.

    You could also use sessions. You CAN change it, but you can't have multiple values at one time. So from the beginning to the end of the shift, they'd start with one, then another, etc. But they wouldn't be able to work on more than one at a time. Rarely is this a problem, but sometimes it causes confusion if they take a break and start again, etc.

    The easiest way may be just using a hidden field in the form generated from the last page.

    Some combination of all of this should work, but it's hard to know without understanding exactly what the users will be doing. And often that's a little unpredictable.

    When in doubt, leave them control, so pre-set the value using sessions and then let them change if needed. For example, you could even skip the select menu and just show plain text (from the session). Then have a Javascript link to "select other user" which brings up the select menu. Obviously this gets a little more complex, but it will be more complex if it's able to handle every possible user's method, and, probably, mistakes.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. The Following User Says Thank You to djr33 For This Useful Post:

    kuau (08-31-2010)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •