-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrudReclamation.php
59 lines (40 loc) · 1.58 KB
/
crudReclamation.php
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
<?php
//include("../classes/Reclamation.php");
//include("../classes/Repository.php");
require_once('ConnexionBD.php');
class crudReclamation {
public $bd;
function __construct()
{
$this->bd=ConnexionBD::getInstance();
// parent::__construct('reclamation');
}
function insertReclamation($rep){
$req1="INSERT INTO reclamation (Description,Sujet,IDClient)
VALUES ('".$rep->getDescription()."','".$rep->getSujet()."','".$rep->getIDclient()."')";
$this->bd->query($req1);
}
function afficheReclamation(){
$req="SELECT * FROM reclamation";
$liste=$this->bd->query($req);
return $liste->fetchAll();
}
function recupererReclamation($IDReclamation){
$req="SELECT * FROM reclamation WHERE IDReclamation=".$IDReclamation;
$rep=$this->bd->query($req);
return $rep->fetchAll();
}
function modifierReclamation($rep){
$req1="UPDATE reclamation SET IDReclamation='".$rep->getIDReclamation()."',Description='".$rep->getDescription()."',Sujet='".$rep->getSujet()."',IDClient='".$rep->getIDClient()."' WHERE IDReclamation=".$rep->getIDReclamation();
$this->bd->exec($req1); }
function supprimerReclamation($IDReclamation){
$req1="DELETE FROM reclamation where IDReclamation=".$IDReclamation;
$this->bd->exec($req1);
}
function rechercheReclamation ($Description){
$req="SELECT * FROM reclamation where reclamation.Description LIKE '%".$Description . "%'" ;
$liste=$this->bd->query($req);
return ($liste->fetchAll());
}
}
?>