예제 #1
0
if (!empty($theDate)) {
    $newDate = strtotime($theDate);
    $myCalendar->setDate(date('d', $newDate), date('m', $newDate), date('Y', $newDate));
    $nowDate = date("D, F d, Y", $newDate);
} else {
    $myCalendar->setDate(date('d'), date('m'), date('Y'));
    $theDate = date("Y-m-d");
    $nowDate = date("D, F d, Y");
}
$myCalendar->setPath("./");
$myCalendar->setYearInterval($thisYear, $thisYear);
$myCalendar->dateAllow($thisDate, $thisRange, false);
$myCalendar->startMonday(true);
//$myCalendar->setDateFormat('d, m, Y');
//$myCalendar->autoSubmit(true, "", "index.php");
$myCalendar->autoSubmit(true, "form1");
$myCalendar->writeScript();
echo "<input type='hidden' name='class' id='class' value='{$class}'>";
?>
    </form>
	</div>
	<div id="class_selector">
	<h1>Selected Date: </h1><h2><strong><?php 
echo $nowDate;
?>
</strong></h2><br/>
  	<?php 
// LIST BY CLASS
mysql_select_db($database_equip, $equip);
$classes = mysql_query("SELECT * FROM class ORDER BY class.Name") or die(mysql_error());
?>
예제 #2
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>";
}
예제 #3
0
 public function RenderControl()
 {
     require_once '/calendar/calendar/classes/tc_calendar.php';
     $html = "";
     $html .= "<DIV NAME=" . $this->HTMLName . " CLASS=" . $this->CSSClass . ">";
     $html .= "<SPAN CLASS='header'>Calico: Composite Calendar</SPAN>";
     $html .= "<BR>";
     $html .= "<FORM METHOD=\"Post\" ACTION=\"calico_calendar.php\">";
     $html .= "<INPUT CLASS='button' TYPE=\"Submit\" VALUE=\"Calendar Manager\">";
     $html .= "</FORM>";
     $html .= "<FORM METHOD=\"Post\" ACTION=\"calico_feed.php\">";
     $html .= "<INPUT CLASS='button' TYPE=\"Submit\" VALUE=\"Feed Manager\">";
     $html .= "</FORM>";
     $html .= "<FORM METHOD=\"Post\" ACTION=\"calico_event.php\">";
     $html .= "<INPUT CLASS='button' TYPE=\"Submit\" VALUE=\"New Event\">";
     $html .= "</FORM>";
     $dropdownhtml = $this->CompositeDropDown->Draw();
     $checkboxhtml = $this->CompositeCheckBox->Draw();
     $html .= $dropdownhtml;
     $html .= $checkboxhtml;
     $html .= "<FORM action=\"calico_compositecalendar.php\" method=\"post\" NAME='myCalendar'>";
     $html .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><tr><td nowrap>";
     $html .= "<SPAN CLASS='fieldtext'>Selected Date:</SPAN>";
     $html .= "</td><td>";
     $html .= "<SCRIPT LANGUAGE=\"javascript\" src=\"calendar/calendar/calendar.js\"></SCRIPT>";
     //@todo: give an appropriate html name to this.
     $myCalendar = new \tc_calendar("compositecalendardatepicker", true, false);
     $myCalendar->setIcon("calendar/calendar/images/iconCalendar.gif");
     //$myCalendar->setDate(01, 03, 2010);
     $myCalendar->setDate(date('d', $this->SelectedTime), date('m', $this->SelectedTime), date('Y', $this->SelectedTime));
     //echo "Day: " . date('d', $this->SelectedTime) . " Month: " . date('m', $this->SelectedTime) . " Year " . date('Y', $this->SelectedTime) . "<BR>";
     //$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->autoSubmit(true, "myCalendar");
     $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></tr></table>";
     $html .= "</FORM>";
     $html .= "<DIV NAME=\"CalendarRefreshButton\" CLASS='RefreshButton' style='position:absolute;height:8%;width:9%;z-index:1'>";
     $html .= "<FORM METHOD=\"Get\" ACTION=\"calico_compositecalendar.php\">";
     $html .= "<INPUT CLASS='button' TYPE=\"Submit\" VALUE=\"Refresh\">";
     $html .= "</FORM>";
     $html .= "</DIV>";
     $html .= "<BR><BR><BR>";
     //@todo: Abstract everything.
     $html .= "<DIV class='slice' style=\"position:absolute;width:100%;height:100%;min-height:1000px;\">";
     $html .= $this->RenderView();
     $html .= "</DIV>";
     $html .= "</DIV>";
     return $html;
 }