/[openfoncier]/trunk/app/bible2.php
ViewVC logotype

Contents of /trunk/app/bible2.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1175 - (show annotations)
Tue Jan 8 11:42:03 2013 UTC (12 years ago) by nhaye
File size: 2951 byte(s)
Modification de la table bible, ajout de la colonne dossier_autorisation_type, suppression de la liaison entre bible et dossier_autorisation_type_detaille

1 <?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 ".DB_PREFIXE."bible ".
25 "LEFT OUTER JOIN ".DB_PREFIXE."dossier_autorisation_type ".
26 "ON bible.dossier_autorisation_type=dossier_autorisation_type.dossier_autorisation_type ".
27 "WHERE evenement =".$evenement.
28 " and complement=2 and (bible.dossier_autorisation_type IS NULL or dossier_autorisation_type.code ='".$nature."')";
29 if ($DEBUG==1)
30 echo $sql."<br>";
31 $res = $f->db->query($sql);
32 $f->isDatabaseError($res);
33 $nbligne=$res->numrows();
34 if($nbligne>0){
35 echo "<form name='f3'>";
36 echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">\n";
37 echo "\t<legend class=\"ui-corner-all ui-widget-content ui-state-active\">";
38 echo _("Liste de la bible en lien avec cette arrete municipal")."</legend>";
39 echo "<table width='100%'>";
40 echo "<tr class=\"ui-tabs-nav ui-accordion ui-state-default tab-title\">";
41 echo "<td>"._("Choisir")."</td>";
42 echo "<td>"._("Contenu")."</td>";
43 echo "</tr>";
44 $i = 0 ;
45 while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
46 echo "<tr>";
47 echo '<td><input type="checkbox" name="choix[]" value="'.$i.'" id="'.$i.'"></td>';
48 echo "<td><span id='contenu[".$i."]'>".$row['contenu']."</span></td>";
49 echo "<td>";
50 echo "</td>";
51 echo "</tr>";
52 $i++;
53 }
54 echo "\t\t\t</table>\n";
55 echo "</fieldset>";
56 echo "<br><br><input type='submit' tabindex=70 value='V a l i d e r' onclick='javascript:recup();'></center>";
57 echo "</form>";
58 }else{
59 echo "aucun element dans la bible pour l'evenement = ".$evenement;
60 echo "<br><center><a href=# onclick='window.close();'>";
61 echo "<img src='img/fermer.png' border='0' alt='Fermer cette fenetre' align='middle'>";
62 echo "</a></center>";
63 }
64 ?>
65 <script language="javascript">
66 var listeElement='';
67 function getListeElement(){
68 for(var i = 0; i < <?php echo $i;?>; i++){
69 if (document.getElementById(i).checked == true ){
70 listeElement += document.getElementById('contenu['+i+']').firstChild.nodeValue + '\r';
71 listeElement += '\n\r';
72 }
73 }
74 }
75 function recup(){
76 getListeElement();
77 opener.document.f2.complement2.value = opener.document.f2.complement2.value+listeElement+"\r";
78 window.close();
79 }
80 </script>
81 </body>
82 </html>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26