<?php /* by title */ ?>
<?php
include('../../../../config/config.php');
$key = "";
$accession =  addslashes($_POST['accession']);
$count=0;
$dummy=mysql_query("select * from books WHERE accession_no LIKE '%$accession%'") or die(mysql_error());

while( $new = mysql_fetch_array($dummy)) {
	$count++;
	}

	if($count == 0){
	echo "<div class='error'>no result</div>";
	}else{
	?>
<div class="resulter">
<div class="demo_jui">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead>
	<tr class="title">
		<th>Accession #</th>
		<th class="btitle">Title</th>
		<th class="author">Author</th>
		<th >Publisher Name</th>
		<th>ISBN</th>
		<th>Copies</th>
		<th>Class Number</th>
		<th>Status</th>
	</tr>
</thead>
<tbody>		
<?Php
$sql=mysql_query("select * from books WHERE accession_no LIKE '%$accession%'") or die(mysql_error());

	
   WHILE($row = mysql_fetch_array($sql)){  
	$count++;
	$bookid= $row['accession_no'];
	$title=$row['title'];
	$author=$row['author'];
	$publishername=$row['publisher_name'];
	$placeofpublication=$row['place_publication'];
	$isbn=$row['isbn_no'];
	$copy=$row['copyright_year'];
	$remarks=$row['remarks'];
	$status=$row['status'];
	$copies=$row['copies'];		
	$call_number=$row['call_number'];
	$subject=$row['subclass_1'];
?>

<div class='all<?php echo $bookid; ?> display_all'>
		<div class="close">X</div>
		<p><label>Accession : </label><span><?php echo $bookid; ?></span></p>
		<p><label>Title : </label><span><?php echo $title; ?></span></p>
		<p><label>Author : </label><span><?php echo $author; ?></span></p>
		<p><label>Publisher Name : </label><span><?php echo $publishername; ?></span></p>
		<p><label>Place of Publication : </label><span><?php echo $placeofpublication; ?></span></p>
		<p><label>isbn : </label><span><?php if($isbn == ''){ echo 'No available data';}else{echo $isbn;}?></span></p>
		<p><label>Copyright Year : </label><span><?php echo $copy; ?></span></p>
		<p><label>Number of Copies : </label><span><?php echo $copies; ?></span></p>
		<p><label>Class Number : </label><span><?php echo $call_number; ?></span></p>
		<p><label>Subject : </label><span><?php echo $subject; ?></span></p>
		<p><span>
		<?php
		if($status == "E"){
		echo "<div class='blue'>Existing</div>";
		}elseif($status=="L"){
		echo "<div class='red'>Lost</div>";
		}else{
		echo "<div class='green'>Subject For Replacement</div>";
		}
		?></span></p>
</div>

<tr  class="gradeX">
<td><?php echo $bookid; ?></td>
<td class="title_td"><div name="show" id="<?php echo $bookid; ?>"><?php echo $title; ?></div></td>
<td><?php echo $author; ?></td>
<td><?php echo $publishername; ?></td>
<td><?php if($isbn == ''){ echo 'No data';}else{echo $isbn;}?></td>
<td><?php echo $copies; ?></td>
<td><?php echo $call_number; ?></td>
<td>	<p><span>
		<?php
		if($status == "E"){
		echo "Existing";
		}elseif($status=="L"){
		echo "Lost";
		}else{
		echo "Subject For Replacement";
		}
		?></span></p></td>
</tr>
	
<?php }?>
</tbody>
</table>
</div>
</div>
<?php } ?>
<script type="text/javascript" src="js/modal_allresults.js" ></script>
<script type="text/javascript" src="js/jquery-1.6.js" ></script>
<script type="text/javascript" language="javascript" src="administrator/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
	jQuery(document).ready(function() {
		oTable = jQuery('#example').dataTable({
			"bJQueryUI": true,
			"sPaginationType": "full_numbers"
		});
	}); 
</script>