Greetings all,
I have a bit of a conundrum on my hands and I've been mulling over it for a few days now and decided I'd like to get some other expert opinions on the matter.
Background: A website that keeps track of users by cookie sessions has a submit form. At the bottom of the form is a checkbox called "Add another one".
The idea is that you fill in your submit form (we're entering details on car parts), and if you want to add another stock item, you check the checkbox, and hit the 'Submit' button, and it gives you another form to work with, ad nauseum until you don't check the 'Add another one' checkbox, Submit, and it goes to a summary page.

I want to build a master summary with all the items entered by one user at each grouping. What I am currently doing (just to get it running) is I keep an internal ID of this series of items you submit, giving the same "batch ID" to each item submitted in a row, and when you hit the final Submit button, it pulls everything out with that Batch ID and groups them together into one entry for the Summary Page.
Now this is all well and good, and if nothing goes wrong, works nicely - but what if something does go wrong? What if the browser crashes, or the user hits another link (etc...) - and we lose that chain. Now all the items have been entered into the DB - but I don't know when to go and group them... Not to mention keeping batch numbers is pretty ugly

What is the best way of doing this?
I have thought of datestamping the items, and then every half-hour grouping them and making the summary - but if you're still entering stuff when that half-hour hits, then whatevers entered after that isn't grouped.
I could also do the grouping when the user logs out - But what if they only enter one item a couple times a day, and logout in between - so I end up with a bunch of single items in each summary?

I hope this is relatively clear on what I'm doing, and what I'm asking. All suggestions would be appreciated.
The idea is to group these items together in the most intelligent manner... But I'm not expecting to group EVERYTHING they did together, rather maybe make up a list only once a day - but still, I want it to appear somewhat real-time as well...?
Am I asking for just too much functionality for what should be a simple feature? Are these too many conflicting "I wants" that just can't go together? Am I completely confusing?
My thanks for your opinions on the matter,

JP
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --


In reply to A CGI chained-event theory question by JPaul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.