Can tracking IDs be shortened?

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Chris

Can tracking IDs be shortened?

Post 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
Chris

Post by Chris »

Never mind, I figured it out. Sorry to bother you!
jimmckenna
Posts: 2
Joined: Fri Nov 25, 2005 7:38 pm

Tracking ID's shortned

Post by jimmckenna »

Chris,

Like you I need to shorten the tracking ID's could you please publish how this is achieved.

Thanks!!
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

In submit_ticket.php find this code:

Code: Select all

for ($i=1;$i<=10;$i++) {
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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
jimmckenna
Posts: 2
Joined: Fri Nov 25, 2005 7:38 pm

Tickets Numbers Shortned

Post 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
lhgraphics
Posts: 4
Joined: Mon Jan 16, 2006 11:48 pm

Problem with Ticket numbers duplicating each time

Post 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.
Sincerely,

Josh
LightHouse Graphics & SameDayPrinter.com
convert
Posts: 25
Joined: Fri Jan 13, 2006 9:48 pm

Post by convert »

mabye something like this:

$trackingID= date("Ymd") + $tmp; or

$trackingID= $tmp + date("Ymd");
convert
Posts: 25
Joined: Fri Jan 13, 2006 9:48 pm

Post by convert »

:shock: 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!
lhgraphics
Posts: 4
Joined: Mon Jan 16, 2006 11:48 pm

What file would i edit?

Post by lhgraphics »

Which of the files would i add that code to?
Sincerely,

Josh
LightHouse Graphics & SameDayPrinter.com
convert
Posts: 25
Joined: Fri Jan 13, 2006 9:48 pm

Post by convert »

In the submit_tickets.php file.
lhgraphics
Posts: 4
Joined: Mon Jan 16, 2006 11:48 pm

Thank you so much! It worked

Post by lhgraphics »

Thanks for all your help guys!

This is a great thing to add on to the program.

Thanks again :D
Sincerely,

Josh
LightHouse Graphics & SameDayPrinter.com
convert
Posts: 25
Joined: Fri Jan 13, 2006 9:48 pm

Post by convert »

Glad to here that it worked for you.... now if i could only get my help desk to work!!! :lol:
Outpack
Posts: 23
Joined: Sat Jun 02, 2007 1:34 am

Post 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++)
{
Post Reply