コード例 #1
0
ファイル: intro.php プロジェクト: levi-beers/starwars
<?php

include_once "swapi.php";
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title><?php 
$val = swapi_get("http://swapi.co/api/films/" . $_GET[id] . "/");
$title = $val["title"];
$scroll = $val["opening_crawl"];
echo $title;
?>
</title>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="author" content="Levi Beers" />
        <link rel="shortcut icon" href="/favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="css/starwarsxplor_main.css" />
        <link rel="stylesheet" type="text/css" href="css/starfield.css" />
	<link rel="stylesheet" type="text/css" href="css/swfonts.css" />
	<link rel="stylesheet" type="text/css" href="css/sw_scroller.css" />
	<link href='//fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
	<link href='//fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
	<!--[if IE]>
		<link rel="stylesheet" type="text/css" href="css/styleIE.css" />
	<![endif]-->
    </head>
    <body>
<h1>STAR WARS<sub><?php 
コード例 #2
0
ファイル: teaser.php プロジェクト: levi-beers/starwarsxplor
?>
</h3></div>
					<div class="movieframe"><h3><?php 
$val = swapi_get("http://swapi.co/api/films/5/");
$title = $val["title"];
echo $title;
?>
</h3></div>
					<div class="movieframe"><h3><?php 
$val = swapi_get("http://swapi.co/api/films/6/");
$title = $val["title"];
echo $title;
?>
</h3></div>
					<div class="movieframe"><h3><?php 
$val = swapi_get("http://swapi.co/api/films/7/");
$title = $val["title"];
echo $title;
?>
</h3></div>
				</div>
				<div class="slider slider-nav">
					<div class="moviebox"><img id="ep1" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/4m.jpg"></div>
					<div class="moviebox"><img id="ep2" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/5m.jpg"></div>
					<div class="moviebox"><img id="ep3" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/6m.jpg"></div>
					<div class="moviebox"><img id="ep4" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/1m.jpg"></div>
					<div class="moviebox"><img id="ep5" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/2m.jpg"></div>
					<div class="moviebox"><img id="ep6" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/3m.jpg"></div>
					<div class="moviebox"><img id="ep7" src="https://s3-us-west-2.amazonaws.com/madwirestarwars/images/movies/7m.jpg"></div>
					</div>
		</div>
コード例 #3
0
ファイル: planets.php プロジェクト: levi-beers/starwarsxplor
<?php

$film_id = $_GET[id];
$url = "http://swapi.co/api/films/" . $film_id . "/";
$val = swapi_get($url);
$planets = $val["planets"];
$json = "";
$json .= '{
  "data": [' . "\n";
$x = 0;
foreach ($planets as &$planets_url) {
    if ($x != "0") {
        $json .= ',' . "\n";
    }
    $planetsA = swapi_get($planets_url);
    $name = $planetsA["name"];
    $population = $planetsA["population"];
    $climate = $planetsA["climate"];
    $diameter = $planetsA["diameter"];
    $surface_water = $planetsA["surface_water"];
    $gravity = $planetsA["gravity"];
    $json .= '["' . $name . '",
		"' . $population . '",
		"' . $climate . '",
		"' . $diameter . '",
		"' . $surface_water . '",
		"' . $gravity . '"
	      ]';
    $x++;
}
$json .= ' ]
コード例 #4
0
<?php

$film_id = $_GET[id];
$url = "http://swapi.co/api/films/" . $film_id . "/";
$val = swapi_get($url);
$characters = $val["characters"];
$json = "";
$json .= '{
  "data": [' . "\n";
$x = 0;
foreach ($characters as &$people_url) {
    if ($x != "0") {
        $json .= ',' . "\n";
    }
    $people = swapi_get($people_url);
    $name = $people["name"];
    $gender = $people["gender"];
    $birth_year = $people["birth_year"];
    $hair_color = $people["hair_color"];
    $eye_color = $people["eye_color"];
    $skin_color = $people["skin_color"];
    $height = $people["height"];
    $weight = $people["weight"];
    $json .= '["' . $name . '",
		"' . $gender . '",
		"' . $birth_year . '",
		"' . $hair_color . '",
		"' . $eye_color . '",
		"' . $skin_color . '",
		"' . $height . '",
		"' . $weight . '"
コード例 #5
0
ファイル: vehicles.php プロジェクト: levi-beers/starwarsxplor
<?php

$film_id = "4";
$url = "http://swapi.co/api/films/" . $film_id . "/";
$val = swapi_get($url);
$vehicles = $val["vehicles"];
$json = "";
$json .= '{
  "data": [' . "\n";
$x = 0;
foreach ($vehicles as &$vehicles_url) {
    if ($x != "0") {
        $json .= ',' . "\n";
    }
    $vehiclesA = swapi_get($vehicles_url);
    $name = $vehiclesA["name"];
    $model = $vehiclesA["model"];
    $manufacturer = $vehiclesA["manufacturer"];
    $crew = $vehiclesA["crew"];
    $length = $vehiclesA["length"];
    $passengers = $vehiclesA["passengers"];
    $vehicle_class = $vehiclesA["vehicle_class"];
    $json .= '["' . $name . '",
		"' . $model . '",
		"' . $manufacturer . '",
		"' . $crew . '",
		"' . $length . '",
		"' . $passengers . '",
		"' . $vehicle_class . '"
	      ]';
    $x++;
コード例 #6
0
<?php

$film_id = $_GET[id];
$url = "http://swapi.co/api/films/" . $film_id . "/";
$val = swapi_get($url);
$starships = $val["starships"];
$json = "";
$json .= '{
  "data": [' . "\n";
$x = 0;
foreach ($starships as &$starships_url) {
    if ($x != "0") {
        $json .= ',' . "\n";
    }
    $starshipsA = swapi_get($starships_url);
    $name = $starshipsA["name"];
    $model = $starshipsA["model"];
    $manufacturer = $starshipsA["manufacturer"];
    $crew = $starshipsA["crew"];
    $length = $starshipsA["length"];
    $passengers = $starshipsA["passengers"];
    $vehicle_class = $starshipsA["starships_class"];
    $json .= '["' . $name . '",
		"' . $model . '",
		"' . $manufacturer . '",
		"' . $crew . '",
		"' . $length . '",
		"' . $passengers . '",
		"' . $vehicle_class . '"
	      ]';
    $x++;