views:

201

answers:

1

Hi, I have a custom and simple php/mysql based user system. I'm trying to build a way for members to send product support to our staff (put it in a database, & viewed in admin area) and for them to manage these messages (lack of a better term).

My question is, does anyone know of a good existing script, or a better approach for a support area of my website?

+2  A: 

Ticketing systems are a pretty easy build, have a database table:

tickets
id int(11)
user_id int(11)
message text
is_active tinyint(1)
created_at datetime
time_spent int(5) //unless your going to spend more than 99999 mins on a ticket

Now each time a user creates a ticket it goes into the db as VALUES(id,'$user_id','$message',0,NOW(),0)//remember to clean the vars

Admin can complete a ticket, update the field so that is_active = 1, then request time spent from the admin and update time_spent = '$time_spent'

You could add a commenting system simply

Database table: comments
id int(11)
ticket_id int(11)
user_id int(11)
comment text
created_at datetime

This way you can have unlimited(up to a total total of 99999999999) comments per ticket and you track the user id so you can put names next to each comment.

You can call the comments using

select * from comments where ticket_id = $id //the current tickets id

I hope this helps, its a nice easy build and means you know exactly how it works, its always nice to have done it yourself and its easily customisable.

Regards Luke

Luke
I'm about halfway done with a support ticket script. It's just hard for me to believe that it's so hard to find a decent pre-made one on the internet. I mean, this same script has probably been written a million times.
Derek
Basecamp is what most people use, but its way bigger than you need if you just want a ticket system, have a look here http://pm-sherpa.com/features/basecamp-alternatives/ I cant recomend one because I havent used any. Hope it helpsLuke
Luke