daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Guard Encoder)
  6. *
  7. * @ Version         :   3.0.4.0
  8. * @ Author          :   DeZender
  9. * @ Release on      :   02.04.2017
  10. * @ Official site   :   http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Soferu_Service_Ariane
  15. {
  16.     const ERROR_WRONG_CLIENT_ID = 201;
  17.     const ERROR_HOTEL_IS_FULL = 12;
  18.     const WARNING_NO_FREE_ROOMS = 10;
  19.     const WARNING_NO_RESERVATION_FOUND = 50;
  20.  
  21.     public $ErrorId = 0;
  22.     public $WarningId = 0;
  23.     public $Message = 'Success';
  24.  
  25.     public function getServiceId()
  26.     {
  27.         return API_Model_Webservices::WEBSERVICE_ARIANE;
  28.     }
  29.  
  30.     public function preInit($req)
  31.     {
  32.         restore_error_handler( true );
  33.         error_reporting( 32767 );
  34.         ini_set( 'display_errors', 0 );
  35.         ini_set( 'log_errors', 1 );
  36.         $this->debug( $req->request );
  37.         $this->setErrorId( 0 );
  38.         $req->request->KioskId = (int) $req->request->KioskId;
  39.  
  40.         if (Client::setId( $req->request->KioskId ) === false) {
  41.             $this->setErrorId( self::ERROR_WRONG_CLIENT_ID );
  42.         }
  43.         else {
  44.             $settings = ClientSettings::get( 'API', 'Ariane', array(  ) );
  45.             $this->config = array(
  46.                 'HotelMainDoorCode' => (empty( $settings['HotelMainDoorCode'] ) ? $settings['HotelMainDoorCode'] : ''),
  47.                 'CarParkCode'       => (empty( $settings['CarParkCode'] ) ? $settings['CarParkCode'] : ''),
  48.                 'TelephoneCode'     => (empty( $settings['TelephoneCode'] ) ? $settings['TelephoneCode'] : ''),
  49.                 'TVCode'            => (empty( $settings['TVCode'] ) ? $settings['TVCode'] : ''),
  50.                 'InternetAccess'    => array(
  51.                 'Username' => '',
  52.                 'Password' => ''
  53.             ),
  54.                 'Resources'         => $settings['Resources']
  55.             );
  56.         }
  57.     }
  58.  
  59.     public function GetHotelParameters($req)
  60.     {
  61.         $this->preInit( $req );
  62.         $res = array(
  63.             'KioskId'        => $req->request->KioskId,
  64.             'KioskType'      => $req->request->KioskType,
  65.             'SequenceId'     => $req->request->SequenceId,
  66.             'KioskPlannings' => array(  )
  67.         );
  68.         return $this->getResponse( $res, 'GetHotelParametersResult' );
  69.     }
  70.  
  71.     public function GetVersion($req)
  72.     {
  73.         $this->preInit( $req );
  74.         $res = array(
  75.             'KioskId'    => $req->request->KioskId,
  76.             'KioskType'  => $req->request->KioskType,
  77.             'SequenceId' => $req->request->SequenceId,
  78.             'Version'    => VERSION
  79.         );
  80.         return $this->getResponse( $res, 'GetVersionResult' );
  81.     }
  82.  
  83.     public function CreateReservation($req)
  84.     {
  85.         $this->preInit( $req );
  86.         $r = new Soferu_Service_Ariane_Reservation( $req->request, $this->getConfig(  ) );
  87.         $r->createBooking(  );
  88.         $res = array(
  89.             'KioskId'           => $req->request->KioskId,
  90.             'ReservationNumber' => $r->getItemId(  )
  91.         );
  92.         return $this->getResponse( $res, 'CreateReservationResult' );
  93.     }
  94.  
  95.     public function getSingleBookingByFilter($req)
  96.     {
  97.         return $this->getBookingByFilter( $req, false );
  98.     }
  99.  
  100.     private function getBookingByFilter($req, $multi = true)
  101.     {
  102.         $r = new Soferu_Service_Ariane_Reservation( NULL, $this->getConfig(  ) );
  103.  
  104.         if ($req->Filter) {
  105.             $bookings = $r->getBookingByFilter( $req->Filter, $multi );
  106.         }
  107.         else if ($req->ReservationNumber) {
  108.             $bookings = $r->getBookingByItemId( $req->ReservationNumber, $multi );
  109.         }
  110.  
  111.         if (($multi && ($bookings->NumRows(  ) == 0)) || empty( $bookings )) {
  112. ................................................................
  113. .........................................
  114. .................
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top