redesign merge dates function
This commit is contained in:
parent
68253fa497
commit
07565f1413
5 changed files with 140 additions and 89 deletions
|
|
@ -34,4 +34,57 @@ function buildParamsString($requestParams) {
|
|||
|
||||
function getEventsByMonth($month) {
|
||||
$events = page('programme')->children();
|
||||
}
|
||||
|
||||
function fetchMapadoEvent($request) {
|
||||
$token = site()->mapadoToken();
|
||||
$requestEndPoint = $request['requestEndPoint'];
|
||||
$requestParams = $request['requestParams'];
|
||||
$requestFields = $request['requestFields'];
|
||||
|
||||
$url = "https://ticketing.mapado.net/v1/$requestEndPoint?";
|
||||
|
||||
$url .= buildParamsString($requestParams);
|
||||
$url .= buildFieldsString($requestFields);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
"Authorization: Bearer " . $token
|
||||
]);
|
||||
|
||||
$responseString = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$response = json_decode($responseString);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
function fetchMapadoEvents($request) {
|
||||
$token = site()->mapadoToken();
|
||||
$contractId = site()->mapadoContractId();
|
||||
$requestEndPoint = $request['requestEndPoint'];
|
||||
$requestParams = $request['requestParams'];
|
||||
$requestFields = $request['requestFields'];
|
||||
|
||||
$url = "https://ticketing.mapado.net/v1/$requestEndPoint?contract=$contractId&";
|
||||
|
||||
$url .= buildParamsString($requestParams);
|
||||
$url .= buildFieldsString($requestFields);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
"Authorization: Bearer " . $token
|
||||
]);
|
||||
|
||||
$responseString = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$responseJson = json_encode(json_decode($responseString));
|
||||
|
||||
return $responseJson;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue