calclass1.php
<?php
class calclass1 extends KoolDatePicker {
var $name;
var $prompt;
var $cal;
public function __construct($name="",$prompt="") {
$this->name = $name;
$this->prompt = $prompt;
$cal = new KoolDatePicker("$name"); //Create calendar object
$cal->scriptFolder = $KoolControlsFolder."/KoolCalendar";//Set scriptFolder
$cal->styleFolder="default";
$cal->DateFormat = "m/d/y";
$cal->Init();
echo "<div style='padding-top:10px;padding-bottom:10px;width:100px;'>";
echo "$prompt (mm/dd/yy):<br/>";
echo $cal->Render();
echo "if($cal->Value!=null) {
echo " echo '<b>$prompt (mm/dd/yy):</b> '.$cal->Value;";
echo "}";
echo "</div>";
};
}
calclstest.php
<!-- calclstest.php -->
<!-- 2016011 This function returns calendar start and end controls -->
<!-- -->
<!DOCTYPE html>
<html><body>
<?php
include "inc/gvars.php";
require_once $KoolControlsFolder."/KoolCalendar/koolcalendar.php";
require_once "calclass1.php";
$startdp = new calclass1("startdate","Start Date");
$endtdp = new calclass1("enddate","End Date");
echo dp->("startdate","Start Date");
echo dp->get_name();
?>
<Table><tr>
<td width="100px"><?php echo $startdp;?></td>
<td width="100px"><?php echo $enddp;?></td>
<td width="15px"></td>
<td width="150px" style="vertical-align:bottom">
<div style="padding-top:10px;padding-bottom:10px;width:100px;">
<input type="submit" value="Submit" />
</div>
</td>
</tr></table>
</body>
</html>