Reservation form validation - additional conditions...

Discuss here how to configure hoteldruid and better use its features.

Moderator: marco

Post Reply
jagd
Posts: 5
Joined: Mon Apr 24, 2006 1:08 pm

Reservation form validation - additional conditions...

Post by jagd »

Hi Marco!

I`ve made many mods in my installation of php-residence but now im in a stuck... :|

I need to add three more loops in prenota.php or clienti.php:

- if number of persons was entered
- if "reservation type" is selected (res. type - it`s my own mod)
- if "reservation-confirmation date" was entered (also own mod, using tigra-calendar - as replacement your "comment" field)

But... i don`t know where exactly i should put that..
I`m not a javascript-master, so - i tried to do it in php - near your "tipotarifa" select box - buy it doesn`t works... Could you give me some clues?

- thx, regards -
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

What do you mean by loops?

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
jagd
Posts: 5
Joined: Mon Apr 24, 2006 1:08 pm

Post by jagd »

Well - loops - its straight translation from polish... sorry :)

I mean, conditional instructions like "if (condition)", "for", "do" and others...

Ok, i`ve made a little step ahead :)

In clienti.php i found two places, where "cognome" variable is testing.
I`ve put my "ifs" and... it almost works...

When i put it about line ~1320 i`ve my messages with "back" button - but also with continuation possibility. (my messsages can be ignored and new customer data entry / or choosing existing customer is availiable...)
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

I don't understand the problem very well, but if you're trying to set conditions on the "$cognome" variable you could set them at the beginning of the file (only make sure it is after funzioni.php is included) where, if the condition is not met, you set $cognome = "";

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
jagd
Posts: 5
Joined: Mon Apr 24, 2006 1:08 pm

Post by jagd »

Well..

When we make a new reservation, we have to enter client name.
If we didn`t do that, there`s simple aler after form submit...

I need to force users, to enter some data into few another fields...

Now - i found place for proper piece of code, it mostly works but...
i still have some problem with one a bit "more complicated" term.

Anyway... finally i did what i wanted to do :)

Thanks for your time, Marc!
Post Reply