-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.php
110 lines (106 loc) · 2.97 KB
/
client.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
include_once "operation.php";
include_once "Database.php";
ob_start();
// session_start();
class client extends Database implements operation {
var $clientID;
var $name;
// var $type;
var $email;
var $password;
var $username;
var $gender;
var $address;
var $phone;
var $img;
public function getClid(){
return $this->clientID;
}
public function setClid($id){
$this->clientID=$id;
}
public function getname(){
return $this->name;
}
public function setname($name){
$this->name=$name;
}
// public function gettype(){
// return $this->type;
// }
// public function settype($type){
// $this->type=$type;
// }
public function getemail(){
return $this->email;
}
public function setemail($mail){
$this->email=$mail;
}
public function getpass(){
return $this->password;
}
public function setpass($pass){
$this->password=$pass;
}
public function getusername(){
return $this->username;
}
public function setusername($name){
$this->username=$name;
}
public function getgender(){
return $this->gender;
}
public function setgender($gender){
$this->gender=$gender;
}
public function getaddress(){
return $this->address;
}
public function setaddress($address){
$this->address=$address;
}
public function getphone(){
return $this->phone;
}
public function setphone($phone){
$this->phone=$phone;
}
public function getimg(){
return $this->img;
}
public function setimg($img){
$this->img=$img;
}
public function Add(){
return parent::RunDML("insert into client values(Default,'".$this->getname()."','".$this->getemail()."','".$this->getpass()."','".$this->getusername()."','".$this->getgender()."','".$this->getphone()."','".$this->getaddress()."',Default)");
}
public function Update(){
return parent::RunDML("update client set name='".$this->getname()."', email='".$this->getemail()."', password='".$this->getpass()."',username='".$this->getusername()."',gender='".$this->getgender()."', phone='".$this->getphone()."', address='".$this->getaddress()."', img='".$this->getimg()."' where ClientID='".$_SESSION['id']."'");
}
public function Delete(){
return parent::RunDML("delete from client where ClientID='".$_SESSION['id']."'");
}
public function GetAll(){
$rs= parent::GetData("select * from client ");
return $rs;
}
public function login(){
$rs= parent::GetData("select * from client where (email='".$this->getemail()."' or phone='".$this->getphone()."') and password='".$this->getpass()."'");
return $rs;
}
public function getById(){
$rs= parent::GetData("select * from client where ClientID='".$_SESSION['id']."'");
return $rs;
}
public function getByEmail(){
$rs= parent::GetData("select * from client where email='".$this->getemail()."'");
return $rs;
}
public function UpdatePW(){
return parent::RunDML("update client set password='".$this->getpass()."' where ClientID='".$_GET["id"]."'");
}
}
?>