<?php
include ("../include/session.php");
if (!$session->logged_in) {
	header("Location: ../../main.php");
} else {
	include ("../header.php");
//	include ("../include/db.php");
	require_once('classes/tc_calendar.php');
	
?>

<?php
	$d = date("d");
	$m = date("m");
	$y = date("Y");
		require_once('classes/tc_calendar.php');
	
?>
<link
	href="calendar.css" rel="stylesheet" type="text/css" />
<script
	language="javascript" src="../include/calendar.js"></script>
<style type="text/css">
<!--
.style1 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #0066CC;
	font-size: x-small;
}
.style8 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: small;
	font-weight: bold;
	color: #0066FF;
}
-->
</style>
<?php 
    $entryDate = isset($_REQUEST["date3"]) ? $_REQUEST["date3"] : "";

	$today = date('Y-m-d');
	$query = "SELECT * FROM agenda WHERE entrydate = '" . $entryDate . "'";
	$result = execsql($query);
	$i = 0;
	$entryDate2 = strtotime($entryDate);
	$num = mysql_num_rows($result);
	$b1 = mysql_result($result, 0, "productionNo1");
	$b2 = mysql_result($result, 0, "selectColor1");
	$b3 = mysql_result($result, 0, "productionNo2");
	$b4 = mysql_result($result, 0, "selectColor2");
	$n1 = mysql_result($result, 0, "note1");
	$n2 = mysql_result($result, 0, "note2");
	$n3 = mysql_result($result, 0, "note3");
	$n4 = mysql_result($result, 0, "note4");
	$n5 = mysql_result($result, 0, "note5");
	$n6 = mysql_result($result, 0, "note6");
	?>

<div class="agendabox2"> <?php echo date('l, d-m-Y',$entryDate2) ?> </div>
<div class="agendaspacebox"><br /></div>
<div class="agendabox3"> <span class="style1">Select date: </span><br />
    
<form action="Calendar.php" method="post">
        <div align="right">
          <?php
		$myCalendar = new tc_calendar("date3", true);
		$myCalendar->setIcon("../img/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2000, 2030);
	 // $myCalendar->dateAllow('2008-05-13', '2010-03-01', false);
		//$myCalendar->setHeight(350);
		//$myCalendar->autoSubmit(true, "form1");
		$myCalendar->writeScript();?>
          
        <?php 
		$timeStamp = strtotime($entryDate);
		$prevDay = strtotime('-1 days', $timeStamp);
		$nextDay = strtotime('+1 days', $timeStamp);
		?> 
		  <a href="Calendar.php?date3=<?php echo date('Y-m-d', $prevDay) ?>"><img src="../../Images/prev_btn.png" width="75" height="25" border="0" /></a><a href="Calendar.php?date3=<?php echo date('Y-m-d', $nextDay) ?>"><img src="../../Images/next_btn.png" width="75" height="25" border="0" /></a>
		  <input name="submitok"  type="image" src="../../Images/go_btn.png" align="right" width="40" height="25" />
    </div>
  </form>
</div>
  <div class="agendabox"> <span class="style8">Planned production:</span><br />
      <?php if ($b1!=0) { echo $b1." - ".$b2 ;} ?>
    <br />
      <?php if ($b3!=0) { echo $b3." - ".$b4 ;} ?>
</div>
<div class="agendaspacebox"><br /></div>
<div class="agendabox4"> <span class="style8">Quick links:</span>&nbsp;&nbsp;&nbsp;<a href="employeeMenu.php">&nbsp;Weekly attendance</a> &nbsp;&nbsp;<?php if($session->isAdmin() || $session->isRadstoneReceptionUser()) { ?>
		<a href="agendaEntries.php">
		<?php } else { ?>
		<a href="#" onclick="MM_popupMsg('not allowed')">
		<?php } ?>&nbsp;New Calendar Entry</a> <br />
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../Production/productionMenu.php">Production this month</a> <br />
<br /> </div>
<br />
  <br /><br /><br /><br /><br /><br /><br /><br />
  
   <?php if ($n1!="") { ?>	
	  <div class="agendabox5">
		<?php  echo $n1 ?>
      </div>
	  <?php } ?>
		
	<?php if ($n2!="") { ?>	
	  <div class="agendabox5">
		<?php  echo $n2 ?>
      </div>
	  <?php } ?>
		
	<?php if ($n3!="") { ?>	
	  <div class="agendabox5">
		<?php  echo $n3?>
      </div>
	  <?php } ?>
		
	<?php if ($n4!="") { ?>	
	  <div class="agendabox5">
		<?php  echo $n4 ?>
      </div>
	  <?php } ?>
	  
	 <?php if ($n5!="") { ?>	
	  <div class="agendabox5">
		<?php  echo $n5 ?>
      </div>
	  <?php } ?>
	  
	<?php if ($n6!="") { ?>	
	  <div class="agendabox5">
		<?php  echo $n6 ?>
      </div>
	  <?php } ?>   
	  
 
<p align="right"><br />
</p>
<p>&nbsp;</p>
  <p>
    <?php  
	include("../footer.php");
	
}

 ?>
    <br />
</p>
