<?php
class Poste {
    public static function getPostesByIP($ip = null) {
        if(is_null($ip)){
            $ip = $_SERVER["REMOTE_ADDR"];
        }
        $query = "SELECT * FROM postes WHERE IP=:ip";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":ip", $ip);
        $statement->execute();
        return $statement->fetch();
    }
}