Пример #1
0
<?php

if (isset($_POST['companyIndex'])) {
    $api = new EvoApi();
    $jsonData = $api->GET("/clients");
    $clients = json_decode($jsonData);
    $clientIndex = $_POST['clientIndex'];
    $clientId = $clients[$clientIndex]->Id;
    $jsonData = $api->GET("/clients/{$clientId}/companies");
    $companies = json_decode($jsonData);
    $companyIndex = $_POST['companyIndex'];
    $companyId = $companies[$companyIndex]->Id;
    echo "<table id='companyTable'><tr>";
    foreach ($companies[$companyIndex] as $key => $value) {
        echo "<th> {$key} </th>";
    }
    echo "</tr><tr>";
    foreach ($companies[$companyIndex] as $value) {
        echo "<td> {$value} </td>";
    }
    echo "</tr></table>";
    $jsonData = $api->GET("/clients/{$clientId}/companies/{$companyId}/employees");
    $employees = json_decode($jsonData);
    echo <<<HTML
     <select id="employeeSelect" name="employeeSelect">
     <option value="000">Select an Employee</option>
HTML;
    for ($i = 0; $i < count($employees); $i++) {
        $temp = $employees[$i]->Name;
        echo <<<HTML
     <option value="{$i}">{$temp}</option>
Пример #2
0
<?php

session_start();
include_once "evoapi.php";
include_once "connect.php";
$api = new EvoApi();
$data = $api->GET("/clients");
$clients = json_decode($data);
$arr[] = <<<HTML
     <select id="clientSelect" name="clientSelect">
     <option value="empty">Select a Client</option>
HTML;
for ($i = 0; $i < count($clients); $i++) {
    $temp = $clients[$i]->Name;
    $arr[] = <<<HTML
     <option value="{$i}">{$temp}</option>
HTML;
}
$arr[] = <<<HTML
     </select>
HTML;
?>
<!DOCTYPE html>
<html>
<head>
    <title>Evo API</title>
    <style>
        body{
            background-color: lightblue;
        }
        #clientTable, #companyTable{
Пример #3
0
<?php

session_start();
session_unset();
include_once "evoapi.php";
include_once "connect.php";
$clients = NULL;
$companies = NULL;
if (isset($_POST['clientIndex'])) {
    $api = new EvoApi();
    $jsonData = $api->GET("/clients");
    $clients = json_decode($jsonData);
    $clientIndex = $_POST['clientIndex'];
    echo "<table id='clientTable'><tr>";
    foreach ($clients[$clientIndex] as $key => $value) {
        echo "<th> {$key} </th>";
    }
    echo "</tr><tr>";
    foreach ($clients[$clientIndex] as $value) {
        echo "<td> {$value} </td>";
    }
    echo "</tr></table>";
    $clientId = $clients[$clientIndex]->Id;
    $jsonData = $api->GET("/clients/{$clientId}/companies");
    $companies = json_decode($jsonData);
    echo <<<HTML
     <select id="companySelect" name="companySelect">
     <option value="empty">Select a Company</option>
HTML;
    for ($i = 0; $i < count($companies); $i++) {
        $temp = $companies[$i]->Name;