예제 #1
0
      <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td><h5>Demo:</h5>
            <form name="form1" method="post" action="">
              <p class="largetxt"><b>Fixed Display Style </b></p>
              <table border="0" cellspacing="0" cellpadding="2">
                <tr>
                  <td valign="top" nowrap>Date 1 :</td>
                  <td valign="top"><?php 
$myCalendar = new tc_calendar("date2");
$myCalendar->setIcon("calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(1970, 2020);
$myCalendar->dateAllow('2008-05-13', '2015-03-01', false);
$myCalendar->startMonday(true);
//$myCalendar->autoSubmit(true, "", "test.php");
//$myCalendar->autoSubmit(true, "form1");
$myCalendar->disabledDay("Sat");
$myCalendar->disabledDay("sun");
$myCalendar->showWeeks(true);
$myCalendar->writeScript();
?>
</td>
                  <td valign="top"><ul>
                    <li> Set default date to server date (Auto unset if date is disabled)</li>
                    <li> Set year navigate from 1970 to 2020</li>
                    <li> Allow date selectable from 13 May 2008 to 01 March 2015</li>
                    <li> Not allow to navigate other dates from above </li>
                    <li>Disabled Sat and Sun</li>
                    <li>Show calendar week<br>
예제 #2
0
        if ($y == $y1 && (int) $m < (int) $m1) {
            $m = $m1;
        }
    }
    if ($ta2_set) {
        $m2 = date('m', $time_allow2);
        $y2 = date('Y', $time_allow2);
        if ($y == $y2 && (int) $m > (int) $m2) {
            $m = $m2;
        }
    }
}
$objname = isset($_REQUEST["objname"]) ? $_REQUEST["objname"] : "";
$dp = isset($_REQUEST["dp"]) ? $_REQUEST["dp"] : "";
$cobj = new tc_calendar("");
$cobj->startMonday($startMonday);
$cobj->dsb_days = explode(",", $dsb_txt);
if (!$year_start || !$year_end) {
    $year_start = $cobj->year_start;
    //get default value of year start
    $year_end = $cobj->year_end;
    //get default value of year end
}
//$cobj->setDate($sld, $slm, $sly);
$total_thismonth = $cobj->total_days($m, $y);
if ($m == 1) {
    $previous_month = 12;
    $previous_year = $y - 1;
} else {
    $previous_month = $m - 1;
    $previous_year = $y;
예제 #3
0
function CalendarAutoSubmit($strLabel, $strField, $strForm, $strDate = "")
{
    echo "<tr>";
    echo "\t<td valign=top>";
    echo $strLabel;
    echo "\t</td>";
    echo "\t<td>";
    $myCalendar = new tc_calendar($strField);
    $myCalendar->setIcon("images/iconCalendar.gif");
    if (empty($strDate)) {
        $myCalendar->setDate(date('d'), date('m'), date('Y'));
    } else {
        $arr = explode("-", $strDate);
        $myCalendar->setDate($arr[2], $arr[1], $arr[0]);
    }
    $myCalendar->setPath("calendar/");
    $myCalendar->setYearInterval(1970, 2020);
    $myCalendar->dateAllow('2008-05-13', '2015-03-01', false);
    $myCalendar->startMonday(true);
    $myCalendar->disabledDay("Fri");
    $myCalendar->autoSubmit(true, $strForm);
    $myCalendar->writeScript();
    echo "\t</td>";
    echo "</tr>";
}