CSY2028-assignment-2/templates/job_table.html.php

44 lines
1.4 KiB
PHP
Raw Normal View History

2023-01-25 14:25:37 +00:00
<h2>Jobs</h2>
2023-02-04 21:34:17 +00:00
<a class="new" href="/portal/addJob">Add new job</a>
2023-01-25 16:16:14 +00:00
<form method="get" action="/portal">
2023-01-25 16:06:44 +00:00
<label for="filter">Filter:</label>
<select name="filter">
<?php foreach ($cats as $cat) { ?>
<option value="<?=$cat->id?>"><?=$cat->name?></option>
<?php } ?>
</select>
<input type="submit" name="submit" value="filter" />
2023-01-25 16:27:08 +00:00
</form>
2023-01-25 14:25:37 +00:00
<table>
<thead>
<tr>
<th>Title</th>
<th style="width: 15%">Salary</th>
2023-01-25 15:52:32 +00:00
<th>Category</th>
2023-01-25 14:25:37 +00:00
<th style="width: 5%">&nbsp;</th>
<th style="width: 15%">&nbsp;</th>
<th style="width: 5%">&nbsp;</th>
<th style="width: 5%">&nbsp;</th>
</tr>
<?php foreach ($jobs as $job) { ?>
<tr>
<td><?=$job->title?></td>
<td><?=$job->salary?></td>
2023-01-25 15:52:32 +00:00
<td><?=$job->getCat()->name?></td>
2023-01-25 15:37:06 +00:00
<td><a style="float: right" href="portal/edit?job_id=<?=$job->id?>">Edit</a></td>
2023-02-05 12:07:41 +00:00
<td><a style="float: right" href="portal/applicants?job_id=<?=$job->id?>">View applicants (<?=count($job->getApps())?>)</a></td>
<td>
<form method="post" action="portal/">
<input type="hidden" name="job_id" value="<?=$job->id?>" />
<?php if (date('y-m-d', strtotime($job->closingDate)) > date('y-m-d')) { ?>
<input type="submit" name="submit" value="Archive" />
<?php }
else { ?>
<input type="submit" name="submit" value="List" />
<?php } ?>
</form>
</td>
2023-01-25 14:25:37 +00:00
</tr>
<?php } ?>
</thead>
</table>