-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs.php
139 lines (122 loc) · 4.23 KB
/
jobs.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
class howlr2
{
private $id;
private $name;
private $addr;
private $info;
private $lat;
private $lng;
private $site;
private $htmlcss;
private $phpjs;
private $java;
private $c;
private $cpp;
private $pyth;
private $aiml;
private $conn;
private $tableName = "jobs";
function setId($id) { $this->id = $id; }
function getId() { return $this->id; }
function setName($name) { $this->name = $name; }
function getName() { return $this->name; }
function setAddr($addr) { $this->addr = $addr; }
function getAddr() { return $this->addr; }
function setInfo($info) { $this->info = $info; }
function getInfo() { return $this->info; }
function setLat($lat) { $this->lat = $lat; }
function getLat() { return $this->lat; }
function setLng($lng) { $this->lng = $lng; }
function getLng() { return $this->lng; }
function setSite($site) { $this->site = $site; }
function getSite() { return $this->site; }
function setHtmlcss($htmlcss) { $this->htmlcss = $htmlcss; }
function getHtmlcss() { return $this->htmlcss; }
function setPhpjs($phpjs) { $this->phpjs = $phpjs; }
function getPhpjs() { return $this->phpjs; }
function setJava($java) { $this->java = $java; }
function getJava() { return $this->java; }
function setC($c) { $this->c = $c; }
function getC() { return $this->c; }
function setCpp($cpp) { $this->cpp = $cpp; }
function getCpp() { return $this->cpp; }
function setPyth($pyth) { $this->pyth = $pyth; }
function getPyth() { return $this->pyth; }
function setAiml($aiml) { $this->aiml = $aiml; }
function getAiml() { return $this->aiml; }
public function __construct()
{
require_once('db/DbConnect.php');
$conn = new DbConnect;
$this->conn = $conn->connect();
}
public function getBlankLatLng() {
$sql = "SELECT * FROM $this->tableName WHERE lat IS NULL AND lng IS NULL";
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getAll() {
$sql = "SELECT * FROM $this->tableName";
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getHC() {
$sql = "SELECT * FROM $this->tableName WHERE htmlcss=1";
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getPJ() {
$sql = "SELECT * FROM $this->tableName WHERE phpjs=1";
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getFS() {
$sql = "SELECT * FROM $this->tableName WHERE phpjs=1 AND htmlcss=1" ;
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getCP() {
$sql = "SELECT * FROM $this->tableName WHERE c=1" ;
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getJ() {
$sql = "SELECT * FROM $this->tableName WHERE java=1" ;
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getP() {
$sql = "SELECT * FROM $this->tableName WHERE pyth=1" ;
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getAI() {
$sql = "SELECT * FROM $this->tableName WHERE aiml=1" ;
$stmt = $this->conn->prepare($sql);
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function updateLatLngJobs() {
$sql = "UPDATE $this->tableName SET lat = :lat, lng = :lng WHERE id = :id";
$stmt = $this->conn->prepare($sql);
$stmt->bindParam(':lat', $this->lat);
$stmt->bindParam(':lng', $this->lng);
$stmt->bindParam(':id', $this->id);
if ($stmt->execute()) {
return true;
}
else {
return false;
}
}
}
?>