noalyss
Version-9
include
ajax
ajax_auto_anc_card.php
Go to the documentation of this file.
1
<?php
2
//This file is part of NOALYSS and is under GPL
3
//see licence.txt
4
/**
5
*@file
6
*@brief no used ??
7
*/
8
if
( ! defined (
'ALLOWED'
) ) die(
'Appel direct ne sont pas permis'
);
9
$cn
=
Dossier::connect
();
10
11
12
if
( isset(
$_REQUEST
[
'pa_id'
]) )
13
{
14
$res
=
$cn
->exec_sql(
"select po_name,po_description
15
from poste_analytique
16
where
17
pa_id=$1
18
and (po_description ilike '%'|| $2||'%' or po_name ilike '%'|| $3 ||'%')
19
order by po_id limit 12"
,
20
array(
$_REQUEST
[
'pa_id'
],
$_POST
[
'anccard'
],
$_POST
[
'anccard'
]));
21
}
22
else
23
{
24
$res
=
$cn
->exec_sql(
"select po_name,po_description
25
from poste_analytique
26
where
27
po_description ilike '%'|| $1 ||'%'
28
or po_name ilike '%'|| $2||'%'
29
order by po_id limit 12 "
,
30
array(
$_POST
[
'anccard'
],
$_POST
[
'anccard'
]));
31
}
32
$nb
=
Database::num_row
(
$res
);
33
echo
"<ul>"
;
34
for
(
$i
= 0;
$i
<
$nb
;
$i
++)
35
{
36
$row
=
Database::fetch_array
(
$res
,
$i
);
37
echo
"<li>"
;
38
echo
$row
[
'po_name'
];
39
echo
'<span class="informal"> '
.$row[
'po_description'
].
'</span></li>'
;
40
}
41
echo
"</ul>"
;
42
?>
$i
$i
Definition:
action_document_type_mtable_input.php:83
$row
$row
Definition:
ajax_anc_detail_operation.php:33
$cn
$cn
Definition:
ajax_auto_anc_card.php:9
$nb
$nb
Definition:
ajax_auto_anc_card.php:32
$res
$res
Definition:
ajax_preference.php:49
$_REQUEST
$_REQUEST['ac']
Definition:
ajax_search_action.php:26
DatabaseCore\fetch_array
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
Definition:
database_core.class.php:757
DatabaseCore\num_row
static num_row($ret)
wrapper for the function pg_num_rows
Definition:
database_core.class.php:744
Dossier\connect
static connect()
Definition:
dossier.class.php:295
$_POST
$_POST['ac']
Definition:
do.php:310