Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for Zend Guard Encoder)
- *
- * @ Version : 3.0.4.0
- * @ Author : DeZender
- * @ Release on : 02.04.2017
- * @ Official site : http://DeZender.Net
- *
- */
- class Soferu_Service_Ariane
- {
- const ERROR_WRONG_CLIENT_ID = 201;
- const ERROR_HOTEL_IS_FULL = 12;
- const WARNING_NO_FREE_ROOMS = 10;
- const WARNING_NO_RESERVATION_FOUND = 50;
- public $ErrorId = 0;
- public $WarningId = 0;
- public $Message = 'Success';
- public function getServiceId()
- {
- return API_Model_Webservices::WEBSERVICE_ARIANE;
- }
- public function preInit($req)
- {
- restore_error_handler( true );
- error_reporting( 32767 );
- ini_set( 'display_errors', 0 );
- ini_set( 'log_errors', 1 );
- $this->debug( $req->request );
- $this->setErrorId( 0 );
- $req->request->KioskId = (int) $req->request->KioskId;
- if (Client::setId( $req->request->KioskId ) === false) {
- $this->setErrorId( self::ERROR_WRONG_CLIENT_ID );
- }
- else {
- $settings = ClientSettings::get( 'API', 'Ariane', array( ) );
- $this->config = array(
- 'HotelMainDoorCode' => (empty( $settings['HotelMainDoorCode'] ) ? $settings['HotelMainDoorCode'] : ''),
- 'CarParkCode' => (empty( $settings['CarParkCode'] ) ? $settings['CarParkCode'] : ''),
- 'TelephoneCode' => (empty( $settings['TelephoneCode'] ) ? $settings['TelephoneCode'] : ''),
- 'TVCode' => (empty( $settings['TVCode'] ) ? $settings['TVCode'] : ''),
- 'InternetAccess' => array(
- 'Username' => '',
- 'Password' => ''
- ),
- 'Resources' => $settings['Resources']
- );
- }
- }
- public function GetHotelParameters($req)
- {
- $this->preInit( $req );
- $res = array(
- 'KioskId' => $req->request->KioskId,
- 'KioskType' => $req->request->KioskType,
- 'SequenceId' => $req->request->SequenceId,
- 'KioskPlannings' => array( )
- );
- return $this->getResponse( $res, 'GetHotelParametersResult' );
- }
- public function GetVersion($req)
- {
- $this->preInit( $req );
- $res = array(
- 'KioskId' => $req->request->KioskId,
- 'KioskType' => $req->request->KioskType,
- 'SequenceId' => $req->request->SequenceId,
- 'Version' => VERSION
- );
- return $this->getResponse( $res, 'GetVersionResult' );
- }
- public function CreateReservation($req)
- {
- $this->preInit( $req );
- $r = new Soferu_Service_Ariane_Reservation( $req->request, $this->getConfig( ) );
- $r->createBooking( );
- $res = array(
- 'KioskId' => $req->request->KioskId,
- 'ReservationNumber' => $r->getItemId( )
- );
- return $this->getResponse( $res, 'CreateReservationResult' );
- }
- public function getSingleBookingByFilter($req)
- {
- return $this->getBookingByFilter( $req, false );
- }
- private function getBookingByFilter($req, $multi = true)
- {
- $r = new Soferu_Service_Ariane_Reservation( NULL, $this->getConfig( ) );
- if ($req->Filter) {
- $bookings = $r->getBookingByFilter( $req->Filter, $multi );
- }
- else if ($req->ReservationNumber) {
- $bookings = $r->getBookingByItemId( $req->ReservationNumber, $multi );
- }
- if (($multi && ($bookings->NumRows( ) == 0)) || empty( $bookings )) {
- ................................................................
- .........................................
- .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement