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

Diff of /trunk/app/bible2.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 88 by fraynaud, Thu Aug 25 09:59:07 2011 UTC revision 1184 by fmichon, Wed Jan 9 09:34:50 2013 UTC
# Line 4  Line 4 
4   * champs file d'un formulaire   * champs file d'un formulaire
5   *   *
6   * @package openmairie_foncier   * @package openmairie_foncier
7   * @version SVN : $Id: voir.php 336 2010-12-15 17:26:37Z fraynaud $   * @version SVN : $Id$
8   */   */
9  require_once "../obj/utils.class.php";  require_once "../obj/utils.class.php";
10  $f = new utils("nohtml");  $f = new utils("nohtml");
# Line 21  $evenement=intval($evenement); Line 21  $evenement=intval($evenement);
21  $nature=substr($_GET['idx'],0,2);  $nature=substr($_GET['idx'],0,2);
22  $DEBUG=0;  $DEBUG=0;
23  // *** sql  // *** sql
24  $sql="select * from bible where evenement =".$evenement.  $sql="SELECT * FROM ".DB_PREFIXE."bible ".
25      " and complement=2 and (nature = 'T' or nature ='".$nature."')";          "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)  if ($DEBUG==1)
30      echo $sql."<br>";      echo $sql."<br>";
31  $res = $f->db->query($sql);  $res = $f->db->query($sql);
# Line 30  $f->isDatabaseError($res); Line 33  $f->isDatabaseError($res);
33  $nbligne=$res->numrows();  $nbligne=$res->numrows();
34  if($nbligne>0){  if($nbligne>0){
35      echo "<form name='f3'>";      echo "<form name='f3'>";
36      echo  "<select size=\"1\" name=\"bible\" class=\"champFormulaire\">";      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)){      while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
46              $temp=$row['contenu'];          echo "<tr>";
47              $opt= "<option value=\"".$temp."\">".$row['libelle']."</option>";          echo '<td><input type="checkbox" name="choix[]" value="'.$i.'" id="'.$i.'"></td>';
48              echo $opt;          echo "<td><span id='contenu[".$i."]'>".$row['contenu']."</span></td>";
49            echo "<td>";
50            echo "</td>";
51            echo "</tr>";
52            $i++;
53      }      }
54      echo "</select>";      echo "\t\t\t</table>\n";
55      echo "<br><br><input type='submit' tabindex=70 value='V a l i d e r' onclick='javascript:recup();'  style='".$styleBouton."'></center>";      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>";      echo "</form>";
58      }else{      }else{
59          echo "aucun element dans la bible pour l'evenement = ".$evenement;          echo "aucun element dans la bible pour l'evenement = ".$evenement;
60          echo "<br><center><a href=# onclick='window.close();'>";          echo "<br><center><a href=# onclick='window.close();'>";
61          echo "<img src='..\img\fermer.png' border='0'  alt='Fermer cette fenetre' align='middle'>";          echo "<img src='img/fermer.png' border='0'  alt='Fermer cette fenetre' align='middle'>";
62          echo "</a></center>";          echo "</a></center>";
63      }      }
64  ?>  ?>
65  <script language="javascript">  <script language="javascript">
66  function recup()      var listeElement='';
67  {      function getListeElement(){
68  opener.document.f2.complement2.value = opener.document.f2.complement2.value+document.f3.bible.value+"\r";          for(var i = 0; i < <?php echo $i;?>; i++){
69  this.close();              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>  </script>
81  </body>  </body>
82  </html>  </html>

Legend:
Removed from v.88  
changed lines
  Added in v.1184

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26