<script type="text/javascript">
$(document).ready(function(){
    $('#select_all').on('click',function(){
        if(this.checked){
            $('.checkbox').each(function(){
                this.checked = true;
            });
        }else{
             $('.checkbox').each(function(){
                this.checked = false;
            });
        }
    });
    
    $('.checkbox').on('click',function(){
        if($('.checkbox:checked').length == $('.checkbox').length){
            $('#select_all').prop('checked',true);
        }else{
            $('#select_all').prop('checked',false);
        }
    });
});
</script>
<div class="panel panel-default">

    <div class="panel-heading hidden-print">
        <h6 class="panel-title"><i class="fa fa-desktop"></i> Teacher SMS Information</h6> 
       					
    </div>
    <div class="panel-body">
<form action="<?php echo site_url('everbright/teachersms/add'); ?>" method="post" class="form-horizontal validate" role="form"> 
        




           
                   
            

            <!-- Statement -->
            <div class="row">
                <div class="col-xs-12">
                    <table class="report-page-setup table table-bordered">
                        <caption>
                            <p class="text-center" style="font-size: 13px;"><strong>SMS Send to Teacher Group</strong></p>
                        </caption>
                        <thead>
                            <tr>
                                <th>Serial</th>
								<th style="text-align:center;"><input type="checkbox" id="select_all"></th>
								
                        <th>Name</th> 
						<th>Picture</th> 						
						<th>Designation</th>
						<th>Education</th>
						<th>Teaching Subject</th>
						<th>Contact Number</th>
                            </tr></thead>
                        <tbody> 
                             <?php 
							 $i='a';
                        $query = $this->main_model->teacher();
                        foreach($query as $row):
                        ?>


                                <tr>
                            <td><?php echo $row['serial']; ?></td>
							<td><input style="margin-left:10px; margin-right:-5px;" type="checkbox" class="checkbox" name="tid[]" value="<?php echo $row['tid'];?>"></td>
							<td><?php echo $row['name']; ?></td>
                            <td><img width="80" src="<?php echo base_url();?>uploads/<?php echo $row['image']; ?>"></td>
							<td>
							
								<?php 
									$query111 = $this->main_model->desig();
									foreach($query111 as $row123):
								?>
								<?php if($row['designation']==$row123['did']): ?><?php echo $row123['name']; ?><?php endif; ?>
                            <?php endforeach; ?>
							
							
							
							</td>
							<td><?php echo $row['education']; ?></td>
							<td><?php echo $row['t_department']; ?></td>
                            <td><?php echo $row['contact']; ?></td>
                           
                        </tr>
						<?php $i=++$i; ?>
                        <?php endforeach; ?>            
                        </tbody>  
                        
                    </table> 
                </div>
            </div>
            <!-- /Statement -->   
			<div class="form-group">
                <label class="control-label col-md-1 text-right"><strong>SMS</strong> </label>
                <div class="col-md-11">
                    <textarea type="text" class="form-control" placeholder="SMS" name="sms"></textarea>
                </div>
            </div>
            
            <div class="form-actions text-right">
                <button type="submit" value="Submit" class="btn btn-primary"><i class="fa fa-check"></i> Submit</button>
            </div>
			</form>
            
       

    </div>

</div>
