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>
Exemple #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>";
}
Exemple #4
0
</option>
        </select>
    </td>
</tr>
<tr>
    <td><b><?php 
    echo A_CONFCONTENT_178;
    ?>
</b>
    </td>
    <td class=success>
		<?php 
    $myCalendar = new tc_calendar("date1", true, false);
    $myCalendar->zindex = 150;
    //default 1
    $myCalendar->setIcon("./plugins/calendar/images/iconCalendar.gif");
    $myCalendar->setPath("./plugins/calendar/");
    if ($INSTALL_DATE && $INSTALL_DATE != "") {
        $installdate = strtotime($INSTALL_DATE);
        $myCalendar->setDate(date('d', $installdate), date('m', $installdate), date('Y', $installdate));
    } else {
        $CorrectedTime = mktime(date("G") + C_TMZ_OFFSET * 60 * 60, date("i"), date("s"), date("m"), date("d"), date("Y"));
        $myCalendar->setDate(date('d', $CorrectedTime), date('m', $CorrectedTime), date('Y', $CorrectedTime));
    }
    $myCalendar->setYearInterval(2000, date('Y'));
    $myCalendar->dateAllow('2000-01-01', date('Y-m-d'));
    $myCalendar->setAlignment('left', 'bottom');
    //optional
    $myCalendar->writeScript();
    ?>
	</td>
 function _calendar($date)
 {
     $myCalendar = new tc_calendar("date1", true);
     $myCalendar->setIcon("../site/calendar/images/iconCalendar.gif");
     //$myCalendar->setDate(date('d'), date('m'), date('Y'));
     if (isset($date)) {
         $myCalendar->setDate(date('d', strtotime($date)), date('m', strtotime($date)), date('Y', strtotime($date)));
     }
     $myCalendar->setPath("../site/calendar/");
     $myCalendar->setYearInterval(2005, 2045);
     //$myCalendar->dateAllow('2008-05-13', '2015-03-01');
     $myCalendar->setDateFormat('Y-m-d');
     //$myCalendar->setHeight(350);
     //$myCalendar->autoSubmit(true, "phmembership");
     $myCalendar->setAlignment('left', 'bottom');
     //$myCalendar->setSpecificDate(array("2011-04-01", "2011-04-04", "2011-12-25"), 0, 'year');
     //$myCalendar->setSpecificDate(array("2011-04-10", "2011-04-14"), 0, 'month');
     // $myCalendar->setSpecificDate(array("2011-06-01"), 0, '');
     $myCalendar->writeScript();
 }
 private function RenderPanel($Prefix, $DefaultTime)
 {
     require_once 'calendar/calendar/classes/tc_calendar.php';
     $html = "";
     $html .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><tr><td nowrap>";
     $html .= "<SPAN CLASS='fieldtext'>" . $Prefix . " Date:</SPAN>";
     $html .= "</td><td>";
     //@todo: give an appropriate html name to this.
     $myCalendar = new \tc_calendar($Prefix . "datepicker", true, false);
     //date5->HTML name.
     $myCalendar->setIcon("calendar/calendar/images/iconCalendar.gif");
     $myCalendar->setDate(date('d', $DefaultTime), date('m', $DefaultTime), date('Y', $DefaultTime));
     //$myCalendar->setDate(date('d'), date('m'), date('Y'));
     $myCalendar->setPath("calendar/calendar/");
     $myCalendar->setYearInterval(2000, 2050);
     $myCalendar->dateAllow('2008-05-13', '2015-03-01');
     $myCalendar->setDateFormat('j F Y');
     $myCalendar->setAlignment('left', 'bottom');
     $myCalendar->zindex = 10;
     // This should, hypothetically, redirect the output from echo to a string.
     // It's either this, or rewrite the control.
     ob_start();
     $myCalendar->writeScript();
     $calendarhtml = ob_get_contents();
     ob_end_clean();
     $html .= "<SPAN CLASS='fieldtext'>";
     $html .= $calendarhtml;
     $html .= "</SPAN>";
     $html .= "</td><td>";
     //$html .= $myCalendar->writeScript();
     $html .= "<SELECT NAME=\"" . $Prefix . "hour\">";
     // $_POST["starthour"], $_POST["endhour"]
     for ($hour = 1; $hour <= 12; $hour++) {
         $html .= "<OPTION value=\"" . str_pad($hour, 2, "0", STR_PAD_LEFT) . "\"";
         if ($hour == date("g", $DefaultTime)) {
             $html .= " selected=\"selected\"";
         }
         $html .= ">" . $hour . "</OPTION>";
     }
     $html .= "</SELECT>";
     $html .= "<SELECT NAME=\"" . $Prefix . "minute\">";
     // $_POST["startminute"], $_POST["endminute"]
     for ($minute = 0; $minute < 60; $minute++) {
         $html .= "<OPTION VALUE=\"" . str_pad($minute, 2, "0", STR_PAD_LEFT) . "\"";
         if ($minute == date("i", $DefaultTime)) {
             $html .= " selected=\"selected\"";
         }
         $html .= ">" . str_pad($minute, 2, "0", STR_PAD_LEFT) . "</OPTION>";
     }
     $html .= "</SELECT>";
     $html .= "<SELECT NAME=\"" . $Prefix . "period\">";
     // $_POST["startperiod"], $_POST["startperiod"]
     $html .= "<OPTION VALUE=\"AM\"";
     if ("AM" == date("A", $DefaultTime)) {
         $html .= " selected=\"selected\"";
     }
     $html .= ">AM</OPTION>";
     $html .= "<OPTION VALUE=\"PM\"";
     if ("PM" == date("A", $DefaultTime)) {
         $html .= " selected=\"selected\"";
     }
     $html .= ">PM</OPTION>";
     $html .= "</SELECT>";
     $html .= "</tr></table>";
     $html .= "<BR>";
     return $html;
 }
Exemple #7
0
<?php

$url = $_SERVER['REQUEST_URI'];
$arr_url = explode("?", $url);
$url2 = $arr_url[0];
$date3_default = $data_ini;
$date4_default = $data_fin;
$myCalendar = new tc_calendar("date3", true, false);
$myCalendar->setIcon("../inc/calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d', strtotime($date3_default)), date('m', strtotime($date3_default)), date('Y', strtotime($date3_default)));
$myCalendar->setPath("../inc/calendar/");
$myCalendar->setYearInterval(2010, 2025);
$myCalendar->setAlignment('left', 'bottom');
$myCalendar->setDatePair('date3', 'date4', $date4_default);
$myCalendar->writeScript();
$myCalendar = new tc_calendar("date4", true, false);
$myCalendar->setIcon("../inc/calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d', strtotime($date4_default)), date('m', strtotime($date4_default)), date('Y', strtotime($date4_default)));
$myCalendar->setPath("../inc/calendar/");
$myCalendar->setYearInterval(2010, 2025);
$myCalendar->setAlignment('left', 'bottom');
$myCalendar->setDatePair('date3', 'date4', $date3_default);
$myCalendar->writeScript();