Esempio n. 1
0
<?php

require_once dirname(__FILE__) . '/../../vendor/autoload.php';
$config = (include dirname(__FILE__) . '/config.php');
$connector = new Net2rent\Connector(array('apiBaseUrl' => $config['apiConnection']['apiBaseUrl'], 'apiUser' => $config['apiConnection']['apiUser'], 'apiPassword' => $config['apiConnection']['apiPassword'], 'lg' => $config['language']));
try {
    $property = $connector->getProperty($_REQUEST['id']);
} catch (Exception $e) {
    switch ($e->getCode()) {
        case 401:
            print "Forbidden access <br/>\n";
            break;
        default:
            die("ERROR: " . $e->getMessage());
    }
}
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>N2Rent | Connector example</title>
        <style type="text/css">
        li { float: left; margin: 5px; clear: both;}
        img { float: left; width: 200px; clear: both; margin: 10px 0px; }
        h2, a {color: #3E78FD;}
    </style>
</head>
<body>
	<div>
            <a href="list.php">Back</a>