This commit is contained in:
Michael RICOIS 2010-05-28 16:46:11 +00:00
commit 3d6d4997c7
5 changed files with 15 additions and 5 deletions

View File

@ -41,6 +41,7 @@ foreach (array('dirNom',
<div class="submit">
<input class="button" type="submit" name="submit" value="Recherche" title="Lancer la recherche..." />
<input class="button" type="reset" name="reset" value="Effacer" title="Remise à zéro" />
</div>
</form>

View File

@ -20,8 +20,11 @@ foreach (array('siret',
<div class="fieldgrp">
<label>SIREN</label>
<input type="text" name="formR[siret]" value="<?=$formR['siret']?>" size="30" maxlength="20" style="vertical-align:middle;" />
<img src="img/exclamation.png" title="Recherche par SIREN, SIRET, N° TVA intracommunautaire, N° RC, N° WALDEC, ISIN" style="vertical-align:middle;" />
<input type="text" name="formR[siret]" value="<?=$formR['siret']?>" size="30"
maxlength="20" style="vertical-align:middle;"
title="Recherche par SIREN, SIRET, N° TVA intracommunautaire, N° RC, N° WALDEC, ISIN"/>
<img src="img/info.gif" style="vertical-align:middle;"
title="Recherche par SIREN, SIRET, N° TVA intracommunautaire, N° RC, N° WALDEC, ISIN"/>
</div>
<div class="fieldgrp marge">
@ -52,6 +55,7 @@ foreach (array('siret',
<div class="submit">
<input class="button" type="submit" name="submit" value="Recherche" title="Lancer la recherche..." />
<input class="button" type="reset" name="reset" value="Effacer" title="Remise à zéro" />
</div>
</form>

BIN
www/img/info.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
www/img/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

View File

@ -5,7 +5,9 @@ if (!$q) return;
$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) or
die("Impossible de se connecter : " . mysql_error());
$db_selected = mysql_select_db(MYSQL_DB, $link);
if (!$db_selected) { die ('Impossible de sélectionner la base de données : ' . mysql_error()); }
if (!$db_selected) {
die ('Impossible de sélectionner la base de données : ' . mysql_error());
}
//Lecture des données mysql
$sql = "SET NAMES 'utf8'";
$result = mysql_query($sql);
@ -13,11 +15,14 @@ $sql = "SELECT codNaf5, libNaf5 FROM tabnaf5 WHERE codNaf5 LIKE '%$q%' OR libNaf
$result = mysql_query($sql);
$output = array();
if ( mysql_num_rows($result)>0 && mysql_num_rows($result)!=FALSE ){
while ($row = mysql_fetch_assoc($result)) { $items[$row['codNaf5']] = "".$row['libNaf5'].""; }
while ($row = mysql_fetch_assoc($result)) {
$items[$row['codNaf5']] = "".$row['libNaf5']."";
}
//Envoi des informations
$separator = " , ";
foreach ($items as $key=>$value) {
if (strpos(strtolower($key), $q) !== false || strpos(strtolower($value), $q) !== false ) {
if (strpos(strtolower($key), $q) !== false ||
strpos(strtolower($value), $q) !== false ) {
$output[] = array(
'label' => $key . $separator . $value,
'value' => $key