예제 #1
0
}
$dp_time = $date_pair_value ? $date_pair_value : "";
$select_days = array();
if ($sld > 0 && $slm > 0 && $sly > 0) {
    $sldate = "{$sly}-{$slm}-{$sld}";
    for ($i = 0; $i < $interval; $i++) {
        $this_day = $cdate->addDay("Y-m-d", $i, $sldate);
        $select_days[] = $this_day;
    }
}
//write current month
for ($day = 1; $day <= $total_thismonth; $day++) {
    $date_str = $y . "-" . str_pad($m, 2, "0", STR_PAD_LEFT) . "-" . str_pad($day, 2, "0", STR_PAD_LEFT);
    $date_num = $cdate->getDayOfWeek($date_str);
    $day_txt = $cdate->getDate('D', $date_str);
    $currentTime = $cdate->getTimestamp($y . "-" . $m . "-" . $day);
    $htmlClass = array();
    $is_today = $cdate->differentDate($date_str) == 0 ? 1 : 0;
    //$is_today = $currentTime - strtotime($today);
    $htmlClass[] = $is_today ? "today" : "general";
    $dateLink = true;
    //check date allowed
    if ($ta1_set && $ta2_set) {
        //both date specified
        $dateLink = $time_allow1 <= $currentTime && $currentTime <= $time_allow2;
    } elseif ($ta1_set) {
        //only date 1 specified
        $dateLink = $currentTime >= $time_allow1;
    } elseif ($ta2_set) {
        //only date 2 specified
        $dateLink = $currentTime <= $time_allow2;