当前位置: 首页>>代码示例>>PHP>>正文


PHP grr_sql_count函数代码示例

本文整理汇总了PHP中grr_sql_count函数的典型用法代码示例。如果您正苦于以下问题:PHP grr_sql_count函数的具体用法?PHP grr_sql_count怎么用?PHP grr_sql_count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了grr_sql_count函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadSettings

/**
 * Load settings from the database
 *
 * Query all the settings
 * Fetch the result in the $grrSettings associative array
 *
 * Returns true if all went good, false otherwise
 *
 *
 * @return bool The settings are loaded
 */
function loadSettings()
{
    global $grrSettings;
    // Pour tenir compte du changement de nom de la table setting à partir de la version 1.8
    $test = grr_sql_query1("select NAME  from ".TABLE_PREFIX."_setting where NAME='version'");
    if ($test != -1)
       $sql = "select `NAME`, `VALUE` from ".TABLE_PREFIX."_setting";
    else
        $sql = "select `NAME`, `VALUE` from setting";
    $res = grr_sql_query($sql);
    if (! $res) return (false);
    if (grr_sql_count($res) == 0) {
        return (false);
    } else {
        for ($i = 0; ($row = grr_sql_row($res, $i)); $i++) {
            $grrSettings[$row[0]] = $row[1];
        }
        return (true);
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:settings.inc.php

示例2: load

 static function load()
 {
     $test = grr_sql_query1("SELECT NAME FROM " . TABLE_PREFIX . "_setting WHERE NAME='version'");
     if ($test != -1) {
         $sql = "SELECT `NAME`, `VALUE` FROM " . TABLE_PREFIX . "_setting";
     } else {
         $sql = "SELECT `NAME`, `VALUE` FROM setting";
     }
     $res = grr_sql_query($sql);
     if (!$res) {
         return false;
     }
     if (grr_sql_count($res) == 0) {
         return false;
     } else {
         for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
             self::$grrSettings[$row[0]] = $row[1];
         }
         return true;
     }
 }
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:21,代码来源:settings.class.php

示例3: jQuery_DatePicker

function jQuery_DatePicker($typeDate)
{
    if (@file_exists('../include/connect.inc.php')) {
        $racine = "../";
    } else {
        $racine = "./";
    }
    if ($typeDate == 'rep_end' && isset($_GET['id'])) {
        $res = grr_sql_query("SELECT repeat_id FROM " . TABLE_PREFIX . "_entry WHERE id=" . $_GET['id'] . ";");
        if (!$res) {
            fatal_error(0, grr_sql_error());
        }
        $repeat_id = implode('', grr_sql_row($res, 0));
        $res = grr_sql_query("SELECT rep_type, end_date, rep_opt, rep_num_weeks, start_time, end_time FROM " . TABLE_PREFIX . "_repeat WHERE id={$repeat_id}");
        if (!$res) {
            fatal_error(0, grr_sql_error());
        }
        if (grr_sql_count($res) == 1) {
            $row6 = grr_sql_row($res, 0);
            $date = date_parse(date("Y-m-d H:i:s", $row6[1]));
            $day = $date['day'];
            $month = $date['month'];
            $year = $date['year'];
        } else {
            if (isset($_GET['day'])) {
                $day = $_GET['day'];
            } else {
                $day = date("d");
            }
            if (isset($_GET['month'])) {
                $month = $_GET['month'];
            } else {
                $month = date("m");
            }
            if (isset($_GET['year'])) {
                $year = $_GET['year'];
            } else {
                $year = date("Y");
            }
        }
    } else {
        global $start_day, $start_month, $start_year, $end_day, $end_month, $end_year;
        if (isset($_GET['day'])) {
            $day = $_GET['day'];
        } else {
            $day = date("d");
        }
        if (isset($start_day) && $typeDate == 'start') {
            $day = $start_day;
        } elseif (isset($end_day) && $typeDate == 'end') {
            $day = $end_day;
        }
        if (isset($_GET['month'])) {
            $month = $_GET['month'];
        } else {
            $month = date("m");
        }
        if (isset($start_month) && $typeDate == 'start') {
            $month = $start_month;
        } elseif (isset($end_month) && $typeDate == 'end') {
            $month = $end_month;
        }
        if (isset($_GET['year'])) {
            $year = $_GET['year'];
        } else {
            $year = date("Y");
        }
        if (isset($start_year) && $typeDate == 'start') {
            $year = $start_year;
        } elseif (isset($end_year) && $typeDate == 'end') {
            $year = $end_year;
        }
    }
    genDateSelector("" . $typeDate . "_", "{$day}", "{$month}", "{$year}", "");
    echo '<input type="hidden" disabled="disabled" id="mydate_' . $typeDate . '">' . PHP_EOL;
    echo '<script>' . PHP_EOL;
    echo '	$(function() {' . PHP_EOL;
    echo '$.datepicker.setDefaults( $.datepicker.regional[\'fr\'] );' . PHP_EOL;
    echo '	$(\'#mydate_' . $typeDate . '\').datepicker({' . PHP_EOL;
    echo '		beforeShow: readSelected, onSelect: updateSelected,' . PHP_EOL;
    echo '		showOn: \'both\', buttonImageOnly: true, buttonImage: \'images/calendar.png\',buttonText: "Choisir la date"});' . PHP_EOL;
    echo '		function readSelected()' . PHP_EOL;
    echo '		{' . PHP_EOL;
    echo '			$(\'#mydate_' . $typeDate . '\').val($(\'#' . $typeDate . '_day\').val() + \'/\' +' . PHP_EOL;
    echo '			$(\'#' . $typeDate . '_month\').val() + \'/\' + $(\'#' . $typeDate . '_year\').val());' . PHP_EOL;
    echo '			return {};' . PHP_EOL;
    echo '		}' . PHP_EOL;
    echo '		function updateSelected(date)' . PHP_EOL;
    echo '		{' . PHP_EOL;
    echo '			$(\'#' . $typeDate . '_day\').val(date.substring(0, 2));' . PHP_EOL;
    echo '			$(\'#' . $typeDate . '_month\').val(date.substring(3, 5));' . PHP_EOL;
    echo '			$(\'#' . $typeDate . '_year\').val(date.substring(6, 10));' . PHP_EOL;
    echo '		}' . PHP_EOL;
    echo '	});' . PHP_EOL;
    echo '</script>' . PHP_EOL;
}
开发者ID:JeromeDevome,项目名称:GRR,代码行数:96,代码来源:functions.inc.php

示例4: verif_acces_ressource

 echo "</table>\n";
 echo "</td><td>\n";
 //This one has the rooms
 if (isset($id_area)) {
     $sql = "SELECT id, room_name, description, capacity, max_booking, statut_room from " . TABLE_PREFIX . "_room where area_id={$id_area} ";
     // on ne cherche pas parmi les ressources invisibles pour l'utilisateur
     $tab_rooms_noaccess = verif_acces_ressource(getUserName(), 'all');
     foreach ($tab_rooms_noaccess as $key) {
         $sql .= " and id != {$key} ";
     }
     $sql .= "order by order_display, room_name";
     $res = grr_sql_query($sql);
     if (!$res) {
         fatal_error(0, grr_sql_error());
     }
     if (grr_sql_count($res) != 0) {
         echo "<table class=\"table\">";
         for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
             $color = '';
             if ($row[5] == "0") {
                 $color = " class=\"texte_ress_tempo_indispo\"";
             }
             echo "<tr><td " . $color . ">" . htmlspecialchars($row[1]) . "<i> - " . htmlspecialchars($row[2]);
             if ($row[3] > 0) {
                 echo " ({$row['3']} max.)";
             }
             echo "</i></td>\n<td><a href=\"admin_edit_room.php?room={$row['0']}\"><img src=\"img_grr/edit_s.png\" alt=\"" . get_vocab('edit') . "\" title=\"" . get_vocab('edit') . "\" class=\"image\" /></a></td>\n";
             echo "<td><a href=\"admin_edit_room.php?room={$row['0']}&amp;action=duplique_room\"><img src=\"img_grr/duplique.png\" alt=\"" . get_vocab('duplique_ressource') . "\" title=\"" . get_vocab('duplique_ressource') . "\" class=\"image\" /></a></td>";
             echo "<td><a href=\"admin_room_del.php?type=room&amp;room={$row['0']}&amp;id_area={$id_area}\"><img src=\"img_grr/delete_s.png\" alt=\"" . get_vocab('delete') . "\" title=\"" . get_vocab('delete') . "\" class=\"image\" /></a></td>";
             echo "<td><a href='javascript:centrerpopup(\"view_rights_room.php?id_room={$row['0']}\",600,480,\"scrollbars=yes,statusbar=no,resizable=yes\")' title=\"" . get_vocab("privileges") . "\">\n\t\t\t\t\t\t<img src=\"img_grr/rights.png\" alt=\"" . get_vocab("privileges") . "\" class=\"image\" /></a></td>";
             echo "<td><a href='javascript:centrerpopup(\"view_room.php?id_room={$row['0']}\",600,480,\"scrollbars=yes,statusbar=no,resizable=yes\")' title=\"" . get_vocab("fiche_ressource") . "\">\n\t\t\t\t\t\t<img src=\"img_grr/details_s.png\" alt=\"d&eacute;tails\" class=\"image\" /></a></td>";
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_room.php

示例5: verif_acces_ressource

            //print '<option '.$selected.' value="'.$row[0].'">'.$row[1].'</option>'.PHP_EOL;
            $incrementForValidArea++;
        }
    }
}
//echo '</select>',PHP_EOL,'</div>',PHP_EOL,'</td>',PHP_EOL,'</tr>',PHP_EOL;
/*echo '<!-- ************* Ressources edition ***************** -->',PHP_EOL;
echo '<tr><td class="E"><b>'.get_vocab('rooms').get_vocab('deux_points')."</b></td></tr>\n";*/
$sql = 'SELECT id, room_name, description, capacity FROM ' . TABLE_PREFIX . "_room WHERE area_id={$area_id} ";
$tab_rooms_noaccess = verif_acces_ressource(getUserName(), 'all');
foreach ($tab_rooms_noaccess as $key) {
    $sql .= " and id != {$key} ";
}
$sql .= ' ORDER BY order_display,room_name';
$res = grr_sql_query($sql);
$len = grr_sql_count($res);
$tplArrayEditEntry['longeurListeRessourcesMax'] = min($longueur_liste_ressources_max, $len);
/*echo '<tr><td class="CL" style="vertical-align:top;"><table border="0"><tr><td><select name="rooms[]" size="'.min($longueur_liste_ressources_max, $len).'" multiple="multiple">';*/
//Sélection de la "room" dans l'"area"
if ($res) {
    for ($i = 0; $row = grr_sql_row($res, $i); ++$i) {
        /*var_dump($row);echo "<br>";*/
        $tplArrayEditEntry['rooms'][$i]['0'] = $row[0];
        $tplArrayEditEntry['rooms'][$i]['1'] = $row[1];
        $tplArrayEditEntry['rooms'][$i]['capacity'] = $row[3];
        $tplArrayEditEntry['rooms'][$i]['desc'] = $row[2];
        $selected = '';
        if ($row[0] == $room_id) {
            //$selected = 'selected="selected"';
            $tplArrayEditEntry['rooms'][$i]['selected'] = true;
        } else {
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:edit_entry.php

示例6: mrbsGetEntryInfo

function mrbsGetEntryInfo($id)
{
    $sql = "SELECT start_time, end_time, entry_type, repeat_id, room_id,
                   timestamp, beneficiaire, name, type, description
           FROM ".TABLE_PREFIX."_entry
           WHERE id = '".$id."'";
    $res = grr_sql_query($sql);
   if (! $res)
     return;

   $ret = '';
    if(grr_sql_count($res) > 0)
    {
        $row = grr_sql_row($res, 0);

        $ret["start_time"]  = $row[0];
        $ret["end_time"]    = $row[1];
        $ret["entry_type"]  = $row[2];
        $ret["repeat_id"]   = $row[3];
        $ret["room_id"]     = $row[4];
        $ret["timestamp"]   = $row[5];
        $ret["beneficiaire"]   = $row[6];
        $ret["name"]        = $row[7];
        $ret["type"]        = $row[8];
        $ret["description"] = $row[9];

    }
    grr_sql_free($res);

    return $ret;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:mrbs_sql.inc.php

示例7: die

        $grrSettings['ldap_champ_email'] = $_POST['ldap_champ_email'];
        if (!Settings::set("se3_liste_groupes_autorises", $_POST['se3_liste_groupes_autorises'])) {
            echo "Erreur lors de l'enregistrement de se3_liste_groupes_autorises !<br />";
        }
        $grrSettings['se3_liste_groupes_autorises'] = $_POST['se3_liste_groupes_autorises'];
    }
}
//Chargement des valeurs de la table settingS
if (!Settings::load()) {
    die("Erreur chargement settings");
}
if (isset($_POST['submit'])) {
    if (isset($_POST['login']) && isset($_POST['password'])) {
        $sql = "select upper(login) login, password, prenom, nom, statut from " . TABLE_PREFIX . "_utilisateurs where login = '" . $_POST['login'] . "' and password = md5('" . $_POST['password'] . "') and etat != 'inactif' and statut='administrateur' ";
        $res_user = grr_sql_query($sql);
        $num_row = grr_sql_count($res_user);
        if ($num_row == 1) {
            $valid = 'yes';
        } else {
            $message = get_vocab("wrong_pwd");
        }
    }
}
if (!grr_resumeSession() && $valid != 'yes') {
    ?>
	<!doctype html>
	<html>
		<head>
			<link rel="stylesheet" href="style.css" type="text/css">
			<title> grr </title>
			<link rel="shortcut icon" href="./favicon.ico">
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_config_ldap.php

示例8: get_vocab

 echo '</div>' . PHP_EOL;
 if (isset($_GET['precedent'])) {
     if ($_GET['pview'] == 1 && $_GET['precedent'] == 1) {
         echo '<span id="lienPrecedent"><button class="btn btn-default btn-xs" onclick="charger();javascript:history.back();">Précedent</button></span>' . PHP_EOL;
     }
 }
 echo '<div class="contenu_planning">' . PHP_EOL;
 echo '<table class="table-bordered table-striped">' . PHP_EOL;
 echo '<tr>' . PHP_EOL . '<th style="width:5%;">' . PHP_EOL;
 if ($enable_periods == 'y') {
     echo get_vocab("period");
 } else {
     echo get_vocab("time");
 }
 echo '</th>' . PHP_EOL;
 $room_column_width = (int) (90 / grr_sql_count($res));
 $nbcol = 0;
 $rooms = array();
 $a = 0;
 for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
     $id_room[$i] = $row['2'];
     $nbcol++;
     if (verif_acces_ressource(getUserName(), $id_room[$i])) {
         $room_name[$i] = $row['0'];
         $statut_room[$id_room[$i]] = $row['4'];
         $statut_moderate[$id_room[$i]] = $row['7'];
         $acces_fiche_reservation = verif_acces_fiche_reservation(getUserName(), $id_room[$i]);
         if ($row['1'] && $_GET['pview'] != 1) {
             $temp = '<br /><span class="small">(' . $row['1'] . ' ' . ($row['1'] > 1 ? get_vocab("number_max2") : get_vocab("number_max")) . ')</span>' . PHP_EOL;
         } else {
             $temp = '';
开发者ID:swirly,项目名称:GRR,代码行数:31,代码来源:day.php

示例9: grr_sql_query

$sql = 'SELECT room_name, capacity, id, description, statut_room FROM ' . TABLE_PREFIX . "_room WHERE area_id='" . $area . "' ORDER BY order_display, room_name";
$res = grr_sql_query($sql);
if (isset($_GET['precedent'])) {
    if ($_GET['pview'] == 1 && $_GET['precedent'] == 1) {
        $tplArray['precedant'] = true;
        /*echo '<span id="lienPrecedent">'.PHP_EOL;
          echo '<button class="btn btn-default btn-xs" onclick="charger();javascript:history.back();">Précedent</button>'.PHP_EOL;
          echo '</span>'.PHP_EOL;*/
    } else {
        $tplArray['precedant'] = false;
    }
}
if (!$res) {
    fatal_error(0, grr_sql_error());
}
if (grr_sql_count($res) == 0) {
    $tplArray['roomForArea'] = false;
    $tplArray['vocab']['no_rooms_for_area'] = get_vocab('no_rooms_for_area');
    /*echo '<h1>',get_vocab('no_rooms_for_area'),'</h1>';*/
    grr_sql_free($res);
} else {
    $tplArray['vocab']['all_rooms'] = get_vocab('all_rooms');
    $tplArray['vocab']['weekbefore'] = get_vocab('weekbefore');
    $tplArray['vocab']['weekafter'] = get_vocab('weekafter');
    $tplArray['roomForArea'] = true;
    //DEBUT HTML
    /*echo '<div class="row">'.PHP_EOL;*/
    include 'menu_gauche.php';
    /**
     * todo voir pour transformer ces includes en fonction ? Vérifier portée des var par rapport à l'include
     * menu gauche crée la var tplArrayMenuGauche
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:day.php

示例10: grr_sql_query

 $req_area = "SELECT id, area_name, access FROM " . TABLE_PREFIX . "_area ORDER BY order_display";
 $res_area = grr_sql_query($req_area);
 if ($res_area) {
     for ($i = 0; $row_area = grr_sql_row($res_area, $i); $i++) {
         $test_admin = grr_sql_query1("SELECT count(id_area) FROM " . TABLE_PREFIX . "_j_useradmin_area j where j.login = '" . $user_login . "' and j.id_area='" . $row_area[0] . "'");
         if ($test_admin >= 1) {
             $is_admin = 'y';
         } else {
             $is_admin = 'n';
         }
         $nb_room = grr_sql_query1("SELECT count(r.room_name) FROM " . TABLE_PREFIX . "_room r\n\t\t\t\t\tleft join " . TABLE_PREFIX . "_area a on r.area_id=a.id\n\t\t\t\t\twhere a.id='" . $row_area[0] . "'");
         $req_room = "SELECT r.room_name FROM " . TABLE_PREFIX . "_room r\n\t\t\t\tleft join " . TABLE_PREFIX . "_j_user_room j on r.id=j.id_room\n\t\t\t\tleft join " . TABLE_PREFIX . "_area a on r.area_id=a.id\n\t\t\t\twhere j.login = '" . $user_login . "' and a.id='" . $row_area[0] . "'";
         $res_room = grr_sql_query($req_room);
         $is_gestionnaire = '';
         if ($res_room) {
             if (grr_sql_count($res_room) == $nb_room && $nb_room != 0) {
                 $is_gestionnaire = $vocab["all_rooms"];
             } else {
                 for ($j = 0; $row_room = grr_sql_row($res_room, $j); $j++) {
                     $is_gestionnaire .= $row_room[0] . "<br />";
                 }
             }
         }
         $req_mail = "SELECT r.room_name from " . TABLE_PREFIX . "_room r\n\t\t\t\tleft join " . TABLE_PREFIX . "_j_mailuser_room j on r.id=j.id_room\n\t\t\t\tleft join " . TABLE_PREFIX . "_area a on r.area_id=a.id\n\t\t\t\twhere j.login = '" . $user_login . "' and a.id='" . $row_area[0] . "'";
         $res_mail = grr_sql_query($req_mail);
         $is_mail = '';
         if ($res_mail) {
             for ($j = 0; $row_mail = grr_sql_row($res_mail, $j); $j++) {
                 $is_mail .= $row_mail[0] . "<br />";
             }
         }
开发者ID:Birssan,项目名称:GRR,代码行数:31,代码来源:admin_user_modify.php

示例11: header

     header('Location: ' . Settings::get("grr_url"));
 }
 $sql = "SELECT * FROM " . TABLE_PREFIX . "_entry WHERE id='" . $id . "'";
 $res = grr_sql_query($sql);
 if (!$res) {
     fatal_error(0, grr_sql_error());
 }
 $row = grr_sql_row($res, 0);
 $sql = "SELECT room_name FROM " . TABLE_PREFIX . "_room WHERE id='" . $row[5] . "'";
 $res = grr_sql_query($sql);
 $row2 = grr_sql_row($res, 0);
 $res2 = grr_sql_query("SELECT rep_type, end_date, rep_opt, rep_num_weeks, start_time, end_time FROM " . TABLE_PREFIX . "_repeat WHERE id={$row['4']}");
 if (!$res2) {
     fatal_error(0, grr_sql_error());
 }
 if (grr_sql_count($res2) == 1) {
     $row6 = grr_sql_row($res2, 0);
     $rep_type = $row6[0];
     $rep_end_date = utf8_strftime($dformat, $row6[1]);
     $rep_opt = $row6[2];
     $rep_num_weeks = $row6[3];
     $start_time = $row6[4];
     $end_time = $row6[5];
     $duration = $row6[5] - $row6[4];
 }
 if ($row[4] != 0) {
     $period = 1;
 } else {
     $period = 0;
 }
 include 'pdf/form_infoPDF.html';
开发者ID:Birssan,项目名称:GRR,代码行数:31,代码来源:pdfgenerator.php

示例12: grr_opensession

/**
 * Open a new session
 *
 * Check the provided login and password
 * Register data from the database to the session cookie
 * Log the session
 *
 * Returns 1 if login succeeded, >= 1 otherwise
 *
 * @param string _login
 * @param string _password
 * @return string
 */
function grr_opensession($_login, $_password, $_user_ext_authentifie = '', $tab_login = array(), $tab_groups = array())
{
    // Initialisation de $auth_ldap
    $auth_ldap = 'no';
    // Initialisation de $auth_imap
    $auth_imap = 'no';
    // Initialisation de $est_authentifie_sso
    $est_authentifie_sso = FALSE;
    if ($_user_ext_authentifie != '') {
        $est_authentifie_sso = TRUE;
        // Statut par défaut
        $_statut = "";
        $sso = Settings::get("sso_statut");
        if ($sso == "cas_visiteur") {
            $_statut = "visiteur";
        } else {
            if ($sso == "cas_utilisateur") {
                $_statut = "utilisateur";
            } else {
                if ($sso == "lemon_visiteur") {
                    $_statut = "visiteur";
                } else {
                    if ($sso == "lemon_utilisateur") {
                        $_statut = "utilisateur";
                    } else {
                        if ($sso == "http_visiteur") {
                            $_statut = "visiteur";
                        } else {
                            if ($sso == "http_utilisateur") {
                                $_statut = "utilisateur";
                            } else {
                                if ($sso == "lasso_visiteur") {
                                    $_statut = "visiteur";
                                } else {
                                    if ($sso == "lasso_utilisateur") {
                                        $_statut = "utilisateur";
                                    } else {
                                        if ($sso == "lcs") {
                                            if ($_user_ext_authentifie == "lcs_eleve") {
                                                $_statut = Settings::get("lcs_statut_eleve");
                                            }
                                            if ($_user_ext_authentifie == "lcs_non_eleve") {
                                                $_statut = Settings::get("lcs_statut_prof");
                                            }
                                            $temoin_grp_ok = "non";
                                            if (trim(Settings::get("lcs_liste_groupes_autorises")) == "") {
                                                $temoin_grp_ok = "oui";
                                            } else {
                                                $tab_grp_autorise = explode(";", Settings::get("lcs_liste_groupes_autorises"));
                                                $tot = count($tab_grp_autorise);
                                                for ($i = 0; $i < $tot; $i++) {
                                                    if (in_array($tab_grp_autorise[$i], $tab_groups)) {
                                                        $temoin_grp_ok = "oui";
                                                    }
                                                }
                                            }
                                            // Si l'utilisateur n'appartient pas aux groupes LCS autorisés
                                            if ($temoin_grp_ok != 'oui') {
                                                return "5";
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        $sql = "SELECT upper(login) login, password, prenom, nom, statut, now() start, default_area, default_room, default_style, default_list_type, default_language, source, etat, default_site\n\t\tfrom " . TABLE_PREFIX . "_utilisateurs\n\t\twhere login = '" . protect_data_sql($_login) . "' and ";
        if ($_user_ext_authentifie != 'lasso') {
            $sql .= " password = '' and ";
        }
        $sql .= " etat != 'inactif'";
        $res_user = grr_sql_query($sql);
        $num_row = grr_sql_count($res_user);
        if ($num_row == 1) {
            // L'utilisateur est présent dans la base locale
            if ($sso == "lcs") {
                // Mise à jour des données
                $nom_user = $tab_login["nom"];
                $email_user = $tab_login["email"];
                $prenom_user = $tab_login["fullname"];
                // On met à jour
                $sql = "UPDATE " . TABLE_PREFIX . "_utilisateurs SET\n\t\t\t\tnom='" . protect_data_sql($nom_user) . "',\n\t\t\t\tprenom='" . protect_data_sql($prenom_user) . "',\n\t\t\t\temail='" . protect_data_sql($email_user) . "'\n\t\t\t\twhere login='" . protect_data_sql($_login) . "'";
            } else {
                if ($_user_ext_authentifie == "cas") {
//.........这里部分代码省略.........
开发者ID:JeromeDevome,项目名称:GRR,代码行数:101,代码来源:session.inc.php

示例13: header

    die;
}
if ($unicode_encoding) {
    header("Content-Type: text/html;charset=utf-8");
} else {
    header("Content-Type: text/html;charset=" . $charset_html);
}
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
if (authGetUserLevel(getUserName(), -1) < 2) {
    showAccessDenied("");
    exit;
}
$sql = "SELECT nom, login, etat, statut FROM " . TABLE_PREFIX . "_utilisateurs WHERE  (login='" . $identifiant_beneficiaire . "')";
$res = grr_sql_query($sql);
if ($res) {
    $nb_result = grr_sql_count($res);
    if ($nb_result > 1) {
        echo "<span class=\"avertissement\">Plusieurs utilisateur ont le même identifiants que l'utilisateur ci-dessus. Signalez ce problème à l'administrateur.</span>";
    } else {
        if ($nb_result == 1) {
            $row = grr_sql_row($res, 0);
            if ($row[2] == 'inactif') {
                echo "<span class=\"avertissement\">" . get_vocab('utilisateur_rendu_inactif') . get_vocab('login') . get_vocab('deux_points') . $row[1] . "</span>";
            } else {
                if ($row[3] == 'visiteur') {
                    echo "<span class=\"avertissement\">" . get_vocab('utilisateur_simple_visiteur') . get_vocab('login') . get_vocab('deux_points') . $row[1] . "</span>";
                }
            }
        } else {
            if ($nb_result == 0) {
                if ($identifiant_beneficiaire != "") {
开发者ID:Birssan,项目名称:GRR,代码行数:31,代码来源:edit_entry_beneficiaire.php

示例14: grr_sql_command

        grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_room WHERE id={$room}");
        //Go back to the admin page
        header("Location: admin_room.php?id_area={$id_area}&id_site={$id_site}");
        die;
    } else {
        //print the page header
        print_header("", "", "", $type = "with_session");
        echo "<div class=\"page_sans_col_gauche\">";
        //We tell them how bad what theyre about to do is
        //Find out how many appointments would be deleted
        $sql = "SELECT name, start_time, end_time FROM " . TABLE_PREFIX . "_entry WHERE room_id={$room}";
        $res = grr_sql_query($sql);
        if (!$res) {
            echo grr_sql_error();
        } else {
            if (grr_sql_count($res) > 0) {
                echo get_vocab("deletefollowing") . ":<ul>";
                for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
                    echo "<li>{$row['0']} (";
                    echo time_date_string($row[1], $dformat) . " -> ";
                    echo time_date_string($row[2], $dformat) . ")";
                }
                echo "</ul>";
            }
        }
        echo "<h1 style=\"text-align:center;\">" . get_vocab("sure") . "</h1>";
        echo "<h1 style=\"text-align:center;\"><a href=\"admin_room_del.php?type=room&amp;room={$room}&amp;confirm=Y&amp;id_area={$id_area}\">" . get_vocab("YES") . "!</a>     <a href=\"admin_room.php?id_area={$id_area}\">" . get_vocab("NO") . "!</a></h1>";
        echo "</div>";
    }
}
if ($type == "area") {
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_room_del.php

示例15: grr_sql_query1

        // On teste si l'utilisateur administre le domaine
        $test_admin = grr_sql_query1("select count(id_area) from ".TABLE_PREFIX."_j_useradmin_area j where j.login = '".$user_login."' and j.id_area='".$row_area[0]."'");
        if ($test_admin >= 1) $is_admin = 'y'; else $is_admin = 'n';
        // On teste si l'utilisateur gère des ressources dans ce domaine
        $nb_room = grr_sql_query1("select count(r.room_name) from ".TABLE_PREFIX."_room r
        left join ".TABLE_PREFIX."_area a on r.area_id=a.id
        where a.id='".$row_area[0]."'");

        $req_room = "select r.room_name from ".TABLE_PREFIX."_room r
        left join ".TABLE_PREFIX."_j_user_room j on r.id=j.id_room
        left join ".TABLE_PREFIX."_area a on r.area_id=a.id
        where j.login = '".$user_login."' and a.id='".$row_area[0]."'";
        $res_room = grr_sql_query($req_room);
        $is_gestionnaire = '';
        if ($res_room) {
            if ((grr_sql_count($res_room) == $nb_room) and ($nb_room!=0))
                $is_gestionnaire = $vocab["all_rooms"];
            else
            for ($j = 0; ($row_room = grr_sql_row($res_room, $j)); $j++) {
                $is_gestionnaire .= $row_room[0]."<br />";
            }
        }
        // On teste si l'utilisateur reçoit des mails automatiques
        $req_mail = "select r.room_name from ".TABLE_PREFIX."_room r
        left join ".TABLE_PREFIX."_j_mailuser_room j on r.id=j.id_room
        left join ".TABLE_PREFIX."_area a on r.area_id=a.id
        where j.login = '".$user_login."' and a.id='".$row_area[0]."'";
        $res_mail = grr_sql_query($req_mail);
        $is_mail = '';
        if ($res_mail) {
            for ($j = 0; ($row_mail = grr_sql_row($res_mail, $j)); $j++) {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:admin_user_modify.php


注:本文中的grr_sql_count函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。