forked from beisong7/career
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
115 lines (81 loc) · 3.14 KB
/
index.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
<?php
$active = null;
include_once ('config/director.php');
include_once('layout/header.php');
include_once ('core/alldata.php');
?>
<br>
<div style="">
<div class="row">
<div class="col-md-6">
<div href="employee.html" class="imgholder">
<img class="imgfit" src="public/images/js.png">
<br>
</div>
</div>
<!-- right side-->
<div class="col-md-6">
<div href="employer.html" class="imgholder">
<img class="imgfit" src="public/images/ep.png">
<br>
</div>
</div>
</div>
</div>
<br>
<?php
$jobs = allJobs();
//sort by salary
$jobsTopPay = $jobs;
usort($jobsTopPay, function($a,$b){
return $b['salary'] <=> $a['salary']; // <=> or - depending on your php engine version
});
//sort by when added
$newJobs = $jobs;
usort($newJobs, function($a,$b){
return $b['id'] <=> $a['id']; // <=> or - depending on your php engine version
});
?>
<div class="row" >
<div class=" col-md-7">
<h4>Top Paying Jobs
<a href="view_all_jobs.php" class="pull-right btn btn-xs btn-success" style="margin-right: 10%">
<strong style="margin: 0 10px; color: #fff"><i class="fa fa-list"></i> View All Jobs</strong>
</a></h4>
<div>
<ul class="list-group dot" id="topjobs">
<!-- --><?php //var_dump($jobsTopPay); ?>
<?php foreach ($jobsTopPay as $job){ ?>
<a class="list-group-item" href="job_view.php?id=<?php echo $job['id']?>&table=jobs">
<div class="mli">
<span><i class="fa fa-building"></i> <?php echo $job['title']?></span>
<span><i class="fa fa-map-marker"></i> <?php echo jobAuthor($job['com_id'], 'location')?> </span>
<hr>
<div><span><?php echo $job['description'] ?></span></div>
<hr>
<div><span>Salary <i class="fa fa-money"></i> : </span> <?php echo "N " . number_format($job['salary'], 2); ?></div>
</div>
</a>
<?php } ?>
</ul>
</div>
</div>
<div class="col-md-5">
<h4>Most Recent Jobs</h4>
<div>
<ul class="list-group dot" id="recentjobs">
<?php foreach ($newJobs as $job){ ?>
<a class="list-group-item" href="job_view.php?id=<?php echo $job['id']?>&table=jobs">
<div class="row">
<div class="col-xs-3"><span><b><?php echo $job['title'] ?></b></span></div>
<div class="col-xs-8"><span><?php echo $job['description'] ?></span></div>
</div>
</a>
<?php } ?>
</ul>
</div>
</div>
</div>
<?php
include_once 'layout/footer.php';
?>