|
22 | 22 | require_once '../core/requetes.php'; |
23 | 23 | require_once '../core/session.php'; |
24 | 24 |
|
25 | | -if (is_valid_session() === 'oressource' && is_allowed_verifications()) { |
| 25 | +if (is_valid_session() && is_allowed_verifications()) { |
26 | 26 | require_once '../moteur/dbconfig.php'; |
27 | | - require_once 'tete.php'; |
28 | 27 |
|
29 | 28 | $users = map_by(utilisateurs($bdd), 'id'); |
30 | 29 |
|
31 | 30 | $id = $_GET['nvente']; |
32 | | - $req = $bdd->prepare('SELECT |
33 | | - vendus.id, |
34 | | - vendus.timestamp, |
35 | | - type_dechets.nom type, |
36 | | - grille_objets.nom objet, |
37 | | - vendus.remboursement, |
38 | | - vendus.quantite, |
39 | | - FROM vendus, type_dechets, grille_objets |
40 | | - WHERE vendus.id_vente = :id_vente |
41 | | - AND grille_objets.id = vendus.id_objet |
42 | | - AND type_dechets.id = vendus.id_type_dechet'); |
43 | | - $req->execute(['id_vente' => $id]); |
44 | | - $rembs = $req->fetchAll(PDO::FETCH_ASSOC); |
45 | | - $req->closeCursor(); |
| 31 | + $rembs = vendu_by_id_vente($bdd, $id); |
| 32 | + |
| 33 | + require_once 'tete.php'; |
46 | 34 | ?> |
47 | 35 | <div class="container"> |
48 | 36 | <h1>Modifier le remboursement n° <?= $_GET['nvente']; ?></h1> |
|
76 | 64 | <td><?= $r['objet']; ?></td> |
77 | 65 | <td><?= $r['quantite']; ?></td> |
78 | 66 | <td><?= $r['remboursement']; ?></td> |
79 | | - <td><?= $users[$v['id_createur']]['mail'] ?></td> |
| 67 | + <td><?= $users[$r['id_createur']]['mail'] ?></td> |
80 | 68 | <td><form action="modification_verification_objet_remboursement.php" method="post"> |
81 | 69 | <input type="hidden" name="id" value="<?= $r['id']; ?>"> |
82 | 70 | <input type="hidden" name="nvente" value="<?= $id ?>"> |
|
87 | 75 | <input type="hidden" name="npoint" value="<?= $_POST['npoint']; ?>"> |
88 | 76 | <button class="btn btn-warning btn-sm">Modifier</button> |
89 | 77 | </form> |
90 | | - <td><?= $v['last_hero_timestamp'] !== $v['timestamp'] ? $users[$v['id_last_hero']]['mail'] : '' ?></td> |
91 | | - <td><?= $v['last_hero_timestamp'] !== $v['timestamp'] ? $v['last_hero_timestamp'] : '' ?></td> |
| 78 | + <td><?= $r['last_hero_timestamp'] !== $r['timestamp'] ? $users[$r['id_last_hero']]['mail'] : '' ?></td> |
| 79 | + <td><?= $r['last_hero_timestamp'] !== $r['timestamp'] ? $r['last_hero_timestamp'] : '' ?></td> |
92 | 80 | </tr> |
93 | 81 | <?php } ?> |
94 | 82 | </tbody> |
|
0 commit comments