Summary
A PHP and MySQL based web application that manages collection and storage of prices for tombolas and provides lists for organized collocation of the prices for each customer.
Source code on request.
Main features:
- Managing customers
- Managing prices
- Managing storage locations
- Searching for customers by ID or name and displaying current status and prices won by the customer
- Handling the packing process: Automatic creation of packing-lists for the oldest unprocessed customer (allows for parallel work of multiple packers)
- Manipulating the database: adding tickets, creating a randomized connection of ticket numbers to prices, managing storage locations, resetting all tickets and customers
- Usable on touchscreen devices (mainly tablets)
Avoiding Double Occupancies
query_creators.php (snippet)
// Adds a customer and returns its CID
function addCustomer(mysqli $dbConnection, $customerName){
// Use a transaction to ensure retrieving the right customer ID
$dbConnection->begin_transaction();
// SQL query to Insert a new customer...
$dbConnection->query('INSERT INTO Kunden(Name) VALUES("' . $customerName . '");');
// ... and get its ID
$res = $dbConnection->query('SELECT LAST_INSERT_ID()');
// Execute transaction
$dbConnection->commit();
// Print errors
echo $dbConnection->error;
// Return Customer ID
return $res->fetch_array(MYSQLI_NUM)[0];
}