Bonjour,
Je veux afficher à partir de la base de donnée la liste des patients qui ont les paramètres sélectionnées.
Mon probléme est que dans l'affichage une seule condition(un seul select) est pris en considération alors que j'ai selectionné deux option et le résultat doit retourner plus de patient.
Ci joint une partie de mon template:
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
 
 <tr>
                    <td>
                      Stade pT  :
                        <select  name="pt"  multiple="multiple" >
                            <option value="">  </option>
                            <option value="1" <?php if(@$ptt == 1) { ?> selected <?php } ?>>pTx </option>
                            <option value="2" <?php if(@$ptt == 2) { ?> selected <?php } ?>>pT0</option>
                            <option value="3" <?php if(@$ptt == 3) { ?> selected <?php } ?>>pT1a</option>
                            <option value="4" <?php if(@$ptt == 4) { ?> selected <?php } ?>>pT1b</option>
                            <option value="5" <?php if(@$ptt == 5) { ?> selected <?php } ?>>pT1c</option>
                            <option value="6" <?php if(@$ptt == 6) { ?> selected <?php } ?>>pT2a</option>
                            <option value="7" <?php if(@$ptt == 7) { ?> selected <?php } ?>>pT2b</option>
                            <option value="8" <?php if(@$ptt == 8) { ?> selected <?php } ?>>pT2c</option>
                            <option value="9" <?php if(@$ptt == 9) { ?> selected <?php } ?>>pT3a</option>
                            <option value="10" <?php if(@$ptt == 10) { ?> selected <?php } ?>>pT3b</option>
                            <option value="11" <?php if(@$ptt == 11) { ?> selected <?php } ?>>pT3c</option>
                            <option value="12" <?php if(@$ptt == 12) { ?> selected <?php } ?>>pT4</option>
                        </select>
                    </td>
                </tr>
.............
 <?php if(count(@$patients)): ?>
            <?php foreach (@$patients as $d): ?>
 
                <tr>
                    <td><?php echo @$d->getName()."    ".@$d->getFirstname() ; ?></td>
 
               </tr>
            <?php endforeach; ?>
               <?php endif; ?>
Et celui de mon action est le suivant:
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
 
 $stadept = $request->getParameter('pt');
 if ($stadept != "") {
            $anapaths = Doctrine::getTable('Anapath')->createQuery('b')->where('b.stade_pt =?', $stadept)->execute();
            $tablepatientid = array('null');
            foreach ($anapaths as $anapath) {
                $tablepatientid[] = $anapath->getPatientId();
            }
            if($this->cnt != 0)
            {
               $this->tabj=array_merge($this->tabj,$tablepatientid);
               $this->tabj = $this->array_doublon($this->tabj);
            }
            else
            {
               $this->tabj=array_merge($this->tabj,$tablepatientid);
            }
            $this->ptt = $stadept;
        }
Pouvez vous m'aider pour que lorsque je selectionne deux options(par exemple pTx et pT0) alors les patients qui ont ces valeurs dans anapath s'affichent.