-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
71 lines (68 loc) · 2.56 KB
/
Copy pathindex.php
File metadata and controls
71 lines (68 loc) · 2.56 KB
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
<?php
// session_start();
require_once 'core/init.php';
require_once 'includes/header.php';
?>
<?php
$currentdate =date('Y-m-d');
$sql = "SELECT * FROM internships i INNER JOIN employer_account a ON i.employer_id=a.employer_id AND applyBy > '$currentdate'";
$internships = $db->query($sql);
$internships = $internships->fetch_all(MYSQLI_ASSOC);
$index = sizeof($internships);
// echo $index;
$keys= 0;
?>
<body onload="">
<h2 class="text-center pt-3 text-primary" id = "key" style="margin:30px; font-size:45px; margin-top:40px; font-weight:bolder;"></h2>
<div style="margin-left:20px ;">
<div class="container-fluid row">
<!-- List of Internships -->
<?php foreach($internships as $internship):
$keys++
?>
<div class="col-md-6 <?php if($index==$keys){echo 'mx-auto col-md-6';}?>" style="margin-bottom: 20px;;">
<div class="card mt-4">
<div class="card-header" style="height: 100px;">
<h3 class="p-2 text-center card-title text-primary pt-3" style="font-size: 30px;"><?=$internship['category'];?></h3>
</div>
<div class="card-body">
<h4 class="p-2 h4-responsive float-left m-0"><b><?=$internship['employer_name'];?></b></h4>
<h5 class="p-2 h5-responsive float-right">Location: <b><?=$internship['location'];?></b></h5>
<table class="table table-bordered">
<thead>
<th>Duration</th>
<th>Stipend</th>
<th>Posted On</th>
<th>Apply By</th>
<th>Available Positions</th>
</thead>
<tbody>
<tr>
<td><?=$internship['duration'];?> months</td>
<td>₹ <?=$internship['stipend'];?></td>
<td><?=$internship['postedOn'];?></td>
<td><?=$internship['applyBy'];?></td>
<td><?=$internship['positions'];?></td>
</tr>
</tbody>
</table>
</div>
<div class="card-footer text-center">
<a href="internship.php?internship=<?=$internship['id'];?>" class="btn btn-md btn-primary waves-effect z-depth-0 text-center" style="font-size: 14px;">View Details</a>
</div>
</div>
</div>
<?php endforeach?>
</div>
<br>
</div>
<?php if($index ==0){
echo "<h4 class = 'text-center'>No Internships available right now</h4>";
}
?>
<script>
var key = document.getElementById('key');
key.innerHTML = "Available Internships (<?php echo $index?>)"
</script>
</body>
<?php require_once 'includes/footer.php'; ?>