Ejemplo n.º 1
0
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
    </head>

    <body>
        <?php 
include './header.php';
?>
  

        <div class="container-fluid">

            <?php 
parse_str($_SERVER['QUERY_STRING']);
if (isset($_SESSION['id'])) {
    getPhotos();
    getPoke();
    checkPhotos();
    checkPokes();
}
if (isset($method)) {
    if (isset($error)) {
        showSucess($method, $error);
    } else {
        showSucess($method, 0);
    }
}
if (!isset($action)) {
    $action = "ola";
}
switch ($action) {
    case 'registerProfile':
Ejemplo n.º 2
0
            }
            $txt .= "method='" . $evo->method . "',";
            $txt .= "to='" . $evo->to . "'},";
        }
        $txt .= "},";
        $txt .= "types={";
        foreach ($pokedex->types as $types) {
            $txt .= "{name='" . $types->name . "'},";
        }
        $txt .= "},";
        $txt .= "moves={";
        foreach ($pokedex->moves as $move) {
            $idAPI = $move->resource_uri;
            $IdMove = explode('/', $idAPI);
            $txt .= "{id='" . $IdMove[4] . "',";
            $txt .= "learn_type='" . $move->learn_type . "',";
            $txt .= "name='" . ucwords(strtolower(str_replace("-", " ", $move->name))) . "'},";
        }
        $txt .= "},\n";
        $txt .= "},\n";
        fwrite($myfilePkd, $txt);
    }
}
//getMove($PokeMoves);
getPoke('http://pokeapi.co/api/v1/pokemon/?limit=100&offset=0');
//fwrite($myfile2, "Pokedex = {\n");
//getPoke("http://pokeapi.co/api/v1/pokemon/?limit=300&offset=1", $myfile2);
//getPoke("http://pokeapi.co/api/v1/pokemon/?limit=1&offset=97", $myfile2);
//getPoke("http://pokeapi.co/api/v1/pokemon/?limit=1&offset=194", $myfile2);
//getPoke("http://pokeapi.co/api/v1/pokemon/?limit=1&offset=291", $myfile2);
//fwrite($myfile2, "\n}");