possible evolution

possible evolution

Postby corsanero » Sat Feb 23, 2008 4:57 pm

Congratulations for the script. It is very nice.
Can I propose a possible evolution for the future?
It would be wonderful if it were possible to indicate with two different colors the days of check-in and check-out.
(like this)
I have tried everywhere but I have never seen a freeware script that does.
Thank you
corsanero
 
Posts: 6
Joined: Sat Feb 23, 2008 4:47 pm

Re: possible evolution

Postby chris » Sat Feb 23, 2008 5:19 pm

Hi there and welcome to the forum,
Thanks for the great comments :)

Yes, I have thought about how to do this. The problem is that I don't want the script to get to complicated and require "external" form elements for updateing each day.
One possible solution that I had though of was to have several states:
Available all day
Booked all day
Booked morning
Booked afternoon
In the code, it would initually be set to available, then you would have to click it several times to get to the state that you required ie:
1 click : booked all day (do this first as it the most likely state)
2 click: booked morning
3 click: booked afternoon
A fourth click would then get it back to available.

Clearly 2 new sets of numbers would be required to indicate the alternative states.

However I am not sure if this might be a bit tedious - having to click (and wait) 3 times to say that it is booked in the afternoon... :?


As someone who would like to see such a function - what do you think of this solution?

Looking forward to your input.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: possible evolution

Postby corsanero » Sat Feb 23, 2008 7:24 pm

I think it is an excellent idea.
It is much more convenient to do everything with a few clicks, rather than having a separate form for updateing.
This procedure is not tedious and it is original and intuitive.
I am not very experienced programming, but I think it is a solution for keeping the code very light.
Perhaps another possible solution could be to use the combinations:
click
ALT+click
CTRL+click
for set the difference states.

Bye
corsanero
 
Posts: 6
Joined: Sat Feb 23, 2008 4:47 pm

Re: possible evolution

Postby chris » Sat Feb 23, 2008 8:04 pm

click
ALT+click
CTRL+click

now that does sound like a good idea - I will give it a go ;) but you will have to be patient, I am a bit busy at the moment.


Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: possible evolution

Postby chris » Sun Feb 24, 2008 3:42 am

Well, you've had me working on this this afternoon and evening :lol: and I think that I have got it pretty much working.
Check it out here: http://www.cbolson.com/code/availabilit ... ersion2.0/
There are still one or 2 things that I would like to add before making this fully public but you can download it here:
http://www.cbolson.com/code/availabilit ... dar_V2.zip

I have used the controls that you suggested though that could be personalised easily enough (in the js file)
I have also done a little bit of work on making the language support easier aswell as taking the functions out of the main file so as to facilitate the creation of an admin panel.

Well, take a look and give it a go - let me know what you think or if you find any bugs ;)

Thanks for the suggestion

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: possible evolution

Postby corsanero » Sun Feb 24, 2008 1:24 pm

The links do not work :cry:
First link says: "unable to connect to db", second link: inexistent file :cry:
corsanero
 
Posts: 6
Joined: Sat Feb 23, 2008 4:47 pm

Re: possible evolution

Postby chris » Sun Feb 24, 2008 2:52 pm

sorry, try again :oops:
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: possible evolution

Postby corsanero » Sun Feb 24, 2008 4:16 pm

Really amazing. :D
I am happy to have made a small contribution with my idea, and I'm surprised the speed with which you implemented changes. :shock:
When I have some time I will try to study the scripts.
I can make a very newbby question?
How do I view a calendar for the administrator (that can make the changes), and a separate page with the simple display to users (which may not do the changes)?

EDIT

I am trying to make a test on my web space, I followed the instructions and i can see the calendar, but clicking on the date appears an alert window:

:!: ERROR INSERTING. INSERT INTO bookings_cal SET id_item='2', the_date='2008-02-08', state=''

I tried to change the CHMOD permissions, but I can not solve the problem.

EDIT 2

The file it.lang.php contained some grammar mistakes. I made corrections (i'm italian)
Code: Select all
<?php
/*
lang file for ITALIAN
*/
$lang=array();
$lang["months"]         =   

array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
$lang["days"]         =   array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
$lang["instructions"]   =   "I giorni evidenziati in rosso sono già prenotati e non sono disponibili.";
$lang["title"]         =   "DISPONIBILITÀ PER ";
?>
corsanero
 
Posts: 6
Joined: Sat Feb 23, 2008 4:47 pm

Re: possible evolution

Postby chris » Sun Feb 24, 2008 8:28 pm

Hi again,
I'm sorry about the errors, I was doing this late last night and clearly to forget do mention somethings in my post.

I have add to add an new column to the database to catch this new "am", "pm" or "all" state so you will need to add the column to the database.
Add this line to the php file (remove when run once!)

Code: Select all
$alter="ALTER TABLE `bookings_cal` ADD `state` CHAR( 3 ) NOT NULL DEFAULT 'all' ";
if(!mysql_query($alter)) die("ERROR ADDING TABLE COLUMN");
else echo "<b>state</b> column added to calendar table - DON'T FORGET TO REMOVE THIS CODE NOW!";


As to having an admin panel, the last value in calendar function call is currently set to "1" - this means that the calendar is currently modifyable. If you set this to "0" (or anyything other than "1!) the links will be removed and it will not be possible to update the date state.
Code: Select all
draw_cal($id_item,$val["month"], $val["year"], $booked_days,1)

So, you could create 2 versions of the file, one "public" one with the value set to 0 and another (that should be password protected) with it set to "1"

I really need to include an admin panel with the script so it is something that I will be working on soon.

Thanks for the Italian translation, I will include that in my next public version :)

Are you going to use this script in a public website? - it would be great to be enable to include a link to your site so as to show where and how the script is being used (if you don't mind of course)

Cheers,

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: possible evolution

Postby corsanero » Sun Feb 24, 2008 9:30 pm

Sorry Chris, but I can not make it work. Where should add new lines of code?
In the file db_table_create.php right?
server returns a syntax error. Unfortunately are really a newbie.
I plan to renew my little website of apartments for the holidays (when I will have some time).
http://www.residencecorsaro.it
corsanero
 
Posts: 6
Joined: Sat Feb 23, 2008 4:47 pm

Next

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron