113 |
$regle=0; |
$regle=0; |
114 |
$msg=""; |
$msg=""; |
115 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
116 |
|
if(isset($this->valF[$row['champ']])) |
117 |
|
$champvaleur=$this->valF[$row['champ']]; |
118 |
|
else |
119 |
|
$champvaleur=0; |
120 |
switch ($row['operateur']) { |
switch ($row['operateur']) { |
121 |
case ">" : |
case ">" : |
122 |
if($row['sens']=="plus"){ |
if($row['sens']=="plus"){ |
123 |
if($this->valF[$row['champ']] > $row['valeur']) |
if($champvaleur > $row['valeur']) |
124 |
$condition = 1; |
$condition = 1; |
125 |
else |
else |
126 |
$condition = 0; |
$condition = 0; |
129 |
else |
else |
130 |
$regle=0; |
$regle=0; |
131 |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
132 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
133 |
}else{ |
}else{ |
134 |
if($this->valF[$row['champ']] > $row['valeur']){ |
if($champvaleur > $row['valeur']){ |
135 |
$condition = 0; |
$condition = 0; |
136 |
}else{ |
}else{ |
137 |
$condition = 1; |
$condition = 1; |
138 |
$regle=0; |
$regle=0; |
139 |
} |
} |
140 |
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
141 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
142 |
} |
} |
143 |
break; |
break; |
144 |
case ">=": |
case ">=": |
145 |
if($row['sens']=="plus"){ |
if($row['sens']=="plus"){ |
146 |
if($this->valF[$row['champ']] >= $row['valeur']) |
if($champvaleur >= $row['valeur']) |
147 |
$condition = 1; |
$condition = 1; |
148 |
else |
else |
149 |
$condition = 0; |
$condition = 0; |
152 |
else |
else |
153 |
$regle=0; |
$regle=0; |
154 |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
155 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
156 |
}else{ |
}else{ |
157 |
if($this->valF[$row['champ']] >= $row['valeur']){ |
if($champvaleur >= $row['valeur']){ |
158 |
$condition = 0; |
$condition = 0; |
159 |
|
|
160 |
}else{ |
}else{ |
162 |
$regle=0; |
$regle=0; |
163 |
} |
} |
164 |
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
165 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
166 |
} |
} |
167 |
break; |
break; |
168 |
case "<" : |
case "<" : |
169 |
if($row['sens']=="plus"){ |
if($row['sens']=="plus"){ |
170 |
if($this->valF[$row['champ']] < $row['valeur']) |
if($champvaleur < $row['valeur']) |
171 |
$condition = 1; |
$condition = 1; |
172 |
else |
else |
173 |
$condition = 0; |
$condition = 0; |
176 |
else |
else |
177 |
$regle=0; |
$regle=0; |
178 |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
179 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
180 |
}else{ |
}else{ |
181 |
if($this->valF[$row['champ']] < $row['valeur']){ |
if($champvaleur < $row['valeur']){ |
182 |
$condition = 0; |
$condition = 0; |
183 |
}else{ |
}else{ |
184 |
$condition = 1; |
$condition = 1; |
185 |
$regle=0; |
$regle=0; |
186 |
} |
} |
187 |
$msg=$msg."<br> et ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> et ".$row['message']." [".$row['champ']." = ". |
188 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
189 |
} |
} |
190 |
break; |
break; |
191 |
case "==": |
case "==": |
192 |
if($row['sens']=="plus"){ |
if($row['sens']=="plus"){ |
193 |
if($this->valF[$row['champ']] == $row['valeur']) |
if($champvaleur == $row['valeur']) |
194 |
$condition = 1; |
$condition = 1; |
195 |
else |
else |
196 |
$condition = 0; |
$condition = 0; |
197 |
if($regle==1 or $condition == 1) |
if($regle==1 or $condition == 1) |
198 |
$regle=1; |
$regle=1; |
199 |
else |
else |
200 |
$regle=0; |
$regle=0; |
201 |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
$msg=$msg."<br> + ".$row['message']." [".$row['champ']." = ". |
202 |
$this->valF[$row['champ']]."]"; |
$champvaleur."]"; |
|
}else{ |
|
|
if($this->valF[$row['champ']] == $row['valeur']){ |
|
|
$condition = 0; |
|
|
|
|
203 |
}else{ |
}else{ |
204 |
$condition = 1; |
if($champvaleur == $row['valeur']){ |
205 |
$regle=0; |
$condition = 0; |
206 |
|
|
207 |
|
}else{ |
208 |
|
$condition = 1; |
209 |
|
$regle=0; |
210 |
|
} |
211 |
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
212 |
|
$champvaleur."]"; |
213 |
} |
} |
|
$msg=$msg."<br> ou ".$row['message']." [".$row['champ']." = ". |
|
|
$this->valF[$row['champ']]."]"; |
|
|
} |
|
|
break; |
|
214 |
break; |
break; |
215 |
|
//break; |
216 |
} // switch |
} // switch |
217 |
if($regle==0) |
if($regle==0) |
218 |
$this->addToMessage(" <br><br>"); |
$this->addToMessage($msg." <br>"); |
219 |
} // while |
} // while |
220 |
} // travaux |
} // travaux |
221 |
}//verifier |
}//verifier |
1013 |
|
|
1014 |
function calcul_auto_servitude_ligne($id,&$db,$geom,$projection){ |
function calcul_auto_servitude_ligne($id,&$db,$geom,$projection){ |
1015 |
// recherche servitude ligne |
// recherche servitude ligne |
1016 |
$distance=100; |
//$distance=100; |
1017 |
$sql="select * from servitude_ligne WHERE ST_contains(ST_buffer(geom, ".$distance."), geometryfromtext('".$geom."', ".$projection."))"; |
$sql="select * from servitude_ligne WHERE ST_contains(ST_buffer(geom, perimetre), geometryfromtext('".$geom."', ".$projection."))"; |
1018 |
$res=$db->query($sql); |
$res=$db->query($sql); |
1019 |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
1020 |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
1026 |
|
|
1027 |
function calcul_auto_servitude_point($id,&$db,$geom,$projection){ |
function calcul_auto_servitude_point($id,&$db,$geom,$projection){ |
1028 |
// recherche servitude point |
// recherche servitude point |
1029 |
$distance=500; // monuments historiques |
//$distance=500; // monuments historiques |
1030 |
$sql="select libelle,observation, distance(geom, geometryfromtext('".$geom."', ".$projection.")) as distance from servitude_point WHERE distance(geom, geometryfromtext('".$geom."', ".$projection."))<".$distance.""; |
$sql="select libelle,observation, perimetre, distance(geom, geometryfromtext('".$geom."', ".$projection.")) as distance from servitude_point WHERE distance(geom, geometryfromtext('".$geom."', ".$projection."))<perimetre"; |
1031 |
$res=$db->query($sql); |
$res=$db->query($sql); |
1032 |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
if (database:: isError($res)) die($res1->getMessage()."erreur ".$sql); |
1033 |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
$this->addToLog("requete :".$sql." executee ", VERBOSE_MODE); |
1034 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
1035 |
$this->addToMessage("<br>"._("servitude")." : ".$row['libelle']." - *** ".$row['observation'])." a ".round($row['distance'],2)." m "; |
$this->addToMessage("<br>"._("servitude")." : ".$row['libelle']." - ".$row['observation']." a ".round($row['distance'],2)." m "); |
1036 |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." a ".round($row['distance'],2)." m - "; |
$this->servitude.=" [".$row['libelle']."] ".$row['observation']." a ".round($row['distance'],2)." m - "; |
1037 |
} |
} |
1038 |
} |
} |