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

Annotation of /trunk/app/recherchedossier.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (hide annotations)
Thu Sep 8 10:31:23 2011 UTC (13 years, 4 months ago) by fraynaud
File size: 11017 byte(s)
correction bug recherche entre 2 dates
parametrage action
modification instruction.class ajouterapres



1 fraynaud 88 <?php
2     // $Id: recherchedossier.php,v 1.26 2010-06-21 11:46:38 jbastide Exp $
3     // version 1.02 stage julien Boyer
4     /**
5     * Fichiers requis
6     */
7     require_once "../obj/utils.class.php";
8     $f = new utils(NULL, NULL, _("Recherche dossier"));
9     $f->addHTMLHeadJs(array("../js/script.js"));
10     $condition='where';
11    
12    
13     function entre2dates($zone){
14     echo "<table border='0px'><tr><td>";
15     echo "<div class='choice ui-corner-all ui-widget-content'>";
16     echo "<fieldset class=\"cadre ui-corner-all ui-widget-content startClosed\">\n";
17     echo "<legend align='center' class=\"ui-corner-all ui-widget-content ui-state-active\">";
18     echo "<b>"._($zone)."</b>";
19     echo "</legend>";
20     echo "\t<div class=\"list\">\n";
21     echo ""._("Debut").":";
22     echo "<input type='text' name='".$zone."_debut' id=\"".$zone."_debut\" value=\"";
23     echo "\" size=\"10\" class=\"champFormulaire datepicker\" onchange='fdate(this)' onkeyup=\"\" onclick=\"\" />\n";
24     echo "<br>"._("Fin")."__:";
25     echo "<input type='text' name='".$zone."_fin' id=\"".$zone."_fin\" value=\"";
26     echo "\" size=\"10\" class=\"champFormulaire datepicker\" onchange='fdate(this)' onkeyup=\"\" onclick=\"\" />\n";
27     echo "</div>";
28     echo"</fieldset>";
29     echo "</div>";
30     echo "</td></tr></table>";
31     }
32    
33     function rtext($zone){
34     echo "<table border='0px'><tr><td>";
35     echo "<div class='choice ui-corner-all ui-widget-content'>";
36    
37     echo "<fieldset class=\"cadre ui-corner-all ui-widget-content startClosed\">\n";
38     echo "<legend align='center' class=\"ui-corner-all ui-widget-content ui-state-active\">";
39     echo "<b>"._($zone)."</b><br>";
40     echo "</legend>";
41     echo "\t<div class=\"list\">\n";
42     //echo "<br>";
43     echo "<input type='text' name='".$zone."' size='20' maxlength='30' class='champFormulaire'>";
44     //echo "<br><br><br>";
45     echo "</div>";
46     echo"</fieldset>";
47     echo "</div>";
48     echo "</td></tr></table>";
49     }
50    
51     function ouinon($zone){
52     echo "<table border='0px'><tr><td>";
53     echo "<div class='choice ui-corner-all ui-widget-content'>";
54    
55     echo "<fieldset class=\"cadre ui-corner-all ui-widget-content startClosed\">\n";
56     echo "<legend align='center' class=\"ui-corner-all ui-widget-content ui-state-active\">";
57     echo "<b>"._($zone)."</b><br>";
58     echo "</legend>";
59     echo "\t<div class=\"list\">\n";
60     echo "<select name='".$zone."' class='champFormulaire' SIZE='1'>";
61     echo"<option value=''>"._("votre_choix")."</option>";
62     echo"<option value='Oui'>"._("Oui")."</option>";
63     echo"<option value='Non'>"._("Non")."</option>";
64     echo "</select>";
65     echo "</div>";
66     echo"</fieldset>";
67     echo "</div>";
68     echo "</td></tr></table>";
69     }
70    
71     function rselect($zone,$sql,&$db){
72     echo "<table border='0px'><tr><td>";
73     echo "<div class='choice ui-corner-all ui-widget-content'>";
74    
75     echo "<fieldset class=\"cadre ui-corner-all ui-widget-content startClosed\">\n";
76     echo "<legend align='center' class=\"ui-corner-all ui-widget-content ui-state-active\">";
77     echo "<b>"._($zone)."</b><br>";
78     echo "</legend>";
79     echo "\t<div class=\"list\">\n";
80     //echo "<br>";
81     echo "<select name='".$zone."' class='champFormulaire' width='20px' SIZE='1'>";
82     $res = $db->query($sql);
83     if (database::isError($res))
84     die($res->getDebugInfo()." ".$sql);
85     else
86     {
87     echo"<option value=''>"._("votre choix")."</option>";
88     while ($row=& $res->fetchRow())
89     echo "<option value='".$row[0]."'>".$row[1].
90     "</option>";
91     }
92     $res->free();
93     echo "</select><br>";
94     echo "</div>";
95     echo"</fieldset>";
96     echo "</div>";
97     echo "</td></tr></table>";
98     }
99    
100     // validation ==1
101    
102     function rtext1($zone,$condition){
103     global $condition;
104     $req= "";
105     if($_POST[$zone]!=""){
106     //$req=" ".$condition." "." ".$zone." like '%".$_POST[$zone]."%'";
107     $req=" ".$condition." "." ".$zone." like '".$_POST[$zone]."'";
108     $condition = "and";
109     }
110     return $req;
111     }
112    
113     function rselect1($zone,$condition){
114     global $condition;
115     $req= "";
116     if($_POST[$zone]!=""){
117     $req=" ".$condition." "." ".$zone." = '".$_POST[$zone]."'";
118     $condition = "and";
119     }
120     return $req;
121     }
122    
123     function entre2dates1($zone,$condition){
124     global $condition;
125     $req= "";
126     if($_POST[$zone."_debut"]!=""){
127 fraynaud 121 // substr($_POST['date_envoi_debut'],6,4).'-'.substr($_POST['date_envoi_debut'],3,2).'-'.substr($_POST['date_envoi_debut'],0,2);
128     $req=" ".$condition." "." ".$zone." >= '".substr($_POST[$zone."_debut"],6,4)."-"
129     .substr($_POST[$zone."_debut"],3,2)."-"
130     .substr($_POST[$zone."_debut"],0,2).""."'";
131     $condition = "and";
132 fraynaud 88 }
133     if($_POST[$zone."_fin"]!=""){
134 fraynaud 121 $req.=" ".$condition." "." ".$zone." <= '".substr($_POST[$zone."_fin"],6,4)."-"
135     .substr($_POST[$zone."_fin"],3,2)."-"
136     .substr($_POST[$zone."_fin"],0,2).""."'";
137 fraynaud 88 $condition = "and";
138     }
139     return $req;
140     }
141    
142    
143     // variables
144     $DEBUG=0;
145     $annee = (int)date("Y"); //----> retourne l'annee actuelle
146     // GET
147     if (isset ($_GET['validation'])){
148     $validation=$_GET['validation'];
149     }else{
150     $validation=0;
151     }
152     if($validation==0){
153     $validation=1;
154     // requete sur table
155     $sql_instructeur=" SELECT om_utilisateur,nom from om_utilisateur where instructeur='Oui' order by nom";
156     $sql_nature=" SELECT nature,libelle FROM nature order by libelle";
157     $sql_destination=" SELECT destination,libelle FROM destination order by libelle";
158     $sql_architecte=" SELECT architecte,nom,prenom FROM architecte order by nom,prenom";
159     $sql_travaux=" SELECT travaux,substring(libelle,0,30) FROM travaux order by libelle";
160     $sql_avis=" SELECT avis,libelle FROM avis order by libelle";
161     $sql_etat=" SELECT etat,libelle FROM etat order by libelle";
162     echo "<form method='post' name='f1' action='recherchedossier.php?validation=".$validation."'>";
163    
164     echo "<table class='ui-corner-all' style='border:1px solid #000000' WIDTH='100%' cellspacing='0' cellpadding='0px'>";
165     echo "<tr><td valign='middle' align='middle'class='fd_haut_rechdossier' colspan='3'>";
166     echo "<input type='submit' name='boutonrecherche' value=' OK ' width='20px' >&nbsp;&nbsp";
167     echo "</tr><tr><td class='fd_rechdossier' valign='top' align='right'>";
168     rtext("dossier");
169     rtext("delegataire_nom");
170     rtext("demandeur_nom");
171     rtext("demandeur_societe");
172     rtext("parcelle");
173     rtext("rivoli");
174     rtext("terrain_adresse");
175     rtext("terrain_adresse_complement");
176     echo "</td><td class='fd_rechdossier' valign='top' align='center'>";
177     rselect("nature",$sql_nature,$f->db);
178     rselect("etat",$sql_etat,$f->db);
179     ouinon("accord_tacite");
180     rselect("travaux",$sql_travaux,$f->db);
181     entre2dates('date_depot');
182     entre2dates('date_validite');
183     entre2dates('date_complet');
184     echo "</td><td valign='top' align='right' class='fd_rechdossier'>";
185     entre2dates('date_rejet');
186     entre2dates('date_decision');
187     entre2dates('date_limite');
188     entre2dates('date_chantier');
189     entre2dates('date_achevement');
190     entre2dates('date_conformite');
191     rselect("instructeur",$sql_instructeur,$f->db);
192     rselect("architecte",$sql_architecte,$f->db);
193     echo "</td></tr><tr><td class='fd_bas_rechdossier'colspan='3' valign='top' align='center'>";
194     // commentaires
195     echo "<div class='both'></div>"; // pas de float a gauche et a droite
196    
197     echo "<i><b>"._("Utilisation de % pour zones de saisie")."&nbsp;&nbsp;:&nbsp;&nbsp;</b>";
198     //echo "</legend>";
199 fraynaud 116 echo" <img src='../app/img/punaise.png' valign='top' vspace='0' hspace='5' border='0' alt='aide'>";
200 fraynaud 88 echo " %BAS "._("finit par 'BAS'")."";
201 fraynaud 116 echo" <img src='../app/img/punaise.png' valign='top' vspace='0' hspace='5' border='0' alt='aide'>";
202 fraynaud 88 echo " BAS% "._("commence par 'BAS'")."";
203 fraynaud 116 echo" <img src='../app/img/punaise.png' valign='top' vspace='0' hspace='5' border='0' alt='aide'>";
204 fraynaud 88 echo " %BAS% "._("contient 'BAS'")."";
205     echo "</i></div>";
206     echo "</td></tr></table>";
207     echo "</form>";
208    
209     }else {
210     $sql = "select * from dossier ";
211     $sql.=rtext1("dossier", $condition);
212     $sql.=rselect1("etat", $condition);
213     $sql.=rtext1("parcelle", $condition);
214     $sql.=rtext1("rivoli", $condition);
215     $sql.=rselect1("nature", $condition);
216     $sql.=rtext1("delegataire_nom", $condition);
217     $sql.=rtext1("demandeur_nom", $condition);
218     $sql.=rtext1("demandeur_societe", $condition);
219     $sql.=rselect1("accord_tacite", $condition);
220     $sql.=rtext1("terrain_adresse", $condition);
221     $sql.=rtext1("terrain_adresse_complement", $condition);
222     $sql.=rselect1("instructeur", $condition);
223     $sql.=rselect1("travaux", $condition);
224     $sql.=rselect1("architecte", $condition);
225     $sql.=entre2dates1('date_depot', $condition);
226     $sql.=entre2dates1('date_complet', $condition);
227     $sql.=entre2dates1('date_achevement', $condition);
228     $sql.=entre2dates1('date_rejet', $condition);
229     $sql.=entre2dates1('date_decision', $condition);
230     $sql.=entre2dates1('date_conformite', $condition);
231     $sql.=entre2dates1('date_chantier', $condition);
232     $sql.=entre2dates1('date_limite', $condition);
233     $res= $f -> db->query($sql);
234     $f->isDatabaseError($res);
235     echo "<fieldset class=\"cadre ui-corner-all ui-widget-content startClosed\">\n";
236     echo "<legend align='center' class=\"ui-corner-all ui-widget-content ui-state-active\">";
237     echo _("Nombre de dossier ")." ".$res->numrows()."<br>";
238     echo "</legend>";
239     echo "\t<div class=\"list\">\n";
240     echo "requete : ".$sql;
241     echo "</div>";
242     echo"</fieldset>";
243     if($res->numrows() < 100){
244     while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
245     echo "<div class='choice ui-corner-all ui-widget-content'>";
246     echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\">\n";
247     echo "<legend align='center' class=\"ui-corner-all ui-widget-content ui-state-active\">";
248 fraynaud 90 echo "<a href=\"../app/dossier.php?menu=1&id=".$row['dossier']."\">".$row['dossier']."</a><br>";
249 fraynaud 88 echo "</legend>";
250     echo "\t<div class=\"list\">\n";
251     echo $row['demandeur_nom']."<br>";
252     echo $row['demandeur_societe']."<br>";
253     echo $row['terrain_numero']." ".$row['terrain_adresse']." ".$row['terrain_cp']." ".
254     $row['terrain_ville']."<br>";
255     echo "</div>";
256     echo"</fieldset>";
257     echo "</div>";
258     }
259     }else
260     echo _("Precisez votre question, affichage supérieur à 100 dossiers");
261     echo "<div class='both'></div>"; // pas de float a gauche et a droite
262    
263     }
264    
265     //echo "</div>";
266    
267     ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26