<?php
session_start();
include("../../asset/theme/css/myfunc.php");
include("../../php_crud/my_class.php");
$obj = new my_class();

extract($_GET);
//echo "section id=".$section_id." session=".$session;
?>
<input type="hidden" id="session" value="<?php echo $session;?>"/>
<input type="hidden" id="section_id" value="<?php echo $section_id;?>"/>
<h4 class="header green clearfix">
	Student Section Wise Roll Information
	<span class="block pull-right">
		<small class="grey middle">Load Preview: &nbsp;</small>
		<span class="btn-toolbar inline middle no-margin">
			<span data-toggle="buttons-radio" class="btn-group no-margin">											
				<button class="btn btn-success btn-next" data-last="Finish " id="btn_load_sms_preview" onclick="load_sms_preview()">
					Go
					<i class="icon-arrow-right icon-on-right"></i>
				</button>
			</span>
		</span>
	</span>
</h4>
<table width="100%" class="table table-striped table-bordered table-hover">
	<tr>
		<th><label></label> <input type="checkbox" id="check_all" ><span class="lbl"> Check All</span></th>
		<th>Sl</th>
		<th>Unique ID</th>
		<th>Full Name</th>
		<th>Section Roll</th>
		<th>Father's Name</th>
		<th>Mobile No</th>
	</tr>
<?php
	$slno = 1;
	$tables = "_pf_std_basic_info a left join _pf_std_personal_info b on (a._pid=b._id)";
	$cols = "b._id AS std_id, b._full_name AS std_name,b._uniq_id AS uniq_id,b._section_roll AS std_roll,b._contact_mobile as std_contact";
	$where_cond = " a._section_id=$section_id and a._session=$session and b._status='A' order by b._section_roll asc";
	$std_info = $obj->View_colmn_By_Cond($tables,$cols,$where_cond);
	$tot_num_of_std = count($std_info);
	?>
	<input type="hidden" id="tot_std" value="<?php echo $tot_num_of_std;?>"/>
<?php	foreach($std_info as $value){
	
		$std_id = $value['std_id'];
		$uniq_id = $value['uniq_id'];
		$full_name = $value['std_name'];
		$roll = $value['std_roll'];
		
		$father_info = $obj->View_column_details_By_Cond("_pf_guardian_spouse_info","_full_name","_pid=$std_id AND _info_type='F'");
		$father_name = $father_info['_full_name'];
		$contact_mobile = $value['std_contact'];		
			 		
		$pos =  $std_id.'#'.$uniq_id . '#' .$roll.'#'.$contact_mobile;
?>
		<tr>
			<td><label><input type="checkbox" id="select_for_sms_<?php echo $slno; ?>" name="select_for_sms_<?php echo $slno; ?>" class="checked_for_sms" value="0" ><span class="lbl"></span></label></td>
			<td><?php echo $slno; ?><input type="hidden" id="std_id_<?php echo $slno; ?>" name="std_id_<?php echo $slno; ?>" value="<?php echo $std_id; ?>"></td>
			<td><?php echo $uniq_id; ?></td>
			<td><?php echo $full_name;?></td>	 
			<td><?php echo $roll;?></td>	 
			<td><?php echo $father_name;?></td>	 
			<td><?php echo $contact_mobile;?></td>
			
		</tr>
<?php	$slno++;} ?>
</table>

<h4 class="header green clearfix">
	Student Section Wise Roll Information
	<span class="block pull-right">
		<small class="grey middle">Load Preview: &nbsp;</small>
			<span class="btn-toolbar inline middle no-margin">
				<span data-toggle="buttons-radio" class="btn-group no-margin">
					<button class="btn btn-success btn-next" data-last="Finish " id="btn_load_sms_preview" onclick="load_sms_preview()">
						Go
						<i class="icon-arrow-right icon-on-right"></i>
					</button>
				</span>
			</span>
	</span>
</h4>


<script type="text/javascript">
$('#check_all').change(function() {
		if(this.checked){
			  $(".checked_for_sms").each(function(){
				this.checked=true;
			  })              
			}else{
			  $(".checked_for_sms").each(function(){
				this.checked=false;
			  })              
		}
		
});
</script>
					