Ejemplo n.º 1
0
function provaCountBilhete($tipoBilhete)
{
    if ($tipoBilhete == "C") {
        $fields = "lugares_vendidos";
    } else {
        if ($tipoBilhete == "R") {
            $fields = "lugares_reservados";
        } else {
            $fields = "lugares_vendidos + lugares_reservados";
        }
    }
    $e = getTableSelected("provas_total", array("SUM(" . $fields . ") AS total"), "status <> 'X'", "");
    $row = forEachRow($e);
    return $row['total'];
}
Ejemplo n.º 2
0
function getTable($table, $where, $orderBy)
{
    return getTableSelected($table, array('*'), $where, $orderBy);
}