Hello first of all to all of you, and congrats to the developer of this great component.
I'll get straight to the point, I'm a total newbie when it comes to php and sql code-crunching so please bare with me.
The first form I've made in CF was for a basic email form for reservations of certain resources. That was a real breeze to make, even for me. However, now I've got a whole new project to complete and this must be simple and functional.
We are talking about a basic travel resource query system that needs pretty much the basics. I've made 4 forms that are hooked into separate mysql tables where data is stored:
- Add tour operator (Name)
- Add destination form (Name)
- Add city form (Name, Destination)
- Add resource (Name, Destination, City, Tour operator, Price....)
First thing I'm having problems is with the last form. I wish that when I choose the destination, the city field gets filtered down only to the cities that are linked to that destination. I.e. when I select France, I want that the City field shows only Paris, Lyon and Marseilles.....not Berlin, Amsterdam, Paris, Lyon, Rome. I've figured out that this is solved somehow using JS, but i have no serious clue how.
Here's the form HTML I've made till now:
Also I would like to know is there a chance that the record gets deleted when the resource date is equal to the current one (basically, you can't send a query for something that happened yesterday)?
The second and the most biggest part of my troubles is how to use Chrono Connectivity to perform searches in the resources table? I want to have a search on the frontend where a visitor can select the Destination, date and the duration of stay, while the results show Destination, City, Name, Date, Tour operator (hidden to all except admins), Duration, Price and a link towards a booking form for each provided result.
If anyone is willing to help me out on this one, I'd would mean the world to me and also I would learn a good deal how things should work. Also, If I manage to get some refund from my client for who I'm working this for, I'll be happy to share a certain amount.
Apologies for an extensive post.
Cheers!
I'll get straight to the point, I'm a total newbie when it comes to php and sql code-crunching so please bare with me.
The first form I've made in CF was for a basic email form for reservations of certain resources. That was a real breeze to make, even for me. However, now I've got a whole new project to complete and this must be simple and functional.
We are talking about a basic travel resource query system that needs pretty much the basics. I've made 4 forms that are hooked into separate mysql tables where data is stored:
- Add tour operator (Name)
- Add destination form (Name)
- Add city form (Name, Destination)
- Add resource (Name, Destination, City, Tour operator, Price....)
First thing I'm having problems is with the last form. I wish that when I choose the destination, the city field gets filtered down only to the cities that are linked to that destination. I.e. when I select France, I want that the City field shows only Paris, Lyon and Marseilles.....not Berlin, Amsterdam, Paris, Lyon, Rome. I've figured out that this is solved somehow using JS, but i have no serious clue how.
Here's the form HTML I've made till now:
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Destinacija</label>
<select class="cf_inputbox validate-selection" id="select_1" size="1" title="" name="select_1">
<?php
$db =& JFactory::getDBO();
$db->setQuery("SELECT cf_id, text_0 FROM jos_chronoforms_destinacija ORDER BY text_0 ASC");
$events = $db->loadObjectList();
foreach ($events as $event) {
echo ('<option value="' . $event->cf_id . '">' . $event->text_0 . '</option>');
}
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Grad</label>
<select class="cf_inputbox validate-selection" id="select_2" size="1" title="" name="select_2">
<?php
$db =& JFactory::getDBO();
$db->setQuery("SELECT cf_id, text_0 FROM jos_chronoforms_dodaj_grad ORDER BY text_0 ASC");
$events = $db->loadObjectList();
foreach ($events as $event) {
echo ('<option value="' . $event->cf_id . '">' . $event->text_0 . '</option>');
}
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Smještaj</label>
<select class="cf_inputbox validate-selection" id="select_3" size="1" title="" name="select_3">
<option value="">Odaberite kategoriju</option>
<option value="*****">*****</option>
<option value="****">****</option>
<option value="***">***</option>
<option value="**">**</option>
<option value="*">*</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Naziv</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_4" name="text_4" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Turoperator</label>
<select class="cf_inputbox" id="select_5" size="1" title="" name="select_5">
<?php
$db =& JFactory::getDBO();
$db->setQuery("SELECT cf_id, text_0 FROM jos_chronoforms_turoperatori ORDER BY text_0 ASC");
$events = $db->loadObjectList();
foreach ($events as $event) {
echo ('<option value="' . $event->cf_id . '">' . $event->text_0 . '</option>');
}
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_datetimepicker">
<label class="cf_label" style="width: 150px;">Datum polaska</label>
<input class="cf_datetime required" title="" size="20" id="date_6" name="date_6" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Broj dana</label>
<input class="cf_inputbox required validate-digits" maxlength="2" size="2" title="" id="text_7" name="text_7" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<br>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Cijena (kn)</label>
<input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_8" name="text_8" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Dodaj u bazu" name="{cf_name}" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
Also I would like to know is there a chance that the record gets deleted when the resource date is equal to the current one (basically, you can't send a query for something that happened yesterday)?
The second and the most biggest part of my troubles is how to use Chrono Connectivity to perform searches in the resources table? I want to have a search on the frontend where a visitor can select the Destination, date and the duration of stay, while the results show Destination, City, Name, Date, Tour operator (hidden to all except admins), Duration, Price and a link towards a booking form for each provided result.
If anyone is willing to help me out on this one, I'd would mean the world to me and also I would learn a good deal how things should work. Also, If I manage to get some refund from my client for who I'm working this for, I'll be happy to share a certain amount.
Apologies for an extensive post.
Cheers!