<?php
require("includes/dbconnect.php");
require("includes/config.php");
require("includes/function.php");

mysqli_select_db($conn, 'atlas_root');
if ($_GET['qyear']) {

    $year = $_GET["qyear"];
    $result = mysqli_query($conn, "SELECT *, DATE_FORMAT(`startdate`, '%d-%m-%Y') as stdate, DATE_FORMAT(`lastdate`, '%d-%m-%Y')as endate FROM compyear WHERE finyear='$year'") or die(mysqli_error($conn));
    $cc = mysqli_fetch_assoc($result);

    $zsdate = $cc['stdate'];
    $zedate = $cc['endate'];

    $_SESSION["zdbyear_".$zsdate] = $zsdate;
    $_SESSION["zdbyear_".$zedate] = $zedate;
    
    echo "<table border='0'>";
     echo "<tr>";
      echo "<td>";
         echo "<strong>Start Date-</strong>";
      echo "</td>";   
      echo "<td>";   
         echo "<strong><font size='3px' color='#FF9966'>$cc[stdate]</font></strong>";
      echo "</td>";
     echo "</tr>";
     echo "<tr>";
      echo "<td>";
         echo "<strong>End Date-</strong>";
      echo "</td>";   
      echo "<td>";   
         echo "<strong><font size='3px' color='#FF9966'>$cc[endate]</font></strong>";
      echo "</td>";
     echo "</tr>";
    echo "</table>";
   
}
?>
