Get KoolPHP UI with 30% OFF!

Trying to extend the calendar class

ADavid Wulkan
I don't have a good understanding of classes and I am trying to learn how to use OOP. Anyway, I've created this code hoping to have minimal code in the HTML file. I'm fairly certain my problem is in the extended class definition? Can anyone please assist me in how extending should be coded?
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>
Posted Jan 17, 2016 Kool