noalyss Version-9
direct.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20/**
21 * @file
22 * @brief used by the autocomplete feature of the Direct Access
23 */
24require_once '../include/constant.php';
25require_once NOALYSS_INCLUDE.'/class/database.class.php';
26require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
27require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
28MaintenanceMode("block.html");
29
31global $g_user;
32$http=new \HttpInput();
33$g_user=new Noalyss_user($cn);
34$g_user->Check();
35$g_user->check_dossier($http->get('gDossier'));
36$res=$cn->exec_sql("select distinct code,description from get_profile_menu($1) where code ~* $2 or description ~* $2 order by code limit 5 ",array($g_user->get_profile(),$http->post("acs")));
38 echo "<ul>";
40for ($i = 0;$i< $nb;$i++)
41{
43 echo "<li>";
44 echo $row['code'];
45 echo '<span class="informal"> '._($row['description']??"").'</span></li>';
46}
47 echo "</ul>";
48if ( $nb == 0 ) {
49 echo _('Aucune correspondance');
50}
51?>
MaintenanceMode($p_file)
When you want to prevent users to connect, create a file in noalyss/ (NOALYSS_BASE) with the message ...
Definition: ac_common.php:1663
set_language()
set the lang thanks the _SESSION['g_lang'] var.
Definition: ac_common.php:754
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
static connect()
$cn
Definition: direct.php:30
$res
Definition: direct.php:36
$nb
Definition: direct.php:37
$http
Definition: direct.php:32
global $g_user
Definition: direct.php:31