<?php $myCalendar = new tc_calendar("date1", true); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(01, 03, 1960); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(1960, 2015); $myCalendar->dateAllow('1960-01-01', '2015-03-01'); $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-13", "2011-04-25"), 0, 'month'); $myCalendar->setOnChange("myChanged('test')"); $myCalendar->writeScript(); ?> <html> <head> <script language="javascript"> < !-- function myChanged(v){ alert("Hello, value has been changed : "+document.getElementById("date1").value+"["+v+"]"); } //--> </script> </head> </html>
<br /> Your page content to the point you want to insert the calendar form <form name="calendar" method="post" action=""> <table> <tr> <td> <?php // Call the calendar constructor - use the desired form and format, according to the instructions/samples provided on triconsole.com $myCalendar = new tc_calendar("date1", true); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->zindex = 150; //default 1 $myCalendar->setYearInterval(1995, date('Y')); $myCalendar->dateAllow('1960-03-01', date('Y-m-d')); //$myCalendar->autoSubmit(true, "calendar"); //$myCalendar->setDateFormat('l, dS \of F Y'); $myCalendar->disabledDay("sat"); $myCalendar->disabledDay("sun"); $myCalendar->setSpecificDate(array("2011-04-14", "2010-12-25"), 0, 'month'); $myCalendar->setSpecificDate(array("2011-04-01"), 0, 'year'); $myCalendar->setAlignment('right', 'bottom'); //optional $myCalendar->writeScript(); ?> </td> <tr/> </table> </form> Rest of your page body content
</ul> <p><b>Code:</b></p> <pre><?php<br> $myCalendar = new tc_calendar("date1", true);<br> $myCalendar->setIcon("calendar/images/iconCalendar.gif");<br> $myCalendar->setDate(01, 03, 1960);<br> $myCalendar->setPath("calendar/");<br> $myCalendar->setYearInterval(1960, 2015);<br> $myCalendar->dateAllow('1960-01-01', '2015-03-01');<br> $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-13", "2011-04-25"), 0, 'month');<br> $myCalendar->setOnChange("myChanged('test')");<br> $myCalendar->writeScript();<br> ?> <script language="javascript"><br><!--<br>function myChanged(v){<br> alert("Hello, value has been changed : "+document.getElementById("date1").value+"["+v+"]");<br>}<br>//--><br></script></pre> <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><?php $myCalendar = new tc_calendar("date5", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); //$myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2000, 2015); $myCalendar->dateAllow('2008-05-13', '2015-03-01'); $myCalendar->setDateFormat('j F Y'); //$myCalendar->setHeight(350); //$myCalendar->autoSubmit(true, "form1"); $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(); ?> </td> <td><input type="button" name="button" id="button" value="Check the value" onClick="javascript:alert(this.form.date5.value);"></td> </tr> </table> <ul> <li>No default date</li>
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 $myCalendar = new tc_calendar("date3", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(1945, date('Y')); $myCalendar->dateAllow('2008-05-13', date('Y-m-d')); $myCalendar->setAlignment('left', 'bottom'); //$myCalendar->autoSubmit(true, "form1"); $myCalendar->writeScript(); ?> </td> <td><input type="button" name="button3" id="button3" value="<?php echo L_CHK_VAL; ?> " onClick="javascript:alert(this.form.date3.value);" class="font"></td> </tr> </table> <p class="largetxt"><b>Date Pair Example</b></p> <div style="float: left;"> <div style="float: left; padding-right: 3px; line-height: 18px;">Date 4 interval from:</div> <div style="float: left;">
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>"; }
<div class="content"> welcome : <?php print $userRow['username']; ?> <div class="form-container"> <form id="form_search" method="post"> <h2>Search by date.</h2><hr /> <?php require 'calendar/tc_calendar.php'; $myCalendar = new tc_calendar("date5", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2015, 2017); $myCalendar->dateAllow('2015-11-11', '2016-01-01'); $myCalendar->writeScript(); ?> <div class="clearfix"></div><hr /> <div class="form-group"> <button type="submit" class="btn btn-block btn-primary" name="btn_search"> <i class="glyphicon glyphicon-open-file"></i> Search </button> </div> </form> </div> <br> <?php if (isset($_POST['btn_search'])) { $date_ride = $_POST['date5']; $query_search = "SELECT * FROM ride_history where date=? and user_id!=?";
<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> </tr> </table> <table align="center" width="780" class=table> <tr bgcolor="#FFFFFF"><td colspan=2 align=center><a name="skins"></a><b><?php echo A_CONF_9; ?> </b></td></tr><!--Rooms & Skins--> <tr class="thumbIndex"> <td valign=center align=center height="20" class=tabtitle><?php echo A_CONFTITLE_1;
echo L_PRO_7; ?> :</TD> <TD VALIGN="TOP" CLASS=success> <?php $myCalendar = new tc_calendar("date1", true, true); $myCalendar->zindex = 150; //default 1 $myCalendar->setIcon("plugins/calendar/images/iconCalendar.gif"); $myCalendar->setPath("plugins/calendar/"); if (isset($BIRTHDAY)) { $birth_day = strtotime($BIRTHDAY); $myCalendar->setDate(date('d', $birth_day), date('m', $birth_day), date('Y', $birth_day)); } $myCalendar->setYearInterval(1935, date('Y')); $myCalendar->dateAllow('1935-01-01', date('Y-m-d')); $myCalendar->writeScript(); ?> <?php if (!$done && C_REQUIRE_BDAY) { echo "<SPAN CLASS=\"error\">*</SPAN>"; } ?> <INPUT TYPE="hidden" NAME="BIRTHDAY" VALUE="<?php echo $BIRTHDAY; ?> "> </TD> </TR> <TR> <TD ALIGN="RIGHT" VALIGN="TOP" NOWRAP="NOWRAP"><?php
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">< 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 ></a></div></div><div class="box_body_div"><div id="reservation_table_div"></div></div></div><div id="reservation_details_div">'; }
$theDate = $thisDate; } $myCalendar = new tc_calendar("date1"); $myCalendar->setIcon("images/iconCalendar.gif"); 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
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; }
<form action="" method="post" autocomplete="on" > <table align="center" cellspacing="0" > <tr class="row green" > <td><label><b>Fecha de la VM:<b><br> <?php require_once 'calendar/classes/tc_calendar.php'; $myCalendar = new tc_calendar("date1", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2014, 2017); $myCalendar->dateAllow('2014-01-01', '2017-12-31'); $myCalendar->setDateFormat('j F Y'); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->showWeeks(true); $myCalendar->startMonday(true); $myCalendar->setTheme('theme1'); $myCalendar->writeScript(); ?> </td> <td><label><b>Nombre de la Ventana:<b><br> <input size="72" type="text" name="form_nom_vm" required><br></td> <td><label><b>Ticket No.:<b><br> <input type="text" name="form_ticket_vm" required><br></td> <td> <label><b>Documento Asociado:</b><br> <select name="form_vm_doc">
<label for="limit" class="col-lg-2 control-label"><?php echo $textos[9]; //Fecha límite ?> </label> <div class="col-lg-10"> <input type="hidden" class="form-control" name="limit" placeholder=" <?php require_once 'calendar/classes/tc_calendar.php'; $myCalendar = new tc_calendar("date5", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2000, 2100); $myCalendar->dateAllow('2000-01-01', '2100-01-01'); $myCalendar->setDateFormat('j F Y'); $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(); ?> </div> </div> <p class="pull-right"> <input type="hidden" name="ca" value="<?php
</td><td><?php echo createHours('Start_Hour'); ?> </td><td><?php echo createMinutes('Start_Minutes'); ?> </td></tr> <tr><td><strong>To: </strong></td></tr> <tr><td></td><td>Hour</td><td>Minutes</td></tr> <tr><td><?php $myCalendar = new tc_calendar("End_Date", true, true); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setDatePair('Start_Date', 'End_Date'); $myCalendar->dateAllow('2014-11-01', '', false); $myCalendar->writeScript(); $End_Date = $myCalendar->getDate(); ?> </td><td><?php echo createHours('End_Hour'); ?> </td><td><?php echo createMinutes('End_Minutes'); ?> </td></tr> </table> <br> Sampling resolution: <?php echo createResolution('resol', 3);