/** * Load all users as an array of users represented as objects. * * @param int $company_id * @param boolean $dormant * @return array */ public static function getAllUsers() { global $Conf; $r = mysqli_result; $users = array(); $tA = $Conf["data"]->UserTable; myDBC::new_andWhere(); $q = "SELECT * FROM {$tA}" . myDBC::get_andWhere(); myDBC::stdQuery($q, $r); while ($r = $r->fetch_object()) { $users[] = $r; } return $users; }
/** * Get the order's discount amount. * * @param int $CartID * @return float */ static function get_OrderDiscount($CartID) { global $Conf; myDBC::new_andWhere(); myDBC::andWhere("`CartID` = {$CartID}"); $query = "SELECT `promoDiscount` FROM {$Conf["data"]->ShipTable} " . myDBC::get_andWhere() . " LIMIT 1"; myDBC::stdQuery($query, $result); $row = mysqli_fetch_object($result); return $row->promoDiscount; }