Compare commits
6 Commits
63092ac070
...
b841037130
| Author | SHA1 | Date | |
|---|---|---|---|
| b841037130 | |||
| 6b89a14a47 | |||
| d0c889a594 | |||
| ab0edd1325 | |||
| d295d64f85 | |||
| d6603d07f2 |
@@ -333,7 +333,12 @@ if ($existing) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// No existing ticket — create a new one
|
// No existing ticket — create a new one
|
||||||
$ticket_id = sprintf('%09d', mt_rand(1, 999999999));
|
// Use random_int range 100000000-999999999 to avoid leading-zero IDs
|
||||||
|
try {
|
||||||
|
$ticket_id = (string)random_int(100000000, 999999999);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$ticket_id = (string)mt_rand(100000000, 999999999);
|
||||||
|
}
|
||||||
$insertStmt = $conn->prepare(
|
$insertStmt = $conn->prepare(
|
||||||
"INSERT INTO tickets (ticket_id, title, description, status, priority, category, type, hash, created_by)
|
"INSERT INTO tickets (ticket_id, title, description, status, priority, category, type, hash, created_by)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"
|
||||||
|
|||||||
Reference in New Issue
Block a user