I am having an issue with generating the report in the view file. Prior running the view, I have loaded up an array(TY) and a last_TY and put them in the session variables. Now I am in the view and here is the code:
<?php
echo "<br><br><br><br><br><br><h3>Report for: ".$_SESSION['campaign']." for tax year ended ".$_SESSION['last_TY'];
?>
<form method="post">
<?php
$taxyear=$_SESSION['last_TY'];
\koolreport\inputs\Select::create(array(
"name"=>"taxyear",
"data"=>$_SESSION['TY'], //this is a list of years in an array
"defaultOption"=>array($taxyear=>''),
));
?>
<button type="submit">Submit</button>
</form>
<?php
if (isset($_POST['taxyear']))
$_SESSION['last_TY']=$_POST['taxyear'];
?>
The problem is that when a user picks a taxyear from the Select, and then pressed Submit, the echo is not working. Instead is is showing the PREVIOUS tax year. The only way to get <?php echo "<br><br><br><br><br><br><h3>Report for: ".$_SESSION['campaign']." for tax year ended ".$_SESSION['last_TY']; ?> to run with the proper value, is to press select again.