<style>
  .mytable{
    font-size:16px;
	width:700px;
	margin-top:10px;
	color:#FFFFFF;
  }
  
  .mytableth{
    background-color:#000000;
	color:#FFCC00;
	padding:5px 5px 5px 5px;
  }
  
    .mytabletd{
        background-color: #EEEEEE;
        text-align: center;
        color: #000000;
    }
    
  .mybtn{
    width:100px;
	font-size:14px;
	font-weight: bold;
	font-family: Arial;
  }
    
    .mybtnsubmit{
        padding: 3px 10px 3px 10px;
	    font-size:14px;
	    font-weight: bold;
	    font-family: Arial;
        color: #0000FF;
    }
    
  .mytext{
    text-align: center;
    padding: 3px;
  }
</style>

<?php
  $t = time();
  $today_date = date("Y-m-d", $t);
  $thisyear = date("Y");
?>

<center>
    
<?php
  if($_SESSION["errmsg"]!==""){
    echo $_SESSION["errmsg"];
    unset($_SESSION["errmsg"]);
  }
?>
    
<?php
  //----- add new annouce --------------------
  if($_GET["ac2"]!="edt"){
?>
<form action="annouce_sav.php" method="post">
<table border="0" cellpadding="0" cellspacing="1" class="mytable">
  <tr>
    <th class="mytableth">ANNOUNCEMENT</th>
    <th class="mytableth" width="130px">FROM</th>
    <th class="mytableth" width="130px">UNTIL</th>
  </tr>
  <tr>
    <td class="mytabletd">
    <textarea name="annouce" style="width: 350px; height: 80px;" placeholder="announcement here..."></textarea>
    </td>
    <td class="mytabletd"><input type="date" name="hfrom" value="<?= $today_date ?>" class="mytext"></td>
    <td class="mytabletd"><input type="date" name="htill" value="<?= $today_date ?>" class="mytext"></td>
  </tr>
  <tr>
    <th class="mytableth" colspan="3">
        <input type="submit" value="ADD ANNOUNCEMENT" class="mybtnsubmit">
    </th>
  </tr>
</table>
</form>
    
<?
}//----- end add new annouce --------------------
?>
    
    
    
    
<hr>
    
<?
    $qanno = "SELECT * FROM punchsys_announce";
    $ranno = mysqli_query($conn,$qanno);
    $nanno = mysqli_num_rows($ranno);
    while($myrow = mysqli_fetch_array($ranno)){
        $tid = $myrow["id"];
        $arrAnno[$tid]["dateFrom"] = $myrow["dateFrom"];
        $arrAnno[$tid]["dateEnd"] = $myrow["dateEnd"];
        $arrAnno[$tid]["descr"] = $myrow["descr"];
    }
  
    $todate = "2023-12-20";
    echo date("Y-m-d", strtotime($todate));
?>
    
</center>