/** * Adds a Price Class to the System * * The Function creates a new entry in the price_class Table * consisting of the given Data * * If 4 Params ar given, the ID will not be automatically incremented, but * will be the 4th param given * * @param name The name of the priceclass * @param GID The group-ID of the priceclass * @param price The price * @param ID The ID of the price class, this one is optional (else MySQL will autoincrement) */ function addPriceClass($name, $GID, $price, $pc_ID, $ID = '') { try { if (!$ID) { //nothing for ID given TableManager::addEntry('name', $name, 'GID', $GID, 'price', $price, 'pc_ID', $pc_ID); } else { TableManager::addEntry('name', $name, 'GID', $GID, 'price', $price, 'pc_ID', $pc_ID, 'ID', $ID); } } catch (Exception $e) { echo ERR_ADD_PRICECLASS; throw $e; } }
/** * Adds an order to the MySQL-orders-table * Enter description here ... * @param unknown_type $MID * @param unknown_type $UID * @param unknown_type $IP * @param unknown_type $date */ function addOrder($MID, $UID, $IP, $date) { parent::addEntry('MID', $MID, 'UID', $UID, 'IP', $IP, 'ordertime', date("Y-m-d h:i:s"), 'date', $date); }
/** * Adds a Meal * Adds a meal into the MySQL-meal-table based on the given parameters... * @param string $name * @param string $description * @param YYYY-MM-DD $date_conv * @param int $price_class * @param int $max_orders */ public function addMeal($name, $description, $date_conv, $price_class, $max_orders) { parent::addEntry('name', $name, 'description', $description, 'date', $date_conv, 'price_class', $price_class, 'max_orders', $max_orders); }
/** * Adds a User to the System * * The Function creates a new entry in the users Table * consisting of the given Data, and tests if the username already exists. * * @param ID The ID of the User * @param passwd The password of the user * @param name The lastname of the user * @param forename The forename of the User * @param birthday The birthday of the User * @param credit The initial credit of the User * @param GID The group the user belongs to * @param class The class the user belongs to * @return false if error */ function addUser($name, $forename, $username, $passwd, $birthday, $credit, $GID, $class) { try { //test if username already exists parent::getTableData('username = "******"'); } catch (MySQLVoidDataException $e) { //username does not exist parent::addEntry('name', $name, 'forename', $forename, 'username', $username, 'password', md5($passwd), 'birthday', $birthday, 'credit', $credit, 'GID', $GID, 'last_login', 'CURRENT_TIMESTAMP', 'login_tries', 0, 'first_passwd', 1, 'class', $class); return; } //username exists throw new Exception('The username already exists!'); }
/** * This function adds an entry to the card-table * Enter description here ... * @param numeric string $cardnumber The number of the card * @param numeric string $UID The User-id of the card */ function addCard($cardnumber, $UID) { parent::addEntry('cardnumber', $cardnumber, 'UID', $UID); }
/** * Adds a order to the soli_order-table * Enter description here ... * @param unknown_type $orderID * @param unknown_type $UID * @param unknown_type $IP * @param unknown_type $date * @param unknown_type $mealname * @param unknown_type $mealprice * @param unknown_type $mealdate * @param unknown_type $soliprice */ function addSoliOrder($orderID, $UID, $IP, $date, $mealname, $mealprice, $mealdate, $soliprice) { str_replace(',', '.', $soliprice); parent::addEntry('ID', $orderID, 'UID', $UID, 'IP', $IP, 'ordertime', date("Y-m-d h:i:s"), 'date', $date, 'mealname', $mealname, 'mealprice', $mealprice, 'mealdate', $mealdate, 'soliprice', $soliprice); }
function addGroup($groupname, $max_credit) { parent::addEntry('name', $groupname, 'max_credit', $max_credit); }