Exemplo n.º 1
0
function get_all_venue_shifts($from, $to, $venue)
{
    if ($venue == "") {
        $all_shifts = get_all_shifts();
    } else {
        connect();
        $query = "SELECT * FROM dbShifts WHERE venue = '" . $venue . "'";
        $result = mysql_query($query);
        if ($result == null || mysql_num_rows($result) == 0) {
            mysql_close();
            return false;
        }
        $result = mysql_query($query);
        $all_shifts = array();
        while ($result_row = mysql_fetch_assoc($result)) {
            $shift = make_a_shift($result_row);
            $all_shifts[] = $shift;
        }
    }
    return $all_shifts;
}
Exemplo n.º 2
0
function get_all_shifts()
{
    connect();
    $query = "SELECT * FROM SHIFT";
    $result = mysql_query($query);
    if ($result == null || mysql_num_rows($result) == 0) {
        mysql_close();
        return false;
    }
    $shifts = [];
    while ($result_row = mysql_fetch_assoc($result)) {
        $shift = make_a_shift($result_row);
        $shifts[] = $shift;
    }
    return $shifts;
}