       
      <!-- start page content -->
            <div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title">All Books/ID Card List</div>
                            </div>
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.html">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li><a class="parent-item" href="">Books/ID Card</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li class="active">All Books/ID Card List</li>
                            </ol>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                                                 
                                <div class="tab-content">
                                    <div class="tab-pane active fontawesome-demo" id="tab1">
                                        <div class="row">
					                        <div class="col-md-12">
					                            <div class="card card-box">
					                                <div class="card-head">
					                                    <header>All Books/ID Card List</header>
					                                    <div class="tools">
					                                        <a class="fa fa-repeat btn-color box-refresh" href="javascript:;"></a>
						                                    <a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
						                                    <a class="t-close btn-color fa fa-times" href="javascript:;"></a>
					                                    </div>
					                                </div>
					                                <div class="card-body ">					                                   
					                                    <div class="table-scrollable">
					                                    <table class="table table-striped table-bordered table-hover table-checkable order-column valign-middle" id="example4">
					                                        <thead>
					                                            <tr>																    
																	<th> ID</th>
					                                                <th> Book</th>
					                                                <th> Id Card</th>					                                               
					                                                <th>  Enroll No.</th>					                                               
					                                                <th> Student Name</th>
					                                                <th> Father Name</th>
					                                                <th> Mother Name</th>
					                                                <th> Admission Session</th>
					                                                <th> Admission Type</th>
					                                                <th> Course</th>
					                                                <th> Sub Course-Cat</th>
					                                                <th> Year</th>
					                                                <th> Uploaded By</th>
																</tr>
					                                        </thead>
					                                        <tbody>
															<?php $user_type = $this->session->userdata('user_type'); ?>
															<?php $i=1; foreach ($student_details as $key):?>
															<?php 
															 $center_details    = get_center_by_id($key->user_id);
															 $subCourse_details = get_sub_courses_by_id($key->sub_course_id);
															?>
																<tr class="odd gradeX">																	
																	
																	<td><?=ucfirst($key->id);?></td>
																	<td>
																	<span class="visited" id="book_loader_<?=$key->id; ?>">
																		<?php
																		if ($user_type == 1) {											
																		?>
																		<input type="checkbox" name="form_status" value="1" id="books_<?=$key->id; ?>" onclick = "bookIssued('<?=$key->id; ?>')" <?=(isset($key->book_issued)&& $key->book_issued1="")?'checked':''?>>
																		<?php }else{ echo $key->book_issued; } ?>
																	</span>																	
																	</td>
																	<td>
																	<span class="visited" id="loader_<?=$key->id; ?>">
																	<?php
																	if ($user_type == 1) {		
																	?>
																	<input type="checkbox" name="form_status" value="1" id="idCard<?=$key->id; ?>" onclick = "idCardIssued('<?=$key->id; ?>')" <?=(isset($key->id_card_issued)&& $key->id_card_issued)?'checked':''?>>
																	<?php }else{ echo $key->id_card_issued; } ?>
																	</span>
																	</td>																
																	<td><?=ucfirst($key->enroll_num);?></td>
																	<td><?=ucfirst($key->name);?></td>
																	<td><?=ucfirst($key->father_name);?></td>
																	<td><?=ucfirst($key->mother_name);?></td>
																	<td><?=ucfirst($key->admission_session);?></td>
																	<td><?=ucfirst($key->admission_type);?></td>
																	<td><?=get_courses_by_id($key->course_id);?> </td>
																	<td><?=$subCourse_details[0]['name'];?> </td>
																	<td class="left"><?=$key->year;?></td>
																	<td class="left"><?=$center_details[0]['user_name'];?></td>
																	</tr>
															 <?php $i++; endforeach ?>
															</tbody>
					                                    </table>
					                                    </div>
					                                </div>
					                            </div>
					                        </div>
					                    </div>
                                    </div>
                                </div>
                           
                        </div>
                    </div>
                </div>
            </div>
            <!-- end page content -->  
		<div class="modal fade" id="modal-id">
    <div class="modal-dialog">
        <div class="modal-content"> 
		<form>
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Add Enrollment</h4>
            </div>
			 <input type="hidden" name="students_id" id="students_id" value="" />
            <div class="modal-body">                
                     <div class="form-group">
                        <label for="">Enrollment No</label>
                        <input type="text" name = "enroll_no"  id = "enroll_no" maxlength="14" class="form-control" placeholder="Insert Student Enrollment No.">
                    </div>                                  
               
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" id="btn_add_inroll" onclick = "addEnrollemt()">Submit</button>
            </div> 
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->  
<div class="modal fade" id="modal-Pendency">
    <div class="modal-dialog">
        <div class="modal-content"> 
		<form>
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Add Pendency</h4>
            </div>
			  <input type="hidden" name="student_id" id="student_id" value="" />
            <div class="modal-body" style="left: 50;">                
                    <div class="form-group">
                       <input type="checkbox" class="pendency" name="pendency[]" value="10th DMC" />
						<label for="">10th DMC</label>						
                    </div> 
                    <div class="form-group">
                       <input type="checkbox" class="pendency" name="pendency[]" value="12th DMC" />
						<label for="">12th DMC</label>						
                    </div> 
					 <div class="form-group">
                       <input type="checkbox" class="pendency" name="pendency[]" value="Graduation DMC" />
						<label for="">Graduation DMC</label>						
                    </div> 
                     <div class="form-group">
                       <input type="checkbox" class="pendency" name="pendency[]" value="PG DMC" />
						<label for="">PG DMC</label>						
                    </div> 
					 <div class="form-group">
                       <input type="checkbox" class="pendency" name="pendency[]" value="Degree/Provisional" />
						<label for="">Degree/Provisional </label>						
                    </div> 
					 <div class="form-group">
                       <input type="checkbox" class="pendency" name="pendency[]" value="Photo" />
						<label for="">Photo</label>						
                    </div>
                    <div class="form-group">
                       <input type="text" class="form-control" name="pendency_other" id="pendency_other" value="" placeholder="Others" />
											
                    </div> 					
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" id="btn_add_pendency" onclick = "addPendency()">Submit</button>
            </div> 
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->  	
<script type="text/javascript">
function bookIssued(id){
	if(id!=''){
		var form_status = '0';	
		if($("#books_"+id).prop('checked')==true){ 
			form_status = '1';
		}
		if($("#books_"+id).not(':checked').length){
			form_status = '0';
        }
		var NORMALSERVER = "";		
		 $("#book_loader_"+id).append("<img src='/su/images/btn-loader.gif'/>");
		  $.ajax({
            type: "POST",
            url: NORMALSERVER+"issue_books",
            data: {student_id:id,form_status:form_status},
            dataType: "JSON",
            success: function(data) {			
			if(data.success!=null && data.success!=''){	               
				$("#book_loader_"+id+"> img").remove();
			}
            },
            error: function(err) {
			$("#book_loader_"+id+"> img").remove();		 
            console.log(err);
            }
        });
		
	}
}
function idCardIssued(id){
	if(id!=''){
		var form_status = '0';	
		if($("#idCard"+id).prop('checked')==true){ 
			form_status = '1';
		}
		if($("#idCard"+id).not(':checked').length){
			form_status = '0';
        }
		var NORMALSERVER = "";		
		 $("#loader_"+id).append("<img src='/su/images/btn-loader.gif'/>");
		  $.ajax({
            type: "POST",
            url: NORMALSERVER+"issue_idcard",
            data: {student_id:id,form_status:form_status},
            dataType: "JSON",
            success: function(data) {			
			if(data.success!=null && data.success!=''){	               
				$("#loader_"+id+"> img").remove();
			}
            },
            error: function(err) {
			$("#loader_"+id+"> img").remove();		 
            console.log(err);
            }
        });
		
	}
}
</script>			