Ok, here's my question. I'm creating a ticketing system for a client. The client want to be able to have a timestamp type of option, but it goes further than just displaying time and date. What they want is a way for it to keep the time, and once a month, be able to run a report, and total the times out. Is there anyway that this can be done in a fast, cgi, or if anyone knows any other way to do this, any help at all would be greatly appreciated. Thanks

If you create a separate data file that gets updated every time a ticket is completed, you have your extremely fast solution.

For example, the data file can contain:

Year Month Day Total Time

Within the actual ticket data, you have a start time (and date). When the ticket is closed, you can a completion time. With this information, get the total time for the ticket and update your total time data file.

Personally, (unless you use Julian or other date formats) I would keep the year, month, and day as separate fields in your total time data file for searching options... this would allow for more customizable queries (eg January 15, 2000 through August 19, 2000) without needing to split the date each time (which can itself take a while on really large data files).

If any of the above is confusing, please reply and we'll be glad to clarify.

Jasmine- Thanks for the advice, but one problem I see is that many different 'hands' will be hitting the tickets, and the client wants to be able to track total time, not just start stop, I guess what they're doing is tallys on certain tickets. Also, I'm not very sure on the structuring of something like this, and was wondering if anyone out there would be willing to take a shot at trying to give me a hand with writing this. To say that I'm a somewhat newer perl programmer would be an understatement :-Þ Thanks

I am not sure I understand what you are trying to do but I will give it a shot based on what I think you mean. Some one starts a ticket some how. First you assign the ticket a unique ID. Now you need to write the ticket to a database with some sort of time stamp. I personally use the function time() and just convert this to the actual time when I do the calculations. This will make statistics more accurate. Your row in your database will look something like thisTicket ID-------Time-------etc...Where etc is the rest of the information for the ticket. Could be name address etc... Now when someone does something else with this ticket you just add another row to your database with the same Ticket ID and a different time stamp. When it is time to do the calculations you will just pull up all the tickets for that particular Ticket ID and do all your calculations on the time stamps. This way of doing it can produce quite a bit of data but it is also the most accurate for calculations and ticket tracking. Please note: you do not have to use a ticket id you just need to use something that is unique...could be an email address. When the ticket is closed out you would just delete all the rows in the database with the unique ticket id or send them to an archive..whatever. If you need help deciding what type of database you should use let me know.

Hmm, I'm not sure if I'm even describing this correctly, you have the basic idea down, but they want (ie, must, with a whole lot of pushing) have a way to run a report based on the total time that a ticket was left open, on hold, etc... I've seen this done in Lotus notes, it's just a time field of how many hours a ticket was open, left on hold, or closed or whatever. They want that now on this web-based ticketing system. Does that help at all? Or am I asking for miracles?

Right. Now for the kicker... They want to be able to run the reports like this: 4 hours 8 hours 24 hours 48 hours monthly yearly etc.... Am I dreaming on creating this or is it remotely possible? They DO NOT want to have to physicaly open a database to match tickets, they want a way for it to be able to pull times PER ticket. On demand.