Bonjour à tous ;



voilà je ne sais pas où est le problème dans cette requête et quelle est la cause de ce disfonctionnement mais voilà ; j'essai d'expliquer un peu la base : je crée un formulaire contenant plusieurs type de contrat que j'ai nommé (police ) cette recherche peut se faire aussi avec les différentes types de compagnie et enfin dernier critère savoir l'état du contrat si c'est en cours ou pas voici le code pour ce formulaire , la police est possible de faire un choix multiple , pareil pour les entreprises

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
 
 
<!--
ici on traite la recherche avancée selon le choix de l'utilisateur .
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Recherche Avanc&eacute;e</title>
    </head>
    <body>
 
        <form action="AvanceeCherch.php" method="GET">
 
 
        <p>
 
            <h5>Police </h5>
 
            <!--
             Automobile <input type="checkbox" name="police[]" value="1" checked="checked" />;
             Divers <input type="checkbox" name="police[]" value="2" />
             Habitation <input type="checkbox" name="police[]" value="3" />
             Sant&eacute;e <input type="checkbox" name="police[]" value="4" />
              Civile <input type="checkbox" name="police[]" value="5" />
            -->
 
        <?php
                     $divers = array ("11"=>"Divers","13"=>"Navigation de plaisance","14"=>"Décès",
                         "15"=>"Assistance","17"=>"March transportées","18"=>"Prévoyance","19"=>"Dommage ouvrage","20"=>"Multirisque Entreprise",
                         "21"=>"Protection juridique","22"=>"Caravaning","23"=>"Incendie capitaux","24"=>"Assurances collectives",
                         "26"=>"Loisirs","27"=>"Garagiste OLD","28"=>"Multirisque commerce","29"=>"Garantie du conducteur","30"=>"Multirisque agricole",
"34"=>"Aviation","42"=>"Complémentaire maladie Cadre","43"=>"Complémentaire maladie non Cadre","44"=>"Prévoyance Cadre","45"=>"Prévoyance non Cadre",
"46"=>"Mensualisation","47"=>"Article 82","48"=>"Article 83","49"=>"Indemnité fin de carrière","50"=>"Assurance chômage","51"=>"Retraite obligatoire tranche A",
"52"=>"Retraite obligatoire tranche B","53"=>"Complémentaire maladie TNS","54"=>"Prévoyance TNS","55"=>"Chômage TNS","56"=>"Retraite TNS",
"57"=>"Placement","58"=>"Plan sécurité famille","59"=>"Plan épargne éducation","1005"=>"Multirisque divers","1006"=>"Mult. Garagiste",
"1007"=>"Multi. industrielle","1008"=>"Incendie risques simples","1009"=>"Incendie R.i.","1010"=>"Degats des eaux","1011"=>"N°ol",
"1012"=>"Bris de glaces","1013"=>"P.E. après incendie","1014"=>"R.C. particulier","1015"=>"R.C. cheval","1016"=>"R.C. médical",
"1017"=>"R.C. divers","1018"=>"R.C. exploitation","1019"=>"R.C. professionnelle","1020"=>"T.R. informatique","1021"=>"T.R. matriel",
"1022"=>"T.R. velo","1023"=>"P.E. après bris de machine","1024"=>"Individuelle accidents","1025"=>"Groupe","1026"=>"Vie",
                         "1027"=>"Maladie","1028"=>"R.C. decennale","1029"=>"P.U.C.","1030"=>"T.R.C.","1031"=>"Loyer impaye","1033"=>"T.R. mission",
"1034"=>"Vol" , "1035"=>"Maritime et transport","1036"=>"R.I.");
 
        ?>
 
            <select name="police[]" multiple="multiple">
 
                <optgroup label="Automobile">
 
                    <option value="1">Véhicule</option>
                    <option value="1000">Automobile</option>
                    <option value="1001">Moto ou cyclomoteur</option>
                    <option value="1002">Flotte automobile</option>
                    <option value="1003">Engins divers</option>
                    <option value="1004">Bateau </option>
 
                </optgroup>
 
                <optgroup label="Divers">
 
                    <?php
                               foreach ($divers as $val =>$donnee)
                                  echo "  <option value = \"$val\">$donnee</option>";
                    ?>
 
                </optgroup>
 
                <optgroup label="Habitation">
                     <option value ="36">Multirisque Habitation</option>
                       <option value ="39">Multirisque Immeuble</option>
 
 
                </optgroup>
 
                <optgroup label="Santé">
                      <option value ="35">Complémentaire maladie </option>
                        <option value ="4">Compl. maladie </option>
 
 
                </optgroup>
 
                <optgroup label="Autres ">
                      <option value ="31">Chasse </option>
                        <option value ="25">Bris de machine  </option>
                        <option value ="9">Responsabilité Civile</option>
                        <option value ="6">Tous Risques Objets Valeur</option>
 
 
                </optgroup>
            </select>
 
 
 
        </p>
 
 
 
 
        <p>
 
            <h5>Compagnie</h5>
             <!--AGF RISQUES PARTICULIERS <input type="checkbox" name="compagnie[]" value="1" checked="checked" /> <br/> -->
 
             <?php
 
 
 
             $compagnie = array("1074"=>"AGF RISQUES PARTICULIERS","1076"=>"AXA COURTAGE",
 
"116" =>"LA LILLOISE","122"=>"ALLIANZ VIA","124"=>"APG","129"=>"SOLLY AZAR","131"=>"CAMAT ASSURANCES","132"=>"CARDIF","134"=>"CIGNA FRANCE",
"135"=>"CONCORDE PLAISANCE","138"=>"ELVIA VOYAGES","140"=>"EUROP ASSISTANCE","142"=>"LA FEDERATION CONTINENTALE","147"=>"GENERALI FRANCE",
"149"=>	"M.M.A","150"=>"NATIONALE SUISSE","151"=>"PFA","157"=>"AXA MARINE AVIATION TRANSPORT","159"=>"SUN ALLIANCE","170"=>"CMA",
"1000"=>"RHIN ET MOSELLE","1004"=>"FRANCE VIE","1008"=>"C.G.P.A.","1012"=>"LA BALLOISE FRANCE","1013"=>"AG2R","1018"=>"LA CONCORDE",
"1021"=>"LE CONTINENT","1022"=>	"D.A.S.","1023"=>"L'EQUITE","1024"=>"GROUPE AZUR","1031"=>"MONDIAL ASSISTANCE","1032"=>"AIG EUROPE/UNAT",
"1034"=>"ZURICH - SALTIEL","1037"=>"WINTERTHUR","1039"=>"CONTINGENCY","1040"=>"ASAF","1041"=>"HELVTIA","1042"=>"EURALLIANCE","1045"=>"M.E.A.",
"1053"=>"A.M.I.S.","1059"=>"APRIL","1069"=>"MAAF" ,"1077"=>"COMMERCIAL UNION",
"1078"=>"NEMARF","1079"=>"ASSURANCES DU SUD","1080"=>"GAN ASSURANCES","1082"=>"GROUPE DE PREVOYANCE DES P.M.E","1083"=>"GAE","1084"=>"MUTUELLE ELECTRIQUE D'ASSURANCES",
"1085"=>"Soci&eacute;t&eacute Française de Protection Juridique","1087"=>"AGF-ALLIANZ GROUP","1088"=>"AALP","1090"=>"ASSURDISCOUNT","1092"=>"SWISS LIFE",
"1093"=>"LLOYD","1094"=>"ASSURANCE MOTO VERTE","1095"=>"INEAS","1097"=>"AGF Risques Entreprises","1098"=>"DIRECT ASSURANCE AXA","1099"=>"NET COURTIER.COM",
"1100"=>"AIPS","1101"=>"DESASSUREURS","1102"=>"AGF VIE","1103"=>"ABEILLE PAIX VIE","1104"=>"LA COMPTOISE","1105"=>"CGU","1106"=>"UGIP","1107"=>"VIASSUR",
"1108"=>"EURO ASSURANCE","1109"=>"LA PARISIENNE","1110"=>"NOVELIA","1111"=>"IMPACT ASSURANCES","1113"=>"GI2a","1114"=>"AMT ASSURANCE MOTO","1115"=>"RCB");
 
 
 
 
 
              echo "<select name=\"compagnie[]\" size=\"15\" multiple=\"multiple\">";
 
              foreach ($compagnie as $val=>$donnee)
                     {
                         if($val==1074){
                               echo "<option value=\"$val\" selected = \"selected\"> $donnee </option>";
                         }
                         else
                             {
 
                         echo "<option value=\"$val\"> $donnee </option>";
 
                             }
 
 
 
 
                     }
 
                              echo "</select><br/>";
 
 
             ?>
 
 
        </p>
 
 
 
 
 
        <p>
            <h5>Etat</h5>
 
            <select name="etat" >
 
                  <option value="3">Tous</option>
 
                <?php
                       $etat = array("1"=>"En cours","2"=>"Attente A.N","3"=>"Attente REV","4"=>"Résil Sinistre","5"=>"Résil Client","6"=>"Résil Ctx","7"=>"Résil interne","8"=>"Sans effet",
                          "9"=> "Susp Client","10"=>"Attente Résil","11"=>"Fin de garantie","12"=>"Attente Dont acte","13"=>"Attente Avenant","14"=>"Projet","15"=>"Temporaire","16"=>"Attente Susp","17"=>"Résil Compagnie");
 
 
 
                       foreach ($etat as $val=>$donnee){
                          echo "  <option value=\"$val\">$donnee</option>";
 
                       }
 
 
                ?>
 
            </select> <br/>
 
 
        </p>
 
 
 
        <input type="submit" value="Valider" name="ok" />
         </form>
    </body>
</html>

une fois que l'utilisateur a choisi ses choix , on le passe dans un autre fichier

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
 
<?php
/* 
 * resultat de la recherche Avancee
 */
 
 
 
//echo "etat est ".$etat;
 
// on affiche le tableau lui même
print_r($_GET);
 
echo "<br/>";
 
// on recupère les choix
// on vautiliser join() on sépare par des virgules qui convertit tableau en chaine
// type de contrat
 
 
 
 
$contratype = join(',', $_GET['police']);
 
 
 
 
 
   // compagnie
 $compagnie =  join(',', $_GET['compagnie']);
 
// $compagn = array(1,135,1074,147);
 
// $compagnie = join(',', $compagn);
 
//$compagnie =$_GET['compagnie'];
 // etat du contrat
$etat =$_GET['etat'];
 
echo "type de contrat :".$contratype."<br />";
 
 
 
echo "la compagnie : ".$compagnie."<br/>";
 
echo "etat du constrat ".$etat."<br/>";
 
 
$compgagnie = array(
 
"116" =>"LA LILLOISE","122"=>"ALLIANZ VIA","124"=>"APG","129"=>"SOLLY AZAR","131"=>"CAMAT ASSURANCES","132"=>"CARDIF","134"=>"CIGNA FRANCE",
"135"=>"CONCORDE PLAISANCE","138"=>"ELVIA VOYAGES","140"=>"EUROP ASSISTANCE","142"=>"LA FEDERATION CONTINENTALE","147"=>"GENERALI FRANCE",
"149"=>	"M.M.A","150"=>"NATIONALE SUISSE","151"=>"PFA","157"=>"AXA MARINE AVIATION TRANSPORT","159"=>"SUN ALLIANCE","170"=>"CMA",
"1000"=>"RHIN ET MOSELLE","1004"=>"FRANCE VIE","1008"=>"C.G.P.A.","1012"=>"LA BALLOISE FRANCE","1013"=>"AG2R","1018"=>"LA CONCORDE",
"1021"=>"LE CONTINENT","1022"=>	"D.A.S.","1023"=>"L'EQUITE","1024"=>"GROUPE AZUR","1031"=>"MONDIAL ASSISTANCE","1032"=>"AIG EUROPE/UNAT",
"1034"=>"ZURICH - SALTIEL","1037"=>"WINTERTHUR","1039"=>"CONTINGENCY","1040"=>"ASAF","1041"=>"HELVTIA","1042"=>"EURALLIANCE","1045"=>"M.E.A.",
"1053"=>"A.M.I.S.","1059"=>"APRIL","1069"=>"MAAF" ,"1074"=>"AGF RISQUES PARTICULIERS","1076"=>"AXA COURTAGE","1077"=>"COMMERCIAL UNION",
"1078"=>"NEMARF","1079"=>"ASSURANCES DU SUD","1080"=>"GAN ASSURANCES","1082"=>"GROUPE DE PREVOYANCE DES P.M.E","1083"=>"GAE","1084"=>"MUTUELLE ELECTRIQUE D'ASSURANCES",
"1085"=>"Soci&eacute;t&eacute Française de Protection Juridique","1087"=>"AGF-ALLIANZ GROUP","1088"=>"AALP","1090"=>"ASSURDISCOUNT","1092"=>"SWISS LIFE",
"1093"=>"LLOYD","1094"=>"ASSURANCE MOTO VERTE","1095"=>"INEAS","1097"=>"AGF Risques Entreprises","1098"=>"DIRECT ASSURANCE AXA","1099"=>"NET COURTIER.COM",
"1100"=>"AIPS","1101"=>"DESASSUREURS","1102"=>"AGF VIE","1103"=>"ABEILLE PAIX VIE","1104"=>"LA COMPTOISE","1105"=>"CGU","1106"=>"UGIP","1107"=>"VIASSUR",
"1108"=>"EURO ASSURANCE","1109"=>"LA PARISIENNE","1110"=>"NOVELIA","1111"=>"IMPACT ASSURANCES","1113"=>"GI2a","1114"=>"AMT ASSURANCE MOTO","1115"=>"RCB");
 
 
   $etat1 = array("1"=>"En cours","2"=>"Attente A.N","3"=>"Attente REV","4"=>"R&eacute;sil Sinistre","5"=>"R&eacute;sil Client","6"=>"R&eacute;sil Ctx","7"=>"R&eacute;sil interne","8"=>"Sans effet",
                          "9"=> "Susp Client","10"=>"Attente R&eacute;sil","11"=>"Fin de garantie","12"=>"Attente Dont acte","13"=>"Attente Avenant","14"=>"Projet","15"=>"Temporaire","16"=>"Attente Susp","17"=>"R&eacute;sil Compagnie");
 
  $policetype=array("1"=>"V&eacute;hicule","2"=>"Multi Habitation","3"=>"Capitalisation","4"=>"Compl. Maladie","5"=>"Perte d'Exploitation","6"=>"Tous Risques Objets Valeur","7"=>"Flotte",
"8"=>"Multi Professionnelle","9"=>"Responsabilit&eacute Civile","10"=>"Mission","11"=>"Divers","12"=>"Tous risques objets divers","13"=>"Navigation de plaisance","14"=>"D&eacute;c&egrave;s","15"=>"Assistance","16"=>"Location",
"17"=>"March transport&eacute;es","18"=>"Pr&eacute;voyance","19"=>"D&ocirc;mmage ouvrage","20"=>"Multirisque Entreprise","21"=>"Protection juridique","22"=>"Caravaning","23"=>"Incendie capitaux","24"=>"Assurances collectives",
"25"=>"Bris de machines","26"=>"Loisirs","27"=>"Garagiste OLD","28"=>"Multirisque commerce","29"=>"Garantie du conducteur","30"=>"Multirisque agricole","31"=>"Chasse","32"=>"Gr&ecirc;le","33"=>"Scolaire","34"=>"Aviation",
"35"=>"Compl&eacute;mentaire maladie","36"=>"Multirisque habitation","37"=>"RC travaux","39"=>"Multirisque immeuble","41"=>"Garagiste","42"=>"Compl&eacute;mentaire maladie Cadre","43"=>"Compl&eacute;mentaire maladie non Cadre",
"44"=>"Pr&eacute;voyance Cadre","45"=>"Pr&eacute;voyance non Cadre","46"=>"Mensualisation","47"=>"Article 82","48"=>"Article 83","49"=>"Indemnit&eacute fin de carri&egrave;re","50"=>"Assurance ch&ocirc;mage","51"=>"Retraite obligatoire tranche A",
"52"=>"Retraite obligatoire tranche B","53"=>"Compl&eacute;mentaire maladie TNS","54"=>"Pr&eacute;voyance TNS","55"=>"Chômage TNS","56"=>"Retraite TNS","57"=>"Placement","58"=>"Plan s&eacute;curit&eacute famille","59"=>"Plan &eacute;pargne &eacute;ducation",
"60"=>"Collective","61"=>"Multirisque professionnelle","1000"=>"Automobile","1001"=>"Moto ou cyclomoteur","1002"=>"Flotte automobile","1003"=>"Engins divers","1004"=>"Bateau","1005"=>"Multirisque divers","1006"=>"Mult. Garagiste",
"1007"=>"Multi. industrielle","1008"=>"Incendie risques simples","1009"=>"Incendie R.i.","1010"=>"Degats des eaux","1011"=>"N°ol","1012"=>"Bris de glaces","1013"=>"P.E. après incendie","1014"=>"R.C. particulier","1015"=>"R.C. cheval","1016"=>"R.C. m&eacute;dical",
"1017"=>"R.C. divers","1018"=>"R.C. exploitation","1019"=>"R.C. professionnelle","1020"=>"T.R. informatique","1021"=>"T.R. matriel","1022"=>"T.R. velo","1023"=>"P.E. apr&egrave;s bris de machine","1024"=>"Individuelle accidents",
"1025"=>"Groupe","1026"=>"Vie","1027"=>"Maladie","1028"=>"R.C. decennale","1029"=>"P.U.C.","1030"=>"T.R.C.","1031"=>"Loyer impaye","1033"=>"T.R. mission","1034"=>"Vol","1035"=>"Maritime et transport","1036"=>"R.I."
            );
 
 
 
 
 
 
 
// la requête
 
 
$cnx = odbc_connect("DSN_carann","root","")or die ("impossible de se connecter a la base");
 
// voici la reqûete
 
 // $sql ="select nom , prenom,numeroclient, adresse from Client , Contrat where typedecontrat = '$contratype' and typecompagnie = $compagnie and etatcontrat = $etat";
 
 
//$sql ="select CLI.IDCabinet,CLI.Denomination,CLI.Adresse,POL.Codeclient,POL.Codeetatpolice,POL.NumPolice from Client as CLI , Police as POL
//where  POL.CodeCompagnie IN ($compagnie) ";
 
 
switch ($etat){
 
    case 3 :
        $sql ="select NumPol,IDCabinet,Denomination,Adresse,Codeclient,Codeetatpolice,NumPolice,CodeCompagnie,Typedepolice from PoliceClientphp
where Typedepolice IN($contratype) and CodeCompagnie IN ($compagnie)   and Num = Codeclient
group by CodeCompagnie,Codeetatpolice,IDCabinet,Denomination,Adresse,Codeclient,NumPolice,Typedepolice,NumPol ";
 
        break ;
 
    default :
        $sql ="select NumPol,IDCabinet,Denomination,Adresse,Codeclient,Codeetatpolice,NumPolice,CodeCompagnie,Typedepolice from PoliceClientphp
where Typedepolice IN($contratype) and CodeCompagnie IN ($compagnie)  and Num = Codeclient and codeetatpolice = $etat
group by CodeCompagnie,Codeetatpolice,IDCabinet,Denomination,Adresse,Codeclient,NumPolice,Typedepolice,NumPol ";
 
        break ;
 
         // and Num = Codeclient and Codeetatpolice= $etat
    }
 
 
 
 
 
 
 
//(" . implode("','", $array_contrat) . ")" ;
 
echo $sql. "<br />";
 
 
 
  $requete = odbc_do($cnx,$sql)or die (odbc_error());
 
  echo "<table border=\"1\">";
   echo " <thead>";
       echo " <tr>";
            echo "<th>Num&eacute;ro </th>";
            echo "<th>D&eacute;nomination </th>";
           echo  "<th>Adresse </th>";
           echo "<th> Police Type </th>";
           echo  "<th>Etat police </th>";
            echo "<th>Num&eacute;ro police</th>";
            echo "<th>Compagnie </th>";
 
            echo "<th> D&eacute;tails</th>";
        echo "</tr>";
    echo "</thead>";
 
     echo "<tbody>";
 
 
         while ($result=odbc_fetch_object($requete))
             {
 
 
        echo "<tr>";
            echo "<td>$result->IDCabinet </td>";
            echo "<td>$result->Denomination</td>";
            echo  "<td>$result->Adresse</td>";
 
           echo " <td>";
                     foreach ($policetype as $val =>$donnee){
 
                switch ($result->Typedepolice){
                    case $val :
                        echo $donnee ;
                    break ;
                }
            }
 
 
 
 
            echo "</td>";
            echo  "<td>";
 
                     foreach ($etat1 as $val=>$donnee){
 
                    switch ($result->Codeetatpolice){
                        case $val:
                          echo $donnee ;
 
                        break ;
 
 
 
 
                    }
 
 
 
                       }
           echo  "</td>";
            echo  "<td>$result->NumPolice</td>";
           echo   "<td>";
 
                    foreach ($compgagnie as $val=>$donnee){
 
                       switch ($result->CodeCompagnie)
                               {
                               case $val :
 
                          echo $donnee ;
 
                       break ;
                   }
 
                   }
           echo  "</td>";
 
                 $numpol = $result->NumPol;
 
            switch($result->Typedepolice){
 
 
 
                        //Type Auto
                       case 1: case 1000: case 1001:case 1002: case 1003: case 1004:
                                  //  echo"  <td> <a href=\"Auto.php?datecreation=$creer&amp;policenum=$numpol&amp;etat=$policeetat&amp;pol=$police&amp;comte=$contrat&amp;dernier=$visite&amp;resil=$resilie&amp;echeanc=$echeance1&amp;etat1=$etat&amp;typegestion=$gestion&amp;indice=$origine&amp;ttc=$prixttc&amp;aven=$avenant&amp;dateperte=$perte&amp;dateeffet=$effet&amp;fraction=$fract&amp;client=$client&amp;num=$numero&amp;utilise=$utlisateur&amp;dossier=$complet&amp;paiement=$paie&amp;ClientNumero=$numeroClient&amp;rev=$voir&amp;compagn=$comp\"> Voir </a> </td>";
 
                                    echo"  <td> <a href=\"Auto.php?numeropolice=$numpol\"> Voir </a> </td>";
                            break ;
 
                         // type divers
 
                       case 11: case 13 : case 14:case 15:case 17:case 18:case 19:case 20: case 21:
                       case 22: case 23 :case 24 :case 26 : case 27 :case 28 :case 29:case 30:case 34:
                       case 42 : case 43 :case 44 : case 45 :case 46 : case 47 :case 48 : case 49 :
                       case 50 : case 51 : case 52 : case 53: case 54: case 55: case 56: case 57 :
                       case 58 : case 59 :case 1005: case 1006: case 1007:case 1008:case 1009: case 1010:
                       case 1011 : case 1012: case 1013: case 1014: case 1015: case 1016: case 1017 : case 1018:
                       case 1019 : case 1020 : case 1021 : case 1022 : case  1023 : case 1024 : case 1025 : case 1026:
                       case 1027 : case 1028: case 1029 : case 1030: case 1031: case 1033: case 1034: case 1035: case 1036:
                                       echo"  <td> <a href=\"Divers.php?numeropolice=$numpol\"> Voir </a> </td>";
                           break ;
 
                           // Type Multi risque habitation
                        case 36 :
 
                           //   echo"  <td> <a href=\"Habitation.php?policenum=$numpol&amp;pol=$police&amp;comte=$contrat&amp;dernier=$visite&amp;resil=$resilie&amp;echeanc=$echeance1&amp;etat1=$etat&amp;typegestion=$gestion&amp;indice=$origine&amp;ttc=$prixttc&amp;aven=$avenant&amp;dateperte=$perte&amp;dateeffet=$effet&amp;fraction=$fract&amp;client=$client&amp;num=$numero&amp;utilise=$utlisateur&amp;dossier=$complet&amp;paiement=$paie&&mp;ClientNumero=$numeroClient&amp;rev=$voir&amp;compagn=$comp\"> Voir </a> </td>";
                           // echo"  <td> <a href=\"Habitation.php?datecreation=$creer&amp;policenum=$numpol&amp;etat=$policeetat&amp;pol=$police&amp;comte=$contrat&amp;dernier=$visite&amp;resil=$resilie&amp;echeanc=$echeance1&amp;etat1=$etat&amp;typegestion=$gestion&amp;indice=$origine&amp;ttc=$prixttc&amp;aven=$avenant&amp;dateperte=$perte&amp;dateeffet=$effet&amp;fraction=$fract&amp;client=$client&amp;num=$numero&amp;utilise=$utlisateur&amp;dossier=$complet&amp;paiement=$paie&amp;ClientNumero=$numeroClient&amp;rev=$voir&amp;compagn=$comp\"> Voir </a> </td>";
                                       echo"  <td> <a href=\"Habit.php?numeropolice=$numpol\"> Voir </a> </td>";
                            break ;
 
 
                              // Multi risque commerce
                        case 35 :
 
 
                            echo"  <td> <a href=\"ComplementSante.php?numeropolice=$numpol\"> Voir </a> </td>";
 
                             // echo"  <td> <a href=\"Divers.php?datecreation=$creer&amp;policenum=$numpol&amp;etat=$policeetat&amp;pol=$police&amp;comte=$contrat&amp;dernier=$visite&amp;resil=$resilie&amp;echeanc=$echeance1&amp;etat1=$etat&amp;typegestion=$gestion&amp;indice=$origine&amp;ttc=$prixttc&amp;aven=$avenant&amp;dateperte=$perte&amp;dateeffet=$effet&amp;fraction=$fract&amp;client=$client&amp;num=$numero&amp;utilise=$utlisateur&amp;dossier=$complet&amp;paiement=$paie&amp;ClientNumero=$numeroClient&amp;rev=$voir&amp;compagn=$comp\"> Voir </a> </td>";
 
                            break ;
 
                          // Responsabilité civile
                            case 9 :
 
                                    echo"  <td> <a href=\"ResponsabiliteCiv.php?numeropolice=$numpol\"> Voir </a> </td>";
                            break ;
 
 
 
 
 
                    }
 
 
 
 
 
 
 
 
 
        echo "</tr> <br />";
 
 
 
 
 
 
 
             }
 
           echo  "</tbody>";
echo  "</table>";
 
 
 
           odbc_close( $cnx); // ferme la connexion
 
?>
mais voilà mon problème c'est au niveau de l'utilisation de IN , car quand je faisais les tests suivant :
en sélectionnant : (Police) véhicule - compagnie(AGF risques ) - etat (en cours )
l'affichage se fait comme suit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
Array
(
    [police] => Array
        (
            [0] => 1
        )
 
    [compagnie] => Array
        (
            [0] => 1074
        )
 
    [etat] => 1
    [ok] => Valider
)
<br/>type de contrat :1<br />la compagnie : 1074<br/>etat du constrat 1<br/>select NumPol,IDCabinet,Denomination,Adresse,Codeclient,Codeetatpolice,NumPolice,CodeCompagnie,Typedepolice from PoliceClientphp
where Typedepolice IN(1) and CodeCompagnie IN (1074)  and Num = Codeclient and codeetatpolice = 1
group by CodeCompagnie,Codeetatpolice,IDCabinet,Denomination,Adresse,Codeclient,NumPolice,Typedepolice,NumPol <br /><table border="1"> <thead> <tr><th>Num&eacute;ro </th><th>D&eacute;nomination </th><th>Adresse </th><th> Police Type </th><th>Etat police </th><th>Num&eacute;ro police</th><th>Compagnie </th><th> D&eacute;tails</th></tr></thead><tbody><tr><td>388 </td><td>DUBOIS Jean Marc</td><td>9 A Rue de Sentheim</td> <td>V&eacute;hicule</td><td>En cours</td><td>60805735</td><td>AGF RISQUES PARTICULIERS</td>  <td> <a href="Auto.php?numeropolice=82"> Voir </a> </td></tr> <br /><tr><td>410 </td><td>DOS SANTOS PEDRO Carlos José</td><td>12 Rue de Lesches</td> <td>V&eacute;hicule</td><td>En cours</td><td>60807288</td><td>AGF RISQUES PARTICULIERS</td>  <td> <a href="Auto.php?numeropolice=90"> Voir </a> </td></tr> <br /></tbody></table>
et on voit bien que c'est pas un problème de récupération de paramètre car ils sont tous présents et récupérés ; et quand j'ai verifié le résultat sur la base accès en faisant un tri en fonction de la requête ; c'est le même .

mais ce qui m'étonne c'est que quand , je fais un autre choix en essayant un autre choix mais cette fois -ci multiple avec :

Police (Autombile , véhicule )
compagnie(AGF risques ) - etat (en cours )

il n'affiche rien dans le résultat alors qu'auparavant , il affiche pour seulement Automobile alors c'est pour çà que je vous demande comment çà fonctionne la clause IN est ce que c'est comme le AND où toutes les conditions devraient être vrais pour afficher ou c'est comme le OU

autre question :

comment je devrai adapter mon code php pour afficher que si le résultat de la requête est nulle ; on affiche un message aucun résultat et on revient au formulaire

merci d'avance mes chers amis