Elxis CMS Forum

Extensions => Components => Topic started by: angolano on November 25, 2010, 21:07:23

Title: Form from facebook
Post by: angolano on November 25, 2010, 21:07:23
How can add a form in facebook to IOS reservation?
regards
Title: Re: Form from facebook
Post by: datahell on November 25, 2010, 21:10:03
If you want answers then give more information!
I can not answer if you don't write what exactly you want to do.
Title: Re: Form from facebook
Post by: angolano on November 25, 2010, 21:29:44
From facebook

<form name="respickdatesform" id="respickdatesform" method="post" action="http://www.hoteldarocha.com/booking/index2.php">

<select size="1" name="Dia_e" id="Dia_e">
          <option value="01" selected="selected">01</option>
          <option value="02">02</option>
          <option value="03">03</option>
....
<select size="1" name="Mes_e" id="Mes_e">
          <option value="01" selected="selected">Jan</option>
          <option value="02">Fev</option>
          <option value="03">Mar</option>
.....


       <select size="1" name="Ano_e" id="Ano_e">
          <option value="2010">2010</option>
            <option value="2011">2011</option>
            <option value="2012">2012</option>
                  </select></td>


Receive this is IOS reservations

$pickcheckin=$_REQUEST['Ano_e'] . '-'  . $_REQUEST['Mes_e'] . '-' . $_REQUEST['Dia_e'] ;
$pickcheckout=$_REQUEST['Ano_s'] . '-'  . $_REQUEST['Mes_s'] . '-' . $_REQUEST['Dia_s'] ;

How can i do?
http://www.facebook.com/pages/Rocha-Hotel-Apartamento/148195428561357?v=app_6009294086

Regards
Title: Re: Form from facebook
Post by: datahell on November 25, 2010, 21:32:03
Please describe me in details what you want to do!
Title: Re: Form from facebook
Post by: angolano on November 25, 2010, 21:34:14
select date in facebook then open IOS Reservation with this dates
Title: Re: Form from facebook
Post by: datahell on November 25, 2010, 21:37:22
IOS Reservations has many pages that you can access. You want to display a specific hotel's rooms availability for the specified dates? You want to use the general IOSR search? You want just to set picked dates in IOSR session? You want to do something else? What you want to do?
Describe in details what you want to do.
If you don't do it I will not answer. I am not a magician to know what you have in your mind.
Title: Re: Form from facebook
Post by: angolano on November 25, 2010, 21:38:36
display a specific hotel rooms availability for the specified dates
Title: Re: Form from facebook
Post by: datahell on November 25, 2010, 21:39:18
You can access IOS Reservations this way only via it's generic search functionality.
To access a hotel's detailed page and display available rooms for a specific date you need 2 requests:
1. Set the check-in and check-out dates
2. Access the hotel page

You can alternative use IOSR Connector that will do all this magic automatically but I dont know if facebook allows you to use such scripts on its servers. I  have never used facebook.

Details on how to query IOSR generic search page:
Elxis required form parameters:
<input type="hidden" name="option" value="com_reservations" />
<input type="hidden" name="task" value="search" />
<input type="hidden" name="Itemid" value="id_of_the_menu_item_that_links_to_IOSR_for_the_desired_language" />
Elxis optional form parameters:
<input type="hidden" name="mylang" value="english" />

IOS Reservations required form parameters:
<input type="text" name="pickcheckin" value="2010-11-24" />
<input type="text" name="pickcheckout" value="2010-11-26" />
<input type="hidden" name="rdosearch" value="1" />
IOS Reservations optional form parameters:
(integer) $lid (id of location, if not set or "0" it will search in all locations)
(integer) $sublocs  (also search in sub-locations? values: 1 or 0)
(string) $hotelname (search by hotel name)
(integer) $hid (hotel id, if it is set to a value higher than 0 IOSR will perform the search only on a specific hotel)
(float) $maxprice (maximum price, sample value: 56.00)
(integer) $adults (number of adults, if not set IOSR use value 1)
(integer) $children (number of children, if not set IOSR use value 0)
(integer) $roomsnum (number of rooms, if not set IOSR use value 1)
(integer) $accid (accommodation type id)
(integer) $stars (hotel stars, values: -1, 0, 1, 2, 3, 4, 5. The default value default is -1)
(integer) $noavcheck (by pass availability check?, values: 1 yes, 0: no. Default value: 0)

To set the "pickcheckin" and "pickcheckout" dates in IOSR session you need to query the "pickdates" task.

For applications running on Elxis you can use the related methods taken from the IOS Reservations API.

Convert a date from user or system format to system format:
$date = $resmaster->convertdate($date, false);

Convert a date from user or system format to user format:
$date = $resmaster->convertdate($date, true);

Validate check in and check out dates:
$resmaster->validatepicked($pickcheckin, $pickcheckout); (returns boolean - true/false)

Get current currency:
User selected currency symbol
(string) $resmaster->currencySymbol(1);
System default currency symbol
(string) $resmaster->currencySymbol(0);
User selected currency ISO code
(string) $resmaster->currencyISO(1);
System default currency ISO code
(string) $resmaster->currencyISO(0);
User selected currency decimal places:
(integer) $resmaster->currencyDecs(1);
System default currency decimal places:
(integer) $resmaster->currencyDecs(0);
Convert amount from system default to user selected currency:
(float) $resmaster->formatexprice('45.00', 1);
Convert amount from user selected to system default currency:
(float) $resmaster->formatexprice('45.00', 0);

Other related methods:

(float) $resmaster->formatprice($amount);
(float) $resmaster->shortprice($amount, $user);
(float) $resmaster->longprice($amount, $user);
(boolean) $resmaster->isTourOper($user_id);
Title: Re: Form from facebook
Post by: angolano on November 25, 2010, 22:56:18
Thanks You Datahell
 ;)
Regards
L