public static function send($message) { $usernames = array(); if (User::isNotAlone()) { //get a random username $receiver = User::getRandomUser(); global $link; //send message $sql = "INSERT INTO messages(message, sender, receiver) " . "VALUES(:message, :username, :receiver);"; $statement = $link->prepare($sql); $statement->bindParam(":message", $message, PDO::PARAM_STR); $statement->bindParam(":username", $_SESSION["username"], PDO::PARAM_STR); $statement->bindParam(":receiver", $receiver, PDO::PARAM_STR); $statement->execute(); $statement->closeCursor(); //remove bottle if (!User::isInfinite()) { User::removeBottle(); } } else { setNotification("There are no other accounts :(<br/>You are alone.."); } }
</div> <!-- app receive & response end --> <!-- app bottles begin --> <div id="bottles" class="interface"> <h1>//bottles</h1> <br/> <div id="bottles_content"> <h2>You have <?php //TODO rewrite this // ^ But why? if (User::isInfinite()) { echo "<span id='amount_of_bottles'>" . "infinite" . "</span>"; } else { echo "<span id='amount_of_bottles'>" . User::getBottlesAmount() . "</span>"; } ?> bottles.</h2> <p> Sorry but you can't buy bottles or do<br/> something in exchange for bottles in the alpha.<br/> You do however receive bottles every day.<br/> We can not guarrantee a certain time of the day. </p> </div>