1 |
fraynaud |
88 |
<?php |
2 |
|
|
/** |
3 |
|
|
* Ce script permet de mettre un texte de la bible dans un formulaire instruction |
4 |
|
|
* champs file d'un formulaire |
5 |
|
|
* |
6 |
|
|
* @package openmairie_foncier |
7 |
|
|
* @version SVN : $Id: voir.php 336 2010-12-15 17:26:37Z fraynaud $ |
8 |
|
|
*/ |
9 |
|
|
require_once "../obj/utils.class.php"; |
10 |
|
|
$f = new utils("nohtml"); |
11 |
|
|
/** |
12 |
|
|
* Affichage de la structure HTML |
13 |
|
|
*/ |
14 |
|
|
// |
15 |
|
|
$f->setFlag("htmlonly"); |
16 |
|
|
$f->display(); |
17 |
|
|
$f->displayStartContent(); |
18 |
|
|
// *** get |
19 |
|
|
(isset($_GET['ev']) ? $evenement = $_GET['ev'] : $evenement = ""); |
20 |
|
|
$evenement=intval($evenement); |
21 |
|
|
$nature=substr($_GET['idx'],0,2); |
22 |
|
|
$DEBUG=0; |
23 |
|
|
// *** sql |
24 |
|
|
$sql="select * from bible where evenement =".$evenement. |
25 |
|
|
" and complement=2 and (nature = 'T' or nature ='".$nature."')"; |
26 |
|
|
if ($DEBUG==1) |
27 |
|
|
echo $sql."<br>"; |
28 |
|
|
$res = $f->db->query($sql); |
29 |
|
|
$f->isDatabaseError($res); |
30 |
|
|
$nbligne=$res->numrows(); |
31 |
|
|
if($nbligne>0){ |
32 |
|
|
echo "<form name='f3'>"; |
33 |
|
|
echo "<select size=\"1\" name=\"bible\" class=\"champFormulaire\">"; |
34 |
|
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
35 |
|
|
$temp=$row['contenu']; |
36 |
|
|
$opt= "<option value=\"".$temp."\">".$row['libelle']."</option>"; |
37 |
|
|
echo $opt; |
38 |
|
|
} |
39 |
|
|
echo "</select>"; |
40 |
|
|
echo "<br><br><input type='submit' tabindex=70 value='V a l i d e r' onclick='javascript:recup();' style='".$styleBouton."'></center>"; |
41 |
|
|
echo "</form>"; |
42 |
|
|
}else{ |
43 |
|
|
echo "aucun element dans la bible pour l'evenement = ".$evenement; |
44 |
|
|
echo "<br><center><a href=# onclick='window.close();'>"; |
45 |
|
|
echo "<img src='..\img\fermer.png' border='0' alt='Fermer cette fenetre' align='middle'>"; |
46 |
|
|
echo "</a></center>"; |
47 |
|
|
} |
48 |
|
|
?> |
49 |
|
|
<script language="javascript"> |
50 |
|
|
function recup() |
51 |
|
|
{ |
52 |
|
|
opener.document.f2.complement2.value = opener.document.f2.complement2.value+document.f3.bible.value+"\r"; |
53 |
|
|
this.close(); |
54 |
|
|
} |
55 |
|
|
</script> |
56 |
|
|
</body> |
57 |
|
|
</html> |