Page 1 of 1
Can tracking IDs be shortened?
Posted: Wed Aug 03, 2005 12:14 am
by Chris
Script URL:
www.african-violet-brats.com/show/hesk
Version of script: 0.93
Version of PHP: 4.3.10
Hosting company: doteasy
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: tracking, shorter, less, short, length, characters
Write your message below:
Great script! I was wondering if there's a way to shorten the length of the tracking numbers that are generated. For our purposes, a three digit ID is perfect.
Thanks,
Chris
Posted: Wed Aug 03, 2005 1:57 am
by Chris
Never mind, I figured it out. Sorry to bother you!
Tracking ID's shortned
Posted: Sat Nov 26, 2005 3:31 pm
by jimmckenna
Chris,
Like you I need to shorten the tracking ID's could you please publish how this is achieved.
Thanks!!
Posted: Sat Nov 26, 2005 5:00 pm
by Klemen
In submit_ticket.php find this code:
Then change 10 to whatever number you want the ticket length to be. I wouldn't recommending setting it to less than 5 or 6.
Regards
Tickets Numbers Shortned
Posted: Tue Nov 29, 2005 8:03 pm
by jimmckenna
Klemen
many Thanks for that info. I'm finding hdesk very helpful as I set up a Help Desk for local school.
regards,
Jim
Problem with Ticket numbers duplicating each time
Posted: Mon Jan 16, 2006 11:56 pm
by lhgraphics
Does anyone know of a way to maybe add on the date to the actual ticket number that automatically gets created with each ticket that gets submitted?
Right now i am having a major problem with the ticket numbers that are automatically being created are using the same letters and numbers as other ticket numbers. When this happens, you have to go into MySQL and physically change the Ticket id to something different in order to even view the ticket.
So example. A ticket that was created yesterday had a ticket id of: 5P347GM3LV. Then another ticket that was created today is given the exact same ticket id. So i can only view the old ticket because of thise duplication problem.
I was thinking that maybe being able to add to the code and add the date of the ticket created to the actaul ticket id would solve this problem (ex: 5P347GM3LV01162006) this way you couldnt have duplicates?
Can someone help me with this problem ASAP? Its getting really frustrating.
Posted: Tue Jan 17, 2006 8:04 pm
by convert
mabye something like this:
$trackingID= date("Ymd") + $tmp; or
$trackingID= $tmp + date("Ymd");
Posted: Tue Jan 17, 2006 8:23 pm
by convert

WOOPS! That's not it.. this is EXACTLY how to do it:
Insert
Code: Select all
$trackingID= $trackingID .= date('Ymd');
right below
Code: Select all
/* Generate tracking ID */
$trackingID='';
for ($i=1;$i<=10;$i++) {
$tmp = substr('AEUYBDGHJLMNPQRSTVWXZ12345678', rand(1,29), 1);
$trackingID .= $tmp;
}
Then, you'll have to go into your database and adjust the field size from 10 to 18 for trackid.
That's it!
What file would i edit?
Posted: Wed Jan 18, 2006 2:12 am
by lhgraphics
Which of the files would i add that code to?
Posted: Wed Jan 18, 2006 4:13 pm
by convert
In the submit_tickets.php file.
Thank you so much! It worked
Posted: Wed Jan 18, 2006 8:57 pm
by lhgraphics
Thanks for all your help guys!
This is a great thing to add on to the program.
Thanks again

Posted: Thu Jan 19, 2006 12:35 am
by convert
Glad to here that it worked for you.... now if i could only get my help desk to work!!!

Posted: Fri Jun 22, 2007 10:18 pm
by Outpack
convert wrote:
Insert
Code: Select all
$trackingID= $trackingID .= date('Ymd');
right below
Code: Select all
/* Generate tracking ID */
$trackingID='';
for ($i=1;$i<=10;$i++) {
$tmp = substr('AEUYBDGHJLMNPQRSTVWXZ12345678', rand(1,29), 1);
$trackingID .= $tmp;
}
Then, you'll have to go into your database and adjust the field size from 10 to 18 for trackid.
That's it!
You mean?
Code: Select all
/* Generate tracking ID */
$trackingID='';
for ($i=1;$i<=10;$i++) {
$tmp = substr('AEUYBDGHJLMNPQRSTVWXZ12345678', rand(1,29), 1);
$trackingID .= $tmp;
$trackingID= $trackingID .= date('Ymd');
}
But Ihave this code (Version: 0.94):
Code: Select all
/* Generate tracking ID */
$useChars='AEUYBDGHJLMNPQRSTVWXZ123456789';
$trackingID = $useChars{mt_rand(0,29)};
for($i=1;$i<10;$i++)
{