Forum Moderators: coopster

Message Too Old, No Replies

Looking for a script

         

ineedmoney

1:59 pm on May 15, 2006 (gmt 0)

10+ Year Member



Hello, I am looking to purchase/find a script that will allow people to search through a 2007 calendar, and purchase a date. I have looked everywhere and can't find something that is just what I need.

requirements:

must be compatible with multiple versions of PHP but at the minimum php 4

each date can only be purchased once

purchased dates must be blocked or greyed out or something to that effect

dates must be searchable

Thanks

dreamcatcher

3:08 pm on May 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi ineedmoney,

Have you tried hotscripts.com? They have all sorts of open source calendar scripts which you may be able to adapt into what you need.

dc

ineedmoney

3:27 pm on May 15, 2006 (gmt 0)

10+ Year Member



Thanks dreamcatcher, Hotscripts was the first place I went. I am starting to think that there probaly isn't a script that can do exactly what I want from it already made. I know the basics of PHP can anyone point me in the right direction as to what I would need to learn to create something like this? What What would be involved? etc...

dreamcatcher

3:46 pm on May 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, all you really need to do is pass a variable into a form for the day selected and then do your processing. If the purchase is ok, show that day as purchased. So, maybe radio buttons for each day and when the purchase has been cleared, remove the radio button for that day.

What you need is a calendar interface to begin with. Are you sure hotscripts.com have nothing you can use?

Another place you can try is the PHP Classes Repository
[phpclasses.org....]

Good luck,

dc

ineedmoney

5:15 pm on May 16, 2006 (gmt 0)

10+ Year Member



Thanks, I'll keep looking

dmorison

5:20 pm on May 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are a number of scripts around for hoteliers and landlords of rental properties to allow users to search for a date and check availability and then make a booking. If this is what you're looking to do, try a few searches around the keywords "booking" "rental" "script" etc.

dreamcatcher

6:28 pm on May 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this one:
[rentcalendar.com...]

dc

ineedmoney

1:43 am on May 17, 2006 (gmt 0)

10+ Year Member



Thanks for all the replies.
Since yesterday I have managed to developed my own calendar system that will suit my needs, but the part I'm getting stuck on is how to lock the date after a visitor claims it? I pretty much learn php on the fly, so I don't have much experience developing something like this. I have the calendar running through flat files and I decided to drop the login/users functions, but I would still like to be able to lock the dates dynamically. Anyone have any suggestions on where I should start poking my nose?

Thanks for all the great suggestions!

wheelie34

7:39 am on May 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use a calendar for small bed and breakfast places, when it prints the dates it creates checkboxes for each day, for past dates OR booked dates I tell it to rather print like this

<input type=\"checkbox\" name=\"bla\" disabled>

disabled tells it to stay grey and not be tickable, wethter this works on every browser or is a m$ thing I havent tested yet but that should help you

eelixduppy

10:59 am on May 17, 2006 (gmt 0)



You should store the dates that have already been selected in some type of database. That way you can check to see what dates have been taken in order to know which dates need to be disabled and which dates don't.

ineedmoney

1:52 pm on May 17, 2006 (gmt 0)

10+ Year Member



Thank you wheelie34 as well as eelixduppy
and everyone else who has taken the time to help me out. In my calendar, the user goes to a form where they select the date from a drop down list

This is the code I use to populate the select box

<?php

$day = getdate();
$current_year = $day['year'];
$month = $day['month'];
$today = $day['mday'];

echo "
<select name=\"month\">
<option value=\"January\"";
if($month=="January")
echo " selected ";
echo ">January</option>";

echo "<option value=\"February\"";
if($month=="February")
echo " selected ";
echo ">February</option>";

echo "<option value=\"March\"";
if($month=="March")
echo " selected ";
echo ">March</option>";

echo "<option value=\"April\"";
if($month=="April")
echo " selected ";
echo ">April</option>";

echo "<option value=\"May\"";
if($month=="May")
echo " selected ";
echo ">May</option>";

echo "<option value=\"June\"";
if($month=="June")
echo " selected ";
echo ">June</option>";

echo "<option value=\"July\"";
if($month=="July")
echo " selected ";
echo ">July</option>";

echo "<option value=\"August\"";
if($month=="August")
echo " selected ";
echo ">August</option>";

echo "<option value=\"September\"";
if($month=="September")
echo " selected ";
echo ">September</option>";

echo "<option value=\"October\"";
if($month=="October")
echo " selected ";
echo ">October</option>";

echo "<option value=\"November\"";
if($month=="November")
echo " selected ";
echo ">November</option>";

echo "<option value=\"December\"";
if($month=="December")
echo " selected ";
echo ">December</option>";
echo "</select>

<select name=\"day\">";

for($i = 1; $i <= 31; $i++){
echo "<option value=\"$i\"";
if($i == $today)
echo " selected ";
echo ">$i</option>
";
}
echo "</select>

<select name=\"year\">";

for($i = $current_year; $i < ($current_year + 2); $i++){
echo "<option value=\"$i\"";
if ($year == $i)
echo " selected ";
echo ">$i</option>
";
}

echo "</select>";
?>

What I would like to figure out is how to make a date once selected, dynamically (without my input) get locked out from the next visitors choice or erased or whatever, just so they can't pick the previously selcted dates. Is this even possible from how I populate the select box? Thanks for all the help!

.

wheelie34

2:35 pm on May 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Personally I would store the dates in the db and populate the select that way, I take it the same date cant be booked twice? if thats the case then by adding a seperate column in the db to determine if its available or not IE available = 1 booked = 0 then while populating the select have it only show

select * from table where availability = 1

and then when someone books a date

update table set availabilty 0 where date = whatever

ineedmoney

2:56 pm on May 17, 2006 (gmt 0)

10+ Year Member



Thats a very good idea, should work out, Thanks

just incase I can't figure that one out though, does anyone else have any input? Are there other ways?
Thanks

jatar_k

4:14 pm on May 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the database is your best choice

but it would be fairly in depth to do a whole year or more's worth and build it into select boxes

I would think you could trim it down to one months worth on a single form, then have them click into the next month from there and repopulate

if you do too much at once it will get very complicated and take a bunch of time