function generateCalendarScript($name, $default_date) { $myCalendar = new tc_calendar($name, true, false); $myCalendar->setIcon("images/iconCalendar.gif"); $myCalendar->setDate(date('d', strtotime($default_date)), date('m', strtotime($default_date)), date('Y', strtotime($default_date))); $myCalendar->setPath("/stats/"); $myCalendar->setYearInterval(1970, 2020); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->setDatePair('fm_date_start', 'fm_date_end'); $myCalendar->writeScript(); }
</form> </td> <td> <?php $date3_default_not_formatted = mktime(0, 0, 0, date("m") - 1, date("d"), date("Y")); $date3_default = date("Y-m-d", $date3_default_not_formatted); $date4_default = date("Y-m-d"); $myCalendar = new tc_calendar("date3", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d', strtotime($date3_default)), date('m', strtotime($date3_default)), date('Y', strtotime($date3_default))); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2000, 2020); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->setDatePair('date3', 'date4', $date4_default); $myCalendar->writeScript(); $myCalendar = new tc_calendar("date4", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d', strtotime($date4_default)), date('m', strtotime($date4_default)), date('Y', strtotime($date4_default))); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2000, 2020); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->setDatePair('date3', 'date4', $date3_default); $myCalendar->writeScript(); ?> </td> <td><div class="arrow-right"></div></td> </tr> </table> </body> </html>
$myCalendar->writeScript(); ?> </div> </div> <div style="float: left;"> <div style="float: left; padding-left: 3px; padding-right: 3px; line-height: 18px;">to</div> <div style="float: left;"> <?php $myCalendar = new tc_calendar("date4", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d', strtotime($date2)), date('m', strtotime($date2)), date('Y', strtotime($date2))); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(1970, 2020); //$myCalendar->dateAllow("", '2009-11-03', false); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->setDatePair('date3', 'date4', $date1); //$myCalendar->setSpecificDate(array("2011-04-01", "2011-04-04", "2011-12-25"), 0, 'year'); $myCalendar->writeScript(); ?> </div> </div> <p> <input type="button" name="button2" id="button2" value="Check the value" onClick="javascript:alert('Date select from '+this.form.date3.value+' to '+this.form.date4.value);"> </p> <p><b>Code:</b></p> <pre><?php <br> $date3_default = "<?php echo $date1; ?> ";<br> $date4_default = "<?php echo $date2; ?>
?> </td><td><?php echo createHours('Start_Hour'); ?> </td><td><?php echo createMinutes('Start_Minutes'); ?> </td></tr> <tr><td><strong>To: </strong></td></tr> <tr><td></td><td>Hour</td><td>Minutes</td></tr> <tr><td><?php $myCalendar = new tc_calendar("End_Date", true, true); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setDatePair('Start_Date', 'End_Date'); $myCalendar->dateAllow('2014-11-01', '', false); $myCalendar->writeScript(); $End_Date = $myCalendar->getDate(); ?> </td><td><?php echo createHours('End_Hour'); ?> </td><td><?php echo createMinutes('End_Minutes'); ?> </td></tr> </table> <br> Sampling resolution: <?php