-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview-categorywise-job.php
308 lines (202 loc) · 8.45 KB
/
view-categorywise-job.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php
session_start();
error_reporting(0);
include('includes/config.php');
$vid=$_GET['viewid'];
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Job Portal || Categorywise Job</title>
<!--CUSTOM CSS-->
<link href="css/custom.css" rel="stylesheet" type="text/css">
<!--BOOTSTRAP CSS-->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<!--COLOR CSS-->
<link href="css/color.css" rel="stylesheet" type="text/css">
<!--RESPONSIVE CSS-->
<link href="css/responsive.css" rel="stylesheet" type="text/css">
<!--OWL CAROUSEL CSS-->
<link href="css/owl.carousel.css" rel="stylesheet" type="text/css">
<!--FONTAWESOME CSS-->
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!--SCROLL FOR SIDEBAR NAVIGATION-->
<link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css">
<!--GOOGLE FONTS-->
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,500,700,900' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="theme-style-1">
<!--WRAPPER START-->
<div id="wrapper">
<!--HEADER START-->
<?php include_once('includes/header.php');?>
<!--HEADER END-->
<!--MAIN START-->
<div id="main">
<!--POPULAR JOB CATEGORIES START-->
<!--POPULAR JOB CATEGORIES END-->
<!--RECENT JOB SECTION START-->
<section class="recent-row padd-tb">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-8">
<div id="content-area">
<h2 style="color: red">Job belong's to category <?php echo htmlentities($_GET['viewid']);?></h2>
<hr />
<ul id="myList">
<li>
<?php
if (isset($_GET['page_no']) && $_GET['page_no']!="") {
$page_no = $_GET['page_no'];
} else {
$page_no = 1;
}
// Formula for pagination
$no_of_records_per_page = 5;
$offset = ($page_no-1) * $no_of_records_per_page;
$previous_page = $page_no - 1;
$next_page = $page_no + 1;
$adjacents = "2";
$ret = "SELECT jobId FROM tbljobs where isActive='1' and tbljobs.jobCategory=:vid ";
$query1 = $dbh -> prepare($ret);
$query1->bindParam(':vid',$vid,PDO::PARAM_STR);
$query1->execute();
$results1=$query1->fetchAll(PDO::FETCH_OBJ);
$total_rows=$query1->rowCount();
$total_no_of_pages = ceil($total_rows / $no_of_records_per_page);
$second_last = $total_no_of_pages - 1; // total page minus 1
$vid=$_GET['viewid'];
$sql="SELECT tbljobs.*,tblemployers.CompnayLogo,tblemployers.CompnayName from tbljobs join tblemployers on tblemployers.id=tbljobs.employerId where tbljobs.jobCategory=:vid and isActive='1' LIMIT $offset, $no_of_records_per_page";
$query = $dbh -> prepare($sql);
$query->bindParam(':vid',$vid,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{ ?>
<div class="box">
<div class="thumb"><a href="jobs-details.php?jid=<?php echo ($row->jobId);?>"><img src="employers/employerslogo/<?php echo $row->CompnayLogo;?>" width="100" height="100"></a></div>
<div class="text-col">
<h4><a href="jobs-details.php?jid=<?php echo ($row->jobId);?>"><?php echo htmlentities($row->jobTitle);?></a></h4>
<p><?php echo htmlentities($row->CompnayName);?></p>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="text"><i class="fa fa-map-marker"></i><?php echo htmlentities($row->jobLocation);?></a> <a href="#" class="text"><i class="fa fa-calendar"></i><?php echo htmlentities($row->postinDate);?> </a> </div>
<strong class="price"><i class="fa fa-money"></i>$<?php echo htmlentities($row->salaryPackage);?></strong>
<?php if($row->jobType=="Full Time"){ ?>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="btn-1 btn-color-2 ripple"><?php echo htmlentities($row->jobType);?></a>
<?php } if($row->jobType=="Contract") { ?>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="btn-1 btn-color-4 ripple"><?php echo htmlentities($row->jobType);?></a>
<?php } if($row->jobType=="Freelance") { ?>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="btn-1 btn-color-3 ripple"><?php echo htmlentities($row->jobType);?></a>
<?php } if($row->jobType=="Part Time") { ?>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="btn-1 btn-color-1 ripple"><?php echo htmlentities($row->jobType);?></a>
<?php } if($row->jobType=="Internship") { ?>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="btn-1 btn-color-2 ripple"><?php echo htmlentities($row->jobType);?></a>
<?php } if($row->jobType=="Temporary") { ?>
<a href="jobs-details.php?jid=<?php echo ($row->jobId);?>" class="btn-1 btn-color-3 ripple"><?php echo htmlentities($row->jobType);?></a>
<?php } ?>
</div>
</li>
<?php $cnt=$cnt+1;}} ?>
</ul>
<div align="left">
<ul class="pagination">
<li <?php if($page_no <= 1){ echo "class='disabled'"; } ?>>
<a <?php if($page_no > 1){ echo "href='?page_no=$previous_page'"; } ?>>Previous</a>
</li>
<?php
if ($total_no_of_pages <= 10){
for ($counter = 1; $counter <= $total_no_of_pages; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
elseif($total_no_of_pages > 10){
if($page_no <= 4) {
for ($counter = 1; $counter < 8; $counter++){
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}
elseif($page_no > 4 && $page_no < $total_no_of_pages - 4) {
echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";
for ($counter = $page_no - $adjacents; $counter <= $page_no + $adjacents; $counter++) {
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
echo "<li><a>...</a></li>";
echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
}
else {
echo "<li><a href='?page_no=1'>1</a></li>";
echo "<li><a href='?page_no=2'>2</a></li>";
echo "<li><a>...</a></li>";
for ($counter = $total_no_of_pages - 6; $counter <= $total_no_of_pages; $counter++) {
if ($counter == $page_no) {
echo "<li class='active'><a>$counter</a></li>";
}else{
echo "<li><a href='?page_no=$counter'>$counter</a></li>";
}
}
}
}
?>
<li <?php if($page_no >= $total_no_of_pages){ echo "class='disabled'"; } ?>>
<a <?php if($page_no < $total_no_of_pages) { echo "href='?page_no=$next_page'"; } ?>>Next</a>
</li>
<?php if($page_no < $total_no_of_pages){
echo "<li><a href='?page_no=$total_no_of_pages'>Last ››</a></li>";
} ?>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<!--RECENT JOB SECTION END-->
</div>
<!--MAIN END-->
<!--FOOTER START-->
<?php include_once('includes/footer.php');?>
<!--FOOTER END-->
</div>
<!--WRAPPER END-->
<!--jQuery START-->
<!--JQUERY MIN JS-->
<script src="js/jquery-1.11.3.min.js"></script>
<!--BOOTSTRAP JS-->
<script src="js/bootstrap.min.js"></script>
<!--OWL CAROUSEL JS-->
<script src="js/owl.carousel.min.js"></script>
<!--BANNER ZOOM OUT IN-->
<script src="js/jquery.velocity.min.js"></script>
<script src="js/jquery.kenburnsy.js"></script>
<!--SCROLL FOR SIDEBAR NAVIGATION-->
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<!--CUSTOM JS-->
<script src="js/custom.js"></script>
</body>
</html>