how to custom trackingID or ID like :
(companyName_fourRandomDigits_customerID)
companyName_customerID_date_Autonumber
e.g
Oracle_345_20070106_0001
Tracking ID or ID
Moderator: mkoch227
Re: Tracking ID or ID
To Change your Hesk ID you need to modify /inc/common.inc.php
around line 158 you will find
Change that around to your liking.
Mine looks like this
around line 158 you will find
Code: Select all
/* Generate the ID */
$trackingID = '';
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= '-';
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= '-';
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
$trackingID .= $useChars[mt_rand(0,29)];
Mine looks like this
Code: Select all
/* Generate the ID */
$trackingID = '';
$trackingID .= date(Y);
$trackingID .= '-';
$trackingID .= date(m);
$trackingID .= '-';
$trackingID .= date(d);
$trackingID .= '-';
$trackingID .= mt_rand(0,9);
$trackingID .= mt_rand(0,9);
-Steve
Re: Tracking ID or ID
Just a note: using this method could possibly lead to duplicate ticket IDs being generated.
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
Re: Tracking ID or ID
Actually, just two tickets might be enough to get a duplicate.
The will randomly generate a digit from 0 - 9. This is the only random part of your ticket ID for a given day.
You use two random digits so have 100 possible combinations. This means you have a 1% chance that the second generated ID will be the same as the first one.
If you receive on average 2 tickets per day that means you will have on average 1 duplicate every 100 days. If you receive 10 tickets per day you will have a duplicate on average once per 10 days.
The
Code: Select all
mt_rand(0,9);
You use two random digits so have 100 possible combinations. This means you have a 1% chance that the second generated ID will be the same as the first one.
If you receive on average 2 tickets per day that means you will have on average 1 duplicate every 100 days. If you receive 10 tickets per day you will have a duplicate on average once per 10 days.
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
Re: Tracking ID or ID
Very interesting, so I guess the solution would be to add another random digit to the end, that would substantially lower the odds of duplicates?
-Steve
Re: Tracking ID or ID
That would make it a 0,1% possibility.
However, another important thing you have to consider is privacy and security of your customer's information.
A random ID actually serves as a password as it has millions and millions of possible combinations and is extremely hard to just guess. Your tracking ID on the other hand is easy to guess - all I need to do is try 100 possible combinations for a date and I will have access to a ticket submitted by another customer and possibly sensitive information within the ticket.
However, another important thing you have to consider is privacy and security of your customer's information.
A random ID actually serves as a password as it has millions and millions of possible combinations and is extremely hard to just guess. Your tracking ID on the other hand is easy to guess - all I need to do is try 100 possible combinations for a date and I will have access to a ticket submitted by another customer and possibly sensitive information within the ticket.
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
Re: Tracking ID or ID
Thanks for the heads up!
I have disabled the customer interface, the only way to view a ticket is to have a user login. So for my purposes ill take the 0,1% probability.
Going forward, Ill be sure to mention the security risk involved in my method.
I have disabled the customer interface, the only way to view a ticket is to have a user login. So for my purposes ill take the 0,1% probability.
Going forward, Ill be sure to mention the security risk involved in my method.
-Steve