Can tracking IDs be shortened?
Moderator: mkoch227
Can tracking IDs be shortened?
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
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
-
- Posts: 2
- Joined: Fri Nov 25, 2005 7:38 pm
Tracking ID's shortned
Chris,
Like you I need to shorten the tracking ID's could you please publish how this is achieved.
Thanks!!
Like you I need to shorten the tracking ID's could you please publish how this is achieved.
Thanks!!
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
Code: Select all
for ($i=1;$i<=10;$i++) {
Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
-
- Posts: 2
- Joined: Fri Nov 25, 2005 7:38 pm
Tickets Numbers Shortned
Klemen
many Thanks for that info. I'm finding hdesk very helpful as I set up a Help Desk for local school.
regards,
Jim
many Thanks for that info. I'm finding hdesk very helpful as I set up a Help Desk for local school.
regards,
Jim
-
- Posts: 4
- Joined: Mon Jan 16, 2006 11:48 pm
Problem with Ticket numbers duplicating each time
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.
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
Josh
LightHouse Graphics & SameDayPrinter.com

Insert
Code: Select all
$trackingID= $trackingID .= date('Ymd');
Code: Select all
/* Generate tracking ID */
$trackingID='';
for ($i=1;$i<=10;$i++) {
$tmp = substr('AEUYBDGHJLMNPQRSTVWXZ12345678', rand(1,29), 1);
$trackingID .= $tmp;
}
That's it!
-
- Posts: 4
- Joined: Mon Jan 16, 2006 11:48 pm
What file would i edit?
Which of the files would i add that code to?
Sincerely,
Josh
LightHouse Graphics & SameDayPrinter.com
Josh
LightHouse Graphics & SameDayPrinter.com
-
- Posts: 4
- Joined: Mon Jan 16, 2006 11:48 pm
Thank you so much! It worked
Thanks for all your help guys!
This is a great thing to add on to the program.
Thanks again
This is a great thing to add on to the program.
Thanks again

Sincerely,
Josh
LightHouse Graphics & SameDayPrinter.com
Josh
LightHouse Graphics & SameDayPrinter.com
You mean?convert wrote: Insertright belowCode: Select all
$trackingID= $trackingID .= date('Ymd');
Then, you'll have to go into your database and adjust the field size from 10 to 18 for trackid.Code: Select all
/* Generate tracking ID */ $trackingID=''; for ($i=1;$i<=10;$i++) { $tmp = substr('AEUYBDGHJLMNPQRSTVWXZ12345678', rand(1,29), 1); $trackingID .= $tmp; }
That's it!
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');
}
Code: Select all
/* Generate tracking ID */
$useChars='AEUYBDGHJLMNPQRSTVWXZ123456789';
$trackingID = $useChars{mt_rand(0,29)};
for($i=1;$i<10;$i++)
{