Ticket Id's
-
I would like to change the random Ticket Id numbers to Sequential Numbers.
E.G 001,002,003 for the benifit of the customer how would I go this.Im not great with functions so I would need to change
function getRandomTicketId() {
$query = “SELECT ticketid FROM" . jssupportticket::$_db->prefix . "js_ticket_tickets
“;
do {
$ticketid = “”;
$length = 9;
$possible = “2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ”;
// we refer to the length of $possible a few times, so let’s grab it now
$maxlength = strlen($possible);
if ($length > $maxlength) { // check for length overflow and truncate if necessary
$length = $maxlength;
}
// set up a counter for how many characters are in the ticketid so far
$i = 0;
// add random characters to $password until $length is reached
while ($i < $length) {
// pick a random character from the possible ones
$char = substr($possible, mt_rand(0, $maxlength – 1), 1);
if (!strstr($ticketid, $char)) {
if ($i == 0) {
if (ctype_alpha($char)) {
$ticketid .= $char;
$i++;
}
} else {
$ticketid .= $char;
$i++;
}
}
}
$rows = jssupportticket::$_db->get_results($query);
foreach ($rows as $row) {
if ($ticketid == $row->ticketid)
$match = ‘Y’;
else
$match = ‘N’;
}
}while ($match == ‘Y’);
return $ticketid;
}But with what?
- The topic ‘Ticket Id's’ is closed to new replies.