Bonjour,
j'ai crée un formulaire avec un liste déroulante qui récupère tous les employés(nom et prénom) de la table vente avec son id_vente dans la vue index.phtml,mais je veux récupérer le nom et prénom de l'employé vers la vue selectionner.phtml et voici mes codes:
controleur:selectionnerActionla vue index.phtml:
Code php : 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 public function selectionnerAction() { $table = new Vente(); $select = $table->select()->from($table); $users = $table->fetchAll($select); $this->view->employe= $users; $idstatis=$this->_request->getParam('id', 0); $this->view->stat=$idstatis; if($this->_request->isPost()) { $employe=new Vente() ; $id_ventes=$this->_request->getParam('id'); $where2='id_vente='.$id_ventes; $this->view->employe=$employe->fetchRow($where2); $employe1=new Vente() ; $select=$employe1->select() ->from(array('vente') } }
la vue selectionner.phtml:
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 <?php $this->headTitle('~JAMAL~ Selection d\'un client '); ?> <h4></h4> <h2>Statistiques des ventes par jour</h2> <fieldset><legend>Sélectionner l'employeur:</legend> <form method="post" action ="<?php echo $this->url{array('action'=>'Selectionner', 'id'=>$employe->id_vente)}; ?>" > <table> <tr><td> <fieldset><legend> </legend> <table cellpadding="0" cellspacing="0" border="0"> <h2> Sélectionner un employé : </h2> <tr><td align="center"><?php echo $this->form->em; ?></td > </tr> </table> </fieldset> </td> <tr><td align="center"><?php echo $this->form->submit; ?></td ><td></td> </tr> </table></form> </fieldset>
mais durant l'éxecution voici ce qui me donne:
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 <?php $this->headTitle('~Opticien ~ Statistiques des ventes par jour'); $this->setEncoding('UTF-8'); require_once 'persistances/Client.php'; require_once 'persistances/Vente.php'; require_once 'persistances/Mesure.php'; ?> <?php $id = $this->stat;?> <?php if ($id ==null) : ?> <h4></h4> <h2>Statistiques des ventes par jour</h2> <fieldset> <table> <tr><h3>Employé:<?php echo $this->escape($this->employe->nom_empv).' '. $this->escape($this->employe->prenom_empv); ?></h3><td> <fieldset><legend> </legend> <table cellpadding="0" cellspacing="0" border="0"> <h2> </h2> <tr><td align="center"> </td > </tr> </table> </fieldset> </td> <tr><td align="center"></td ><td></td> </tr> </table> <?php endif;?> </fieldset>
Donc ici ou est le problème?Not Found
The requested URL /Opticien/public/index.php/<br /><b>Notice</b>: Undefined variable: employe in <b>C:\wamp\www\Opticien\application\default\views\scripts\statis\index.phtml</b> on line <b>12</b><br /><br /><b>Notice</b>: Trying to get property of non-object in <b>C:\wamp\www\Opticien\application\default\views\scripts\statis\index.phtml</b> on line <b>12</b><br /> was not found on this server.
Et merci pour vos réponses
Partager