Example #1
0
										{
											alert("Hello, value has been changed : "+document.getElementById("date2").value+" ["+v+"]");
										}
										</script>
										<?php 
$myCalendar = new tc_calendar("date2", true);
$myCalendar->setAutoHide(false);
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(1960, date('Y'));
$myCalendar->dateAllow('1960-03-01', date('Y-m-d'));
//$myCalendar->autoSubmit(true, "form1");
$myCalendar->setAlignment('left', 'bottom');
$myCalendar->disabledDay('sun');
$myCalendar->setSpecificDate(array("2011-04-01", "2011-04-14", "2010-12-25"), 0, 'year');
$myCalendar->setOnChange("myChanged('Test message')");
$myCalendar->writeScript();
?>
                                    </td>
									<td><input type="button" name="button2" id="button2" value="<?php 
echo L_CHK_VAL;
?>
" onClick="javascript:alert(this.form.date2.value);" class="font"></td>
								</tr>
							</table>
							<p class="largetxt"><b>DatePicker with no input box</b></p>
							<table border="0" cellspacing="0" cellpadding="2">
								<tr>
									<td nowrap>Date 3 :</td>
									<td valign=top>
										<?php 
Example #2
0
						function myChanged(v){
							alert("Hello, value has been changed : "+document.getElementById("date1").value+"["+v+"]");
						}
						//-->
						</script>
                    <?php 
$myCalendar = new tc_calendar("date1", true);
$myCalendar->setIcon("calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(1960, 2015);
$myCalendar->dateAllow('2010-01-01', '2015-03-01');
//$myCalendar->setHeight(350);
//$myCalendar->autoSubmit(true, "form1");
$myCalendar->setSpecificDate(array("2011-04-01", "2011-04-13", "2011-04-25"), 0, 'month');
$myCalendar->setOnChange("myChanged('test')");
//$myCalendar->rtl = true;
$myCalendar->writeScript();
?>
</td>
                  <td><input type="button" name="button" id="button" value="Check the value" onClick="javascript:alert(this.form.date1.value);"></td>
                </tr>
              </table>
              <ul>
                <li>Default date  to current server date (Auto unset if date is disabled)</li>
                <li>Set year navigate from 1960 to 2015 </li>
                <li>Allow date selectable from 01 January 2010 to 01 March 2015</li>
                <li>Allow to navigate other dates from above </li>
                <li>Disable  specific date 1, 13, and 25  of every month</li>
                <li>Custom alert when calendar's value has been changed</li>
              </ul>
    echo $days_row;
    foreach ($global_times as $time) {
        echo '<tr><th class="reservation_time_th">' . $time . '</th>';
        $i = 0;
        while ($i < 7) {
            $i++;
            echo '<td><div class="reservation_time_div"><div class="reservation_time_cell_div" id="div:' . $week . ':' . $i . ':' . $time . '" onclick="void(0)">' . read_reservation($week, $i, $time, $conn) . '</div></div></td>';
        }
        echo '</tr>';
    }
    echo '</table>';
} else {
    echo '<div class="box_div" id="cp_div"><div class="box_top_div"><a href="#"><input type="button" class="small_button blue_button" value="' . $_SESSION['user_name'] . '"></a></div>';
    $myCalendar = new tc_calendar("date1", true, false);
    $myCalendar->setDate(date('d'), date('m'), date('Y'));
    $myCalendar->setPath("calendar/");
    $myCalendar->setYearInterval(date('Y'), date('Y') + 10);
    $myCalendar->dateAllow(date('Y-m-d'), '2020-12-31');
    $myCalendar->setIcon("calendar/images/iconCalendar.gif");
    $myCalendar->setAlignment("right", "bottom");
    $myCalendar->setOnChange("myChanged()");
    $myCalendar->writeScript();
    ?>
	  <script language="javascript">
    var global_week_number ="<?php 
    echo global_week_number;
    ?>
";
	</script> <?php 
    echo '</div><div class="box_div" id="reservation_div"><div class="box_top_div" id="reservation_top_div"><div id="reservation_top_left_div"><a href="." id="previous_week_a">&lt; Prethodni dan</a></div><div id="reservation_top_center_div">Rezervacije za datum  <span id="week_number_span">' . global_week_number . '</span></div><div id="reservation_top_right_div"><a href="." id="next_week_a">Slijedni dan &gt;</a></div></div><div class="box_body_div"><div id="reservation_table_div"></div></div></div><div id="reservation_details_div">';
}