Exemple #1
0
            <span class="fa-stack fa-4x">
                <i class="fa fa-circle fa-stack-2x"></i>
                <i class="fa fa-car fa-stack-1x text-primary"></i>
            </span>

            <br>
                <uber>

                  <?php 
include 'vendor/autoload.php';
use Pest;
use Uber\API\Client;
$token = 'jMUZUJ8an1j3FFlV5_Gaa1KI65YZkB22ayAvh7EK';
try {
    $adapter = new Pest('https://api.uber.com/');
    $client = new Client($adapter, $token, false);
    // define SERVER token here
    $client->setLocale('nl_NL');
    $products = $client->products(19.442272, -99.203453);
    //  print_r($products);
    $estimatesPrice = $client->estimatesPrice(19.442272, -99.203453, 19.4326018, -99.1332049);
    //  print_r($estimatesPrice);
    $obj = json_decode($estimatesPrice);
    $obj1 = $obj->{'prices'};
    echo "<table class='table'>\n                      <thead>\n                        <tr>\n                          <th>Tipo de Uber</th>\n                          <th>Min estimado</th>\n                          <th>Max estimado</th>\n                          <th>Duracion aprox</th>\n                          <th>Distancia</th>\n                          <th>Seleccion</th>\n                        </tr>\n                      </thead>\n                      <tbody>";
    for ($i = 0; $i < 4; $i++) {
        $duration = round(intval($obj1[$i]->duration) / 60);
        echo "\n                        <tr>\n                          <td>" . $obj1[$i]->localized_display_name . "</td>\n                          <td>\$ " . $obj1[$i]->low_estimate . " MXN </td>\n                          <td>\$" . $obj1[$i]->high_estimate . " MXN </td>\n                          <td>" . $duration . " Mins</td>\n                          <td>" . $obj1[$i]->distance . " Kms</td>\n                          <td> <input type='radio' name='select' value='" . $obj1[$i]->high_estimate . "'/> </td>\n                        </tr>";
    }
    echo "\n                      </tbody>\n                    </table>";
    /*  print_r($obj1[0]->localized_display_name);
Exemple #2
0
            <span class="fa-stack fa-4x">
                <i class="fa fa-circle fa-stack-2x"></i>
                <i class="fa fa-car fa-stack-1x text-primaryF"></i>
            </span>

            <br>
                <uber>

                  <?php 
include 'vendor/autoload.php';
use Pest;
use Uber\API\Client;
$token = 'jMUZUJ8an1j3FFlV5_Gaa1KI65YZkB22ayAvh7EK';
try {
    $adapter = new Pest('https://api.uber.com/');
    $client = new Client($adapter, $token, false);
    // define SERVER token here
    $client->setLocale('nl_NL');
    $products = $client->products(19.442272, -99.203453);
    //  print_r($products);
    $estimatesPrice = $client->estimatesPrice(19.4345888, -99.06958590000001, 19.4848572, -99.1178616);
    //  print_r($estimatesPrice);
    $obj = json_decode($estimatesPrice);
    $obj1 = $obj->{'prices'};
    echo "<table class='table'>\n                      <thead>\n                        <tr>\n                          <th>Tipo de Uber</th>\n                          <th>Min estimado</th>\n                          <th>Max estimado</th>\n                          <th>Duracion aprox</th>\n                          <th>Distancia</th>\n                          <th>Seleccion</th>\n                        </tr>\n                      </thead>\n                      <tbody>";
    for ($i = 0; $i < 4; $i++) {
        $duration = round(intval($obj1[$i]->duration) / 60);
        echo "\n                        <tr>\n                          <td>" . $obj1[$i]->localized_display_name . "</td>\n                          <td>\$ " . $obj1[$i]->low_estimate . " MXN </td>\n                          <td>\$" . $obj1[$i]->high_estimate . " MXN </td>\n                          <td>" . $duration . " Mins</td>\n                          <td>" . $obj1[$i]->distance . " Kms</td>\n                          <td> <input type='radio' name='select' value='" . $obj1[$i]->high_estimate . "'/> </td>\n                        </tr>";
    }
    echo "\n                      </tbody>\n                    </table>";
    /*  print_r($obj1[0]->localized_display_name);