<?php
if(isset($_POST["setDiet"]))
{
	session_start();  
	$_SESSION['mydiet']=$_POST['mydiet'];
	session_write_close();
	
	$myi = $_POST["mydiet"];
	unset($_COOKIE["mydiett"]);
	setcookie("mydiett", $myi, 360);
}

?>

<!--sub-heard-part-->
  <div class="sub-heard-part">
   <ol class="breadcrumb m-b-0">
	</ol>
   </div>
<!--//sub-heard-part-->
<div class="graph-visual tables-main">
<h4 class="inner-tittle"> Welcome <?php echo $username; ?>, please set the the diet you want to access below</h4>
<div class="graph">
	 <div class="block-page" style="height:300px">					
		<div>					
			<form method="post" name="dietsetter" action="index.php?page=home&i=<?php echo $_GET['i']; ?>"> 
			<div class="form-group">
			
			<label for="take" class="text-uppercase">Diet</label>
		    	<!-- select class="form-control" name="mydiet" required="" style="width:auto; height:auto"> 
				<?php
				
				  $qset = "select * from tpc_set";
				  $rset = mysqli_query($con2, $qset);
				  
				  while($rowset = mysqli_fetch_array($rset))
				  {
					echo "<option>".$rowset['setMonth'].", ".$rowset['setYear']."</option>"; 
				  }	
				  
						    
				  $qset = "select * from pci_set";
				 $rset = mysqli_query($con2, $qset);
				  
				  while($rowset = mysqli_fetch_array($rset))
				  {
					echo "<option>".$rowset['setMonth'].", ".$rowset['setYear']."</option>"; 
				  }


				  $qset = "select * from epci_set";
				  $rset = mysqli_query($con2, $qset);
				  
				  while($rowset = mysqli_fetch_array($rset))
				  {
					echo "<option>".$rowset['setMonth'].", ".$rowset['setYear']."</option>"; 
				  }
				  
					$qset = "select * from phd_set";
				  $rset = mysqli_query($con2, $qset);
				  
				  while($rowset = mysqli_fetch_array($rset))
				  {
					echo "<option>".$rowset['setMonth'].", ".$rowset['setYear']."</option>"; 
				  }
				  
					echo "<option>FEBRUARY, 2022</option><option>OCTOBER, 2019</option>"; 	echo "<option>OCTOBER, 2020</option>";
				  echo "<option>SEPTEMBER, 2019</option>"; 	echo "<option>SEPTEMBER, 2020</option>";
				  echo "<option>MAY, 2019</option>"; 				echo "<option>MAY, 2020</option>";
					echo "<option>FEBRUARY, 2019</option>"; 	echo "<option>FEBRUARY, 2020</option>";


			       ?>
				
			</select-->
			
		 	 </div>
		  	 <!--input name="setDiet" type="submit" class="btn btn-default" value="Set Diet"/--> 
                </form> 
			
		</div>	
		
		<?php 
		echo "<BR><b>EXAM DIET: </b>".$mydiet;

		echo "<BR><BR><b>EXPERIENCE ROUTE DIET: </b> ".$experiencediet;

		echo "<BR><BR><b>PREVIOUS MATURE ROUTE DIET: </b> ".$prevmaturediet;
		
		echo "<BR><BR><b>MATURE ROUTE DIET: </b> ".$maturediet;

		echo "<BR><BR><b>PCI DIET: </b> ".$pcidiet;
	
		
		  if(isset($_SESSION['mydiet']))
		  {
		    
			//echo "<BR><b>SELECTED DIET: </b>".$_SESSION['mydiet'];
		  }

		  if(isset($_COOKIE))
		  {
			  echo $_COOKIE['mydiett'];
		    //echo "<BR><b>SELECTED DIETT: </b>".$_COOKIE["mydiett"];
		  }
		
		
		?>
	 </div>

</div>

</div>