-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.php
More file actions
78 lines (58 loc) · 2.36 KB
/
events.php
File metadata and controls
78 lines (58 loc) · 2.36 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
<?php
include 'import.php';
$cities = $_GET['cities'];
$currency_val = $_GET['radios'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Events</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div id="content">
<?php
foreach ($hackathons as $hackathon) {
$place = $hackathon->place;
$place = split(',', $place);
$country = $place[1];
$place = $place[0];
//$code = getCode($place, $country);
$result = file_get_contents("http://partners.api.skyscanner.net/apiservices/autosuggest/v1.0/ES/EUR/en-EN/?query=".$place."&apiKey=ah229592831881725379481999349293");
$result = json_decode($result);
//var_dump($result);
$code = $result->Places[0]->PlaceId;
if($code === NULL) {
$result1 = file_get_contents("http://partners.api.skyscanner.net/apiservices/autosuggest/v1.0/ES/EUR/en-EN/?query=".$country."&apiKey=ah229592831881725379481999349293");
$code = $result1->Places[0]->PlaceId;
}
$code_cities = file_get_contents("http://partners.api.skyscanner.net/apiservices/autosuggest/v1.0/ES/EUR/en-EN/?query=".$cities."&apiKey=ah229592831881725379481999349293");
$code_cities = json_decode($code_cities);
//echo $cities,"<br/>";
//echo "CITIEEEES: ",$code_cities,"<br/>";
$code_cities = $code_cities->Places[0]->PlaceId;
//echo $code_cities->Places,"<br/>";
//echo "<pre>" . print_r($code_cities,true) . "</pre>";
$link = 'infoHack.php?country=ES¤cy='.$currency_val.'&locale=en-EN&originplace='.$code_cities.'&destinationplace='.$code.'&outbounddate=2016-02-21';
?>
<div class="hackathon">
<div class="right">
<img src="<?php echo $hackathon->logo; ?>"><br/>
<a class="btn-primary" href="<?php echo $link; ?>">Find Prices!'</a>
</div>
<h3><?php echo $hackathon->name; ?></h3>
<ul>
<li><?php echo $hackathon->info; ?></li>
<li><a href=""><?php echo $hackathon->link; ?></a></li>
</ul>
</div>
<?php } ?>
</div>
</body>
</html>