/** * returns all orders of a meal at givne date * @param numberic_string $ID the ID of the meal whose orders to return * @param date the date * @return array of orders */ function getAllOrdersOfMealAtDate($ID, $date) { return parent::getTableData(sprintf('MID = "%s" AND date = "' . $date . '" ORDER BY date', $ID, $date)); }
public function setColor($pc_ID, $color) { try { $ids = TableManager::getTableData(sprintf("pc_ID=%s", $pc_ID)); foreach ($ids as &$id) { TableManager::alterEntry($id['ID'], 'color', $color); } } catch (Exception $e) { echo "Error getting priceclass: " . $e->getMessage(); die; } }
/** * returns the Orders that are dated [mealdate] between the first and the second Date * Format can be timestamp or YYYY-MM-DD */ function getOrdersBetMealdate($startdate, $enddate) { ///@todo sicher das Timestamp hier von MySQL automatisch konvertiert wird? return parent::getTableData(sprintf('mealdate BETWEEN %s AND %s', $startdate, $enddate)); }
function getClassByUsername($username) { $user = parent::getTableData('username="******"'); return $user[0]['class']; }
function getPriceClassName($pc_ID) { try { $pcn = TableManager::getTableData(sprintf("pc_ID=%s LIMIT 1", $pc_ID)); } catch (Exception $e) { echo "Error getting priceclass: " . $e->getMessage(); die; } return $pcn; }