예제 #1
0
파일: day.php 프로젝트: nicolas-san/GRRV4
    $type_session = 'no_session';
    $tplArray['typeSession'] = 'no_session';
} else {
    $type_session = 'with_session';
    $tplArray['typeSession'] = 'with_session';
}
$back = '';
if (isset($_SERVER['HTTP_REFERER'])) {
    $back = htmlspecialchars($_SERVER['HTTP_REFERER']);
}
Definition_ressource_domaine_site();
/* for plugins */
use Grr\Event\EntryEventClass;
use Grr\Event\DayEvent;
/* get id site by id area */
$id_site = mrbsGetAreaSite($area);
/* end plugins */
$tplArray['tplHeader'] = print_header($day, $month, $year, $type_session, false, false);
if (check_begin_end_bookings($day, $month, $year)) {
    showNoBookings($day, $month, $year, $back);
    exit;
}
if (authGetUserLevel(getUserName(), -1) < 1 && Settings::get('authentification_obli') == 1 || authUserAccesArea(getUserName(), $area) == 0) {
    showAccessDenied($back);
    exit;
}
if (Settings::get('verif_reservation_auto') == 0) {
    verify_confirm_reservation();
    verify_retard_reservation();
}
get_planning_area_values($area);
예제 #2
0
function find_user_room($id_room)
{
    $emails = array();
    $sql = "select email from " . TABLE_PREFIX . "_utilisateurs, " . TABLE_PREFIX . "_j_user_room\n\twhere " . TABLE_PREFIX . "_utilisateurs.login = "******"_j_user_room.login and id_room='" . $id_room . "'";
    $res = grr_sql_query($sql);
    if ($res) {
        for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
            if (validate_email($row[0])) {
                $emails[] = $row[0];
            }
        }
    }
    // Si la table des emails des gestionnaires de la ressource est vide, on avertit les administrateurs du domaine
    if (count($emails) == 0) {
        $id_area = mrbsGetAreaIdFromRoomId($id_room);
        $sql_admin = grr_sql_query("select email from " . TABLE_PREFIX . "_utilisateurs, " . TABLE_PREFIX . "_j_useradmin_area\n\t\t\twhere " . TABLE_PREFIX . "_utilisateurs.login = "******"_j_useradmin_area.login and " . TABLE_PREFIX . "_j_useradmin_area.id_area='" . $id_area . "'");
        if ($sql_admin) {
            for ($i = 0; $row = grr_sql_row($sql_admin, $i); $i++) {
                if (validate_email($row[0])) {
                    $emails[] = $row[0];
                }
            }
        }
    }
    // Si la table des emails des administrateurs du domaines est vide, on avertit les administrateurs des sites
    if (Settings::get("module_multisite") == "Oui") {
        if (count($emails) == 0) {
            $id_area = mrbsGetAreaIdFromRoomId($id_room);
            $id_site = mrbsGetAreaSite($id_area);
            $sql_admin = grr_sql_query("select email from " . TABLE_PREFIX . "_utilisateurs, " . TABLE_PREFIX . "_j_useradmin_site\n\t\t\t\twhere " . TABLE_PREFIX . "_utilisateurs.login = "******"_j_useradmin_site.login and " . TABLE_PREFIX . "_j_useradmin_site.id_site='" . $id_site . "'");
            if ($sql_admin) {
                for ($i = 0; $row = grr_sql_row($sql_admin, $i); $i++) {
                    if (validate_email($row[0])) {
                        $emails[] = $row[0];
                    }
                }
            }
        }
    }
    // Si la table des emails des administrateurs des sites est vide, on avertit les administrateurs générauxd
    if (count($emails) == 0) {
        $sql_admin = grr_sql_query("select email from " . TABLE_PREFIX . "_utilisateurs where statut = 'administrateur'");
        if ($sql_admin) {
            for ($i = 0; $row = grr_sql_row($sql_admin, $i); $i++) {
                if (validate_email($row[0])) {
                    $emails[] = $row[0];
                }
            }
        }
    }
    return $emails;
}