<?php	SESSION_START();


		if(!isset($_SESSION['admin_id'])){	

	
		header("location: ../index.php");}
	
	
		include("../config/config.php");
		

?>
<?php 


/*  $year = '1981';
	
	$date = '13';

	$month = '7'; */
	
	
/* 	$year2 = '1988';

	$date2 = '13';
	
	$month2 = '7';  */
	

 	$year = $_POST['year1'];

	$date =  $_POST['day1'];
	
	$month =  $_POST['month1'];

	
	$year2 = $_POST['year2'];

	$date2 =  $_POST['day2'];

	$month2 =  $_POST['month2'] ;


	$date1 = $year.'-'.$month.'-'.$date;

	$date2 = $year2.'-'.$month2.'-'.$date2;


	
	$year = mysql_query("SELECT * FROM books WHERE date_received BETWEEN '$date1' AND '$date2'") or die(mysql_error());
 
	/* $year = mysql_query("SELECT * FROM books WHERE date_received BETWEEN '$year' AND '$year2'") or die(mysql_error()); */


?>	

<?php include("head.php"); ?>
<body>
<div class="wrapper">
<header>
<?php include("navigation.php"); ?>
</header>

<script>
			
$(document).ready( function() {
			
				$('.print_data').click( function() {
				$('.result').printElement({
 
				overrideElementCSS:['css/print.css',
	{ href:'css/print.css',media:'print'}],
				printMode:'popup'	
				});
				})

				})
</script>
<div class="col-main">
<button onClick="window.location='year_reportFrom.php'" class="btn">Back</button>
<button class='print_data btn'>Print</button>
<div class="result">
<div class="report_header"><h4>Republic of the Philippines</h4>
<h3>Technological University of the Philippines - Visayas</h3>
<h4>Captain Sabi St., Zone II</h4>
<h4>Talisay City, Negros Occidental</h4></div>
<table style="padding: 2px;" class="print">
<thead>
<th>Title</th>
<th>Author</th>
<th>Publisher</th>
<th>Place of Publication</th>
<th>ISBN Number</th>
<th>Class Number</th>
<th>Date Recieved</th>
</thead>
<tbody>
		<?php 
		$count = 0;
		WHILE($print = mysql_fetch_object($year)){
		$count++;
		?>	
		<tr>
		<td><?php echo $print->title; ?></td>
		<td><?php echo $print->author; ?></td>
		<td><?php echo $print->publisher_name; ?></td>
		<td><?php echo $print->place_publication; ?></td>
		<td><?php echo $print->isbn_no; ?></td>
		<td><?php echo $print->call_number; ?></td>
		<td><?php echo $print->date_received; ?></td>
		</tr>
		<?php 
		}
		?>
		</tbody>
		<tfoot>
		<tr>
		<td colspan="7" style="text-align: right;">Total of <?php echo $count; ?> Items.</td>
		</tr>
		</tfoot>
		</table>
		</div>
		</div>
<?php include("left.php"); ?>
<?php include("footer.php"); ?>

</div>
</body>
</html>

