-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
142 lines (127 loc) · 6.23 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
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
<?php
include('./config/db.php');
include('./action/core.php');
// Create Instance of core class
$obj = new dataOperaion;
include('./partials/session-manager.php');
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- custom stylesheet -->
<link rel="stylesheet" href="./assets/css/style.css">
<title>Intern-Connect | Equip yourself</title>
</head>
<body>
<!-- Include Nav -->
<?php include('./partials/nav.php'); ?>
<div class="container">
<div class="row">
<div class="col-md-12">
<h3 class="pt-3 text-center text-muted">Internships</h3>
</div>
</div>
<?php
$internships = $obj->fetch("internships");
if(count($internships) == 0){
echo '
<div class="row py-3">
<div class="col-md-10 m-auto">
<div class="card shadow p-3 mb-5 bg-white rounded">
<div class="card-body">
<h3>No Internships Posted Yet.</h3>
<hr>
<p>Internships will be posted soon!</p>
</div>
</div>
</div>
</div>';
}
foreach($internships as $row){
$internship_id = $row['id'];
$title = $row['title'];
$start_date = $row['start_date'];
$end_date = $row['end_date'];
$posted_by = $row['posted_by'];
$duration = $row['duration'];
$stipend = $row['stipend'];
$duration_week = $row['duration_week'];
$stipend_week = $row['stipend_week'];
$about_internship = $row['about_internship'];
$number_of_interns = $row['number_of_interns'];
$who_can = $row['who_can'];
$part_time_allowed = $row['part_time_allowed'];
$posted_at = $row['posted_at'];
$company = $obj->fetchConditionally("employers", "id", $posted_by);
foreach ($company as $employer) {
$company_name = $employer['company_name'];
$about_company = $employer['about'];
$company_url = $employer['company_url'];
}
?>
<div class="row py-3">
<div class="col-md-10 m-auto">
<div class="card shadow p-3 mb-5 bg-white rounded">
<div class="card-body">
<h4 class="py-2"><a href="internship-details.php?id=<?= $internship_id ?>"><?= $title ?></a></h4>
<h6 class="card-subtitle mb-2 text-muted"><?= $company_name ?></h6>
<h6 class="card-subtitle my-4 text-muted">Location(s):
<?php
$sql = "SELECT * FROM internship_locations il INNER JOIN locations l ON il.location_id = l.id WHERE il.internship_id = $internship_id";
$locations = $obj->custom_query($sql);
foreach ($locations as $loc) {
echo $loc['city_name'] . ', ';
}
?>
</h6>
<div class="table-responsive">
<table class="table table-borderless">
<thead>
<tr class="text-muted">
<th>Start Date</th>
<th>Duration</th>
<th>Stipend</th>
<th>Posted On</th>
<th>Apply By</th>
</tr>
</thead>
<tbody>
<tr>
<td><?= date('d M Y', strtotime($start_date)); ?></td>
<td><?= $duration, $duration_week == 0?'<span> month(s)</span>':'<span> week(s)</span>' ?> </td>
<td>Rs. <?= $stipend, $stipend_week == 0?'<span> month</span>':'<span> week</span>' ?></td>
<td><?= date('d M Y', strtotime($posted_at)); ?></td>
<td><?= date('d M Y', strtotime($end_date)); ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card-footer py-1">
<?php
if($part_time_allowed == 0){
echo '<span class="text-muted float-left">full time</span>';
}else{
echo '<span class="text-muted float-left">part time allowed</span>';
}
?>
<a class="float-right text-info" href="internship-details.php?id=<?= $internship_id ?>">VIEW DETAILS</a>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<!-- Container -->
<?php include('./partials/footer.php'); ?>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>