Bonjour,
Je suis entrain de développer un formulaire de recherche de la liste des utilisateurs suivant certains critères entrés par l'utilisateur.
En effet, dans mon template FiltreSuccess.php j'ai ecrit 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
<h1>Requêtes</h1>
<div align="right"><a href="<?php echo url_for('prostate_recap/excel') ?>"  ><img src="/images/excel.jpg" alt="Exporter le résultat en excel"></a></div>
<form method="POST" action ="<?php echo url_for('prostate_recap/filtre') ?>">
    <table>
<tr style="height:20px;">
                            <th>Extempo :</th>
                            <td>
                                <input type="checkbox" name="extmY" <?php if (@$exY == '1') { ?> checked="checked" <?php } ?> value="1"/> oui
                                <input type="checkbox" name="extmN"  <?php if (@$exN == '2') { ?> checked="checked" <?php } ?> value="2"/> non
                            </td>
                        </tr>
 
                         <tr style="height:20px;">
                            <th>Recoupe :</th>
                            <td>
                                <input type="checkbox" name="recoupeY" <?php if (@$recY == '2') { ?> checked="checked" <?php } ?> value="2"/> Négatif
                                <input type="checkbox" name="recoupeN"  <?php if (@$recN == '1') { ?> checked="checked" <?php } ?> value="1"/> Positif
                            </td>
                        </tr>
 <tr><td></td><td><input class="bouton tfoot" type="submit" value="Rechercher"></td></tr>
                    </tbody>
                </table>
            </td>
            <td style="vertical-align:top;text-align:left;">
                <table>
                    <?php if (count(@$patients)): ?>
                    <?php foreach (@$patients as $d): ?>
                                        <tr>
                                            <td><?php echo @$d->getName() . "&nbsp;" . @$d->getFirstname(); ?></td>
                                        </tr>
                    <?php endforeach; ?>
                    <?php endif; ?>
                                    </table>
                                </td>
                            </tr>
                        </table>
et dans mon actions.class.php j'ai utilisé le script suivant pour l'action executeFiltre:
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
 
$extmY = $request->getParameter('extmY');
$extmN = $request->getParameter('extmN');
$recoupeY = $request->getParameter('recoupeY');
$recoupeN = $request->getParameter('recoupeN');
 $pA = Doctrine::getTable('Anapath')->createQuery('a');
        $qA = $pA->where('1 = 1');
///////////////////////////// Extempo
        if (($extmY != "") && ($extmN == "")) {
 
            $qA = $qA->addwhere('a.extemp =?', $extmY);
            $qA = $qA->execute();
 
            $tablepatientida = array('null');
            foreach ($qA as $ana) {
                $tablepatientida[] = $ana->getPatientId();
            }
//            if ($this->cnt != 0) {
            $this->tabj = array_merge($this->tabj, $tablepatientida);
            $this->exY = $extmY;
        } else if (($extmN != "") && ($extmY == "")) {
            $qA = $qA->addwhere('a.extemp =?', $extmN);
            $qA = $qA->execute();
 
            $tablepatientida = array('null');
            foreach ($qA as $ana) {
                $tablepatientida[] = $ana->getPatientId();
            }
            $this->tabj = array_merge($this->tabj, $tablepatientida);
 
 
            $this->exN = $extmN;
        }
        if (($extmN != "") && ($extmY != "")) {
            $this->exY = $extmY;
            $this->exN = $extmN;
        }
         ///////////////////////////// Recoupe
        if (($recoupeY != "") && ($recoupeN == "")) {
 
            $qA = $qA->addwhere('a.recoupe_extemp =?', $recoupeY);
            $qA = $qA->execute();
 
            $tablepatientida = array('null');
            foreach ($qA as $ana) {
                $tablepatientida[] = $ana->getPatientId();
            }
            $this->tabj = array_merge($this->tabj, $tablepatientida);
            $this->recY = $recoupeY;
        }
        else if (($recoupeN != "") && ($recoupeY == "")) {
            $qA = $qA->addwhere('a.recoupe_extemp =?', $recoupeN);
            $qA = $qA->execute();
 
            $tablepatientida = array('null');
            foreach ($qA as $ana) {
                $tablepatientida[] = $ana->getPatientId();
            }
            $this->tabj = array_merge($this->tabj, $tablepatientida);
 
 
            $this->recN = $recoupeN;
        }
        else if (($recoupeN != "") && ($recoupeY != "")) {
            $this->recY = $recoupeY;
            $this->recN = $recoupeN;
        }
  $this->patients = $q->execute();
        $this->getUser()->setAttribute("patientstable", $this->patients);
Mon probléme actuel est que lorsque je sélectionne une option de recoupe et une autre de extempo alors l'erreur suivante s'affiche:
Fatal error: Call to undefined method Doctrine_Collection::addwhere() in D:\imm1\apps\front\modules\prostate_recap\actions\actions.class.php on line 1239
Alors que si je choisi une seule option alors le fonctionnement est normal et j'obtient un résultat.
Pouvez vous m'aider pour savoir ou se situe le problème exactement pour que je puisse faire une recherche suivant plusieurs options?
Merci par avance.