<div id="date">
<input type="text" name="departdate" id="departdate" class="datepicker" value="Depart" />
<input type="text" name="returndate" id="returndate" class="datepicker" value="Return" />
<select name="departdate_day" class="mobile-datepicker">
<?php
$i=1;
while($i < 32){
echo "<option>".$i."</option>";
$i++;
}
?>
</select>
<select name="departdate_monthyear" class="mobile-datepicker">
<?php
$i=0;
while($i < 25){
echo "<option>".date("M Y",strtotime(+$i." month"))."</option>";
$i++;
}
?>
</select>
<select name="returndate_day" class="mobile-datepicker">
<?php
$i=1;
while($i < 32){
echo "<option>".$i."</option>";
$i++;
}
?>
</select>
<select name="returndate_monthyear" class="mobile-datepicker">
<?php
$i=0;
while($i < 25){
echo "<option>".date("M Y",strtotime(+$i." month"))."</option>";
$i++;
}
?>
</select>
<span id="travelDate" style="height:16px;"> </span>
</div>
Now what happens with the above, departdate and returndate display the JQuery calandar. As this calander was to much for the mobile version of my site, I added departdate_day and departdate_monthyear (same for return) which displays a select version of the calandar. Using css, I display none on the select calandar when the large version of the site is viewed, and I set display none to the JQuery calandar once the resolution goes to a mobile size.
The problem I am having relates now to the submit action using php. At the moment, I only handle things for the large version of my site using
$departdate= $_POST['departdate'];
$departarray = explode("/",$departdate);
$departdate = strtotime($departarray[2]."-".$departarray[1]."-".$departarray[0]);
$returndate=$_POST['returndate'];
$returndatearray = explode("/",$returndate);
$returndate = strtotime($returndatearray[2]."-".$returndatearray[1]."-".$returndatearray[0]);
I then send all the information to my database and so forth. How would I go ahead handling the other version of my calandar? I would presume that I would need to use conditional statements to check the size of the resolution, I want to avoid this however as I dont really want several different languages all checking the resolution, incase there is a disagreement
Could I check to see what calanadar is being used somehow, or something along these lines? Any advise as always appreciated.
Cheers
Nick

New Topic/Question
Reply




MultiQuote





|