GOOGLE

aku nok ndi : /home/astwardha/public_html/polylibrary/library/
File Up :
aku nok ndi : /home/astwardha/public_html/polylibrary/library/oneday_borrow - Copy.php

<?php include('header.php'); ?>
<?php include('session.php'); ?>
<?php include('navbar_oneday.php'); ?>
    <div class="container">
		<div class="margin-top">
			<div class="row">	
			   <div class="alert alert-info">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                        <strong><i class="icon-user icon-large"></i>&nbsp;One Day Borrow Book</strong>
                </div>

      		<div class="span12">		
		<form method="post" action="borrow_oneDay_save.php">
      <div class="span2">
		<div class="control-group">
				<label class="control-label" for="inputEmail"><b>Borrower Name</b></label>
				<div class="controls">
				<?php $result =  mysql_query("select * from `registration` WHERE `id`='".$_SESSION['user_id']."'")or die(mysql_error()); 
				$row=mysql_fetch_array($result); ?>
				<span style="color: green;"><b><?php echo $row['name'];?> <?php echo $row['lname'];?></b></span>
				</div>
			</div>
			<hr/>
				<div class="control-group"> 
					<label class="control-label" for="inputEmail"><span style="color: red;">Due Date</span></label>
					<div class="controls">
						<input type="hidden" name="member_id" value="<?php echo $_SESSION['user_id'];?>">
					<?php
					$allowed = mysql_query("SELECT * FROM `one_day_borrow` WHERE `member_id`='".$_SESSION['user_id']."' AND `borrow_status`='pending'");
					     $count = mysql_num_rows($allowed);
					     $countDate = mysql_fetch_array($allowed);
						echo $datestoday =   $countDate['end_date'];
						 ?>
			   <input type="hidden" value="<?php echo $dueDate;?>" name="due_date">
					</div>
				</div>
				<div class="control-group"> 
					<div class="controls">
                    <?php if($count<1){?>
					   <button name="delete_student" class="btn btn-success"><i class="icon-plus-sign icon-large"></i> Borrow</button>
					   <?php }else{ ?>
					   	 <a href="view_one_day_borrow.php" class="btn btn-danger" readonly><i class="icon-plus-sign icon-large"></i> Return book</a>
					   <?php } ?>
					</div>
				</div>
				<hr>
				</div>
				<div class="span9">
						<div class="alert alert-success"><strong>Select Book</strong></div>
                            <table cellpadding="0" cellspacing="0" border="0" class="table" id="example" border="1">
                                <thead>
                                    <tr>
                                    	<th style="background-color: #4267B2; color: white;">Add Book</th>
                                        <th style="background-color: #4267B2; color: white;">Acc No.</th>                                 
                                        <th style="background-color: #4267B2; color: white;">Book title</th>                             
                                        <th style="background-color: #4267B2; color: white;">Category</th>
										<th style="background-color: #4267B2; color: white;">Author</th>
										<th style="background-color: #4267B2; color: white;">Publisher name</th>
										<th style="background-color: #4267B2; color: white;">status</th>
                                    </tr>
                                </thead>
                                <tbody>
                                  <?php  
									 $user_query=mysql_query("SELECT * FROM book WHERE book_status !='borrow' ")or die(mysql_error());
                                    $i=1;
									while($row=mysql_fetch_array($user_query)){
									$id=$row['book_id'];  
									$cat_id=$row['category_id'];

									$cat_query = mysql_query("select * from category where category_id = '$cat_id'")or die(mysql_error());
									$cat_row = mysql_fetch_array($cat_query);

									?>		
									<tr class="del<?php echo $id ?>">
									<td width="20">
									<?php if($count<1){?>
									<input id="" class="uniform_on" name="selector" type="checkbox" value="<?php echo $id; ?>" >
									<?php }else{?>
									<input id="" class="uniform_off" name="" type="checkbox" value=""  data-off="Yes">
									<?php } ?>
                                    </td>
                                    <td><?php echo $i; ?></td>
                                    <td><?php echo $row['book_title']; ?></td>
									<td><?php echo $cat_row ['classname']; ?> </td> 
                                    <td><?php echo $row['author']; ?> </td> 
									<td><?php echo $row['publisher_name']; ?></td>
									<td width=""><?php echo $row['status']; ?></td> 
									<?php include('toolttip_edit_delete.php'); ?>
                                    </tr>
									<?php $i++; }  ?>
                                </tbody>
                            </table>
							
			    </form>
			</div>		
			</div>
			
<script>		
$(".uniform_on").change(function(){
    var max= 1;
    if( $(".uniform_on:checked").length >= max ){
	
        $(".uniform_on").attr('disabled', 'disabled');
		         alert('1 Books are allowed per borrow at a time');
        $(".uniform_on:checked").removeAttr('disabled');
		
    }else{

         $(".uniform_on").removeAttr('disabled');
    }
})
$(".uniform_off").change(function(){
    
        $(".uniform_off").attr('disabled', 'disabled');
		         alert('you are not eligible for taken more books since you are already taken 1 books');
        $(".uniform_on:checked").removeAttr('disabled');
		
    
})
</script>

			</div>
		</div>
    </div>
<?php include('footer.php') ?>

Copyright © 1945 - 2024 GOOGLE