Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Beispiel:

Beispiel in PHP (Alle Mitarbeiter anzeigen)
 <?php
$troiUsername = 'TROI_BENUTZER';
$troiPassword = 'TROI_PASSWORD';
$troiUrl = 'https://dh0014.troi.de/TROIPFAD/api/v2/rest/';

function curlGet($url){
	global $troiUsername, $troiPassword;
    if (!function_exists('curl_init')){
        die('Sorry cURL is not installed!');
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, "Troi API Example Client v0.1");
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);     
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
    curl_setopt($ch, CURLOPT_USERPWD, $troiUsername . ":" . md5($troiPassword));
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}

$users = json_decode(curlGet($troiUrl.'employees?clientId=1'));

echo '<center><table><tr><td style="text-align; right; font-weight: bold; border-bottom: 2px black solid;">ID</td><td style="border-bottom: 2px black solid;">Name des Benutzers</td></tr>';

foreach ($users as $employee){
	echo '<tr><td style="text-align: right; font-weight: bold; border-bottom: 1px black solid">' . $employee->Id . '</td><td style="border-bottom: 1px black solid;">'. $employee->FullName . "</td></tr>";
};
echo "</table></center>"
?>

Tutorials von Panic

https://library.panic.com/statusboard/table_tutorial/

https://library.panic.com/statusboard/graph_tutorial/

https://library.panic.com/statusboard/diy-panels/

https://library.panic.com/statusboard/url-schema/

  • No labels