-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoffer.php
More file actions
149 lines (124 loc) · 5.69 KB
/
offer.php
File metadata and controls
149 lines (124 loc) · 5.69 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
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
143
144
145
146
147
148
<?php
require ('includes/config.inc.php');
session_start();
$sql = "SELECT * FROM offers WHERE offer_id = '".$_GET['offer_id']."'";
$results = mysqli_query($conn, $sql);
if(mysqli_num_rows($results)>0){
while($row = mysqli_fetch_array($results)) {
$offer_id = $row['offer_id'];
$jj_id = $row['jj_id'];
$company_name = $row['company_name'];
$title = $row['title'];
$workplace_type = $row['workplace_type'];
$experience_level = $row['experience_level'];
$ctgr_id = $row['ctgr_id'];
$add_date = $row['published_at'];
$photo = $row['company_logo_url'];
$company_url = $row['company_url'];
$city = $row['city'];
$friendly = $row['open_to_hire_ukrainians'];
$full_address = $row['address_text'];
$company_size = $row['company_size'];
$ctgr_id = $row['ctgr_id'];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language"
content="język" />
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name = "author" content = "Jan Gregor" />
<title>Offer <?php echo $offer_id; ?></title>
<link rel="Stylesheet" type= "text/css" href = "css/bootstrap.min.css" />
<link rel="Stylesheet" type= "text/css" href = "css/style.css?version=1" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<header>
<?php
require_once "includes/header.inc.php"; ?>
</header>
<main>
<center>
<div id = "container" style="width:1000px; margin-top: 120px; margin-bottom: 120px;">
<h2>Look for another offer</h2><br>
<?php
require_once "includes/search.inc.php";?>
<br>
<p style="align:left;"><a href="index.php">Main Page</a> >>> <?php $query = "SELECT * FROM ctgrs WHERE ctgr_id = '$ctgr_id';";
$results = mysqli_query($conn, $query);
while($row = mysqli_fetch_array($results)) {
?>
<a href="search.php?view=list&ctgr=<?php echo $row['ctgr_id'];?>"><?php echo $row['category']; } ?> </a></p>
<?php
$results = mysqli_query($conn, $sql); ?>
<h5>Title: </h5><h4><?php echo $title; ?></h4> <br><br>
<h5>Image: </h5>
<img id="image" style = "width:100px; height:100px; margin-left:20px; border-radius:50%;" src="<?php echo $photo; ?>">
<br><br><br>
<div id="map-container-google-9" class="z-depth-1-half map-container-5" style="height: 300px">
<h5>Location: </h5> <h4><?php echo $full_address; ?></h4> <br><br>
<iframe src="https://maps.google.com/maps?q=<?php echo $full_address; ?>&t=&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0"
style="border:0" allowfullscreen></iframe>
</div><br>
<h5>Offer address: </h5> <a href="<?php $link_address = 'https://justjoin.it/offers/' . $jj_id;
echo $link_address; ?>"><?php echo $link_address; ?></a> <br><br>
<h5>Company name & address: </h5> <a href="<?php
echo $company_url; ?>"><?php echo $company_name . ', ' . $company_url; ?></a> <br><br>
<h5>Skillset: </h5>
<?php
$query_skills = "SELECT * FROM skills WHERE jj_id = '$jj_id';";
$results_skills = mysqli_query($conn, $query_skills);
while($row = mysqli_fetch_array($results_skills)) {
$skill_name = $row['name'];
$skill_level = $row['level'];
?><h4><?php
echo $skill_name . ': ' . $skill_level . '/5 '; ?></h4><?php }?>
<br><br>
<h5>Employment: </h5>
<?php
$query_empl = "SELECT * FROM employment WHERE jj_id = '$jj_id';";
$results_empl = mysqli_query($conn, $query_empl);
while($row = mysqli_fetch_array($results_empl)) {
$empl_type = $row['type'];
$min = $row['from'];
$max = $row['to'];
$currency = $row['currency'];
?><h4><?php
echo $empl_type . ': ' . $min . ' - '. $max . ' ' . $currency; ?></h4><?php }?>
<br><br>
<?php if (isset($_SESSION['userid'])) { ?>
<p><form method = "post" action = "includes/observe.inc.php">
<input type="number" name="f_offer_id" value="<?php echo $offer_id; ?>" hidden>
<button type="submit" name="f_submit" class="btn-warning round">Observe</button></form></p> <?php
if(isset($_GET["error"])){
if ($_GET["error"] == "stmtfailed"){
echo "<h2 style='color:red;'>Something went wrong. try again!</h2>";
}
else if ($_GET["error"] == "alreadywatched"){
echo "<h2 style='color:red;'>You are already watching this offer!</h2>";
}
else {
echo "<h2 style='color:blue;'>Added to watchlist!</h2>";
}
}
} ?>
</div>
</main>
<footer>
<?php
require_once "includes/footer.inc.php"; ?>
</footer>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/toggleDarkLight.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery.js"> </script>
</body>
</html>
<?php $conn->close(); ?>