开发者

Facility booking system

开发者 https://www.devze.com 2023-02-15 18:03 出处:网络
We are planning to implement a facility booking system wherein the user would be able to check the availability of a hall/room at a particular date and time. The user would also be able to book a faci

We are planning to implement a facility booking system wherein the user would be able to check the availability of a hall/room at a particular date and time. The user would also be able to book a facility if it is available.

However, I am having issues in creating two components for the system:

  1. Calendar - The calendar needs to be dynamic, such that the user can book the room with a mouse click after specifying the duration through mouse drag. Also, the mouseover should display the event info, so that I do not need to put the ev开发者_StackOverflowent details in some other static page/link. Lastly, the calendar needs to be flexible enough to display availability of the rooms/halls sorted by day, week, and month.

  2. Booking through SMS - Whenever a room is booked, an SMS is to be sent to a specific user (selected). The user can then reply to the SMS to book the room (mentioning the unique request ID in SMS response). However, I have never created an SMS server, so I wanted to know how to begin, and whether it is feasible to make an SMS-based response system.

Please share your views or any source code you know is available which takes care of any of these requirements.


  1. PHP has plenty of date and time related functions which can help you generate your calendar. You could also find an open source project with a calendar you like and see how they did it.

  2. There are service providers for SMS. You simply call a URL (like http://smsservices.com/send.php?message=YOUR_MESSAGE&api_key=YOUR_API_KEY&number=RECIPIENT_NUMBER) and the SMS gets sent by them. Receiving is equally easy: They give you a unique number your users can send messages to. If they receive a message they either call a URL of your website (like http://yoursite.com/receive_sms?message=MESSAGE&number=SENDERS_NUMBER) or send you an email with the message sender's number and message. Just search around Google and you'll find a suitable service provider in your area.


Ideally this would be asked as two separate questions.

Regarding your question on SMS.

You can use an SMS aggregator, such as BulkSMS, to enable you to send messages and receive replies. You don't mention which country this is intended for and there can be complications in some regions.

Sending a message can be a simple as making an HTTP request. Replies can be returned to you via another HTTP request to your server, or via email, for example.

Take a look at the BulkSMS API documentation

Disclaimer: I work for BulkSMS


From the little i have read from your post, i could understand what exactly you are trying to achieve and i must say that its quite straight forward if you carefully plan your web application.

I have embarked upon such a solution before and will give you a hint on how to solve the sms part which will enable you send sms with unique booking id to the user. I presume that your booking form will have all the necessary fields which will enable you collect the basic user details precisely the important ones which consist of booking details,user name,email & phone number.

Below is a sample php curl code embedded with XML that my sms gateway provided which i usually tweak to enable me deploy both static and dynamically generated sms using this script below. /////////////////////////////SMS GATE WAY IS WWW.INFOBIPS.COM /////////////////////

$user="smsgateway_user";
$pass="smsgateway_password";
$sender= "sendername";
$mobileno="2348034057037";
$message= "Your sms message goes here";

?>
<?php

$postUrl = "http://www.infobip.com/AddOn/SMSService/XML/XMLInput.aspx";
// XML-formatted data

$xmlString =
"<SMS>
<authentification>
<username>$user</username>
<password>$pass</password>
</authentification>
<message>
<sender>$sender</sender>
<text>$message</text>
</message>
<recipients>
<gsm>$mobileno</gsm>
</recipients>
</SMS>";

// previously formatted XML data becomes value of “XML” POST variable

$fields = "XML=" . urlencode($xmlString);
// in this example, POST request was made using PHP’s CURL

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
// response of the POST request
$response = curl_exec($ch);

// redirect the page upon successful sending

header("Location:customized/confirmationpage.php"); 
curl_close($ch);

?>

What i expect you to do is to simply redirect your booking form to this script after it has been submitted,this script will trigger the sms to the phone no of the user before redirecting back to the confirmation page of your booking script.

With regards to the other part where the user sends and sms with unique room booking ID to confirm, I'm not to familiar this area but i guess you can decide to use a short code service or just use a manual phone number to receive your confirmation sms.

I hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消