-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadverts.php
102 lines (95 loc) · 3.47 KB
/
adverts.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
<table class="table table-sm"style="width:100%;">
<thead>
<?php
$company=$_REQUEST['user'];
$dbh = Db::db_connect();
$vacancies= ApiData::getData('getAdverts', $company);
$clicks= ApiData::getData('getAdverts', $company);
if($vacancies=='error found' and $clicks=='error found')
{
echo'<div class="card col-12 justify-content-center">
<div class="card-body">An error has occured Please cleck your connection and refresh page
</div>
</div>
';
}else{
?>
<tr>
<th scope="col"></th>
<th scope="col"colspan="4"style="text-align:right;">
<a href="make_pdf.php?user=<?php echo $_REQUEST['user'];?>" target="_blank" class="btn btn-sm btn-primary me-1">Advert Clicks</a>
<div class="btn-group pull-right">
<button type="button" class="btn btn-info">Action</button>
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu" id="export-menu">
<li id="export-to-excel"><a href="#">Export to excel</a></li>
<li id="export-to-csv"><a href="#">Export to csv</a></li>
</ul>
</div>
<form action="export_data.php" method="post" id="export-form">
<input type="hidden" value='' id='hidden-type' name='ExportType'/>
<input type="hidden" value='<?php echo $_REQUEST['user'];?>' id='user' name='user'/>
</form>
</th>
</tr>
<tr>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"style="text-align:center">
</th>
</tr>
<tr>
<th scope="col">Vacancy Ref</th>
<th scope="col">Job Title</th>
<th scope="col"style="text-align:center">Salary</th>
<th scope="col">ExpiryDate</th>
<th scope="col"style="text-align:center">Views</th>
</tr>
</thead>
<tbody>
<tr>
<?php
/*
$company=$_REQUEST['user'];
$dbh = Db::db_connect();
$vacancies= ApiData::getData('getAdverts', $company);
$clicks= ApiData::getData('getAdverts', $company);
if($vacancies=='error found' and $clicks=='error found')
{
echo'<div class="card justify-content-center">
<div class="card-body">An error has occured Please cleck your connection
</div>
</div>
';
}else{
*/
for($x = 0; $x < count($vacancies); $x++){
$clicks= Clicks::getClicks2($dbh,$vacancies[$x]->vacancy_ref);
?>
<td><?php echo $vacancies[$x]->vacancy_ref; ?> </td>
<td><?php echo $vacancies[$x]->job_title; ?></td>
<td align="center">
<?php
$min=substr($vacancies[$x]->salary_min,0,1)=='R' ? substr($vacancies[$x]->salary_min,1,20):$vacancies[$x]->salary_min;
$max=substr($vacancies[$x]->salary_max,0,1)=='R' ? substr($vacancies[$x]->salary_max,1,20):$vacancies[$x]->salary_max;
if(!empty($min)){$min='R'.trim($min);}
if(!empty($max)){$max='R'.trim($max);}
echo $min.' - '.$max;
?>
</td>
<td><?php echo $vacancies[$x]->expiry_date; ?></td>
<td style="text-align:center">
<?php echo $clicks['clicks'];?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>