<?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>
<?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'])); $page_size = $config['itemsperpage']; $page_number = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; $properties = array(); try { $options = array(); $options['page_number'] = $page_number; $options['page_size'] = $page_size; if (isset($_REQUEST['checkin']) && $_REQUEST['checkin']) { $options['checkin'] = $_REQUEST['checkin']; $options['checkout'] = isset($_REQUEST['checkout']) ? $_REQUEST['checkout'] : null; } $options['city'] = isset($_GET['city']) ? $_GET['city'] : null; $properties = $connector->getProperties($options); } catch (Exception $e) { switch ($e->getCode()) { case 401: print "Forbidden access <br/>\n"; break; default: print "Error"; } } $cities = array(); try { $cities = $connector->getCities(); } catch (Exception $e) {