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

$branchid = $_SESSION['LOGIN_BRANCH'];

extract($_GET);
$section_id;
$class_id;
$department_id;
$student_type_id;

?>

<style type="text/css">
	.input-append, .input-prepend {
		margin-bottom: 0px !important;
	}	
	.table th, .table td{
		padding: 2px !important;
		font-size: 12px;
	}
	.dataTable th[class*="sort"]::after {
	    margin-right: 0;
	}
	.select_in{
		max-width:90px !important;
	}
</style>

<?php
$det_in = $obj->Details_By_Cond("_int_institute_setup_vw","section_id='$section_id'");

$tch_id = $obj->Details_By_Cond("_r_class_routine","_section_id='$section_id' AND _teacher_type='CT' AND _teacher_id!='0' GROUP BY _teacher_type");
$teacher_id =  $tch_id['_teacher_id'];

$tch_det = $obj->Details_By_Cond("_pf_emp_personal_info","_id='$teacher_id'");

?>

<div class="row-fluid">
	<div class="span12" style="font-size: 17px; font-weight: bold; background-color:#af4e96; color:#FFFFFF;">
		<div class="span12">
        <div class="profile-activity clearfix" style="background-color:#af4e96;">
        Student Scholarship for : <span class="badge badge-info">Class : <?php echo $det_in['class'];?></span>&nbsp;&nbsp;<span class="badge badge-info">Department : <?php echo $det_in['department'];?></span>&nbsp;&nbsp;<span class="badge badge-info">Student Type : <?php echo $det_in['student_type'];?></span>&nbsp;&nbsp; <span class="badge badge-info">Section : <?php echo $det_in['section'];?></span>&nbsp;&nbsp;
        	<button onclick="scholar_print()"  class="btn btn-small btn-warning" data-dismiss="modal" type="button">
				<i class="icon-print bigger-125 icon-on-right"></i>
				Print
			</button>
        
  <input type="hidden" id="e_class_id" value="<?php echo $class_id; ?>" /> 
  <input type="hidden" id="e_department_id" value="<?php echo $department_id; ?>" /> 
  <input type="hidden" id="e_student_type_id" value="<?php echo $student_type_id; ?>" />
  <input type="hidden" id="e_section_id" value="<?php echo $section_id; ?>" /> 
       <span class="label label-warning arrowed arrowed-right" style="float:right;">
		<?php
			if($_SESSION['edit']=='Y'){						
			?>
			<i class="icon-edit bigger-170" style="hover:cursor;" href="#modal-table_edit2" data-toggle="modal" onclick="show_edit2(<?php echo $section_id; ?>)">All Section Synchronize</i>
			<?php
			}	
		?>
        </span>
        </div>
        </div>
       
	</div>
</div>

<!--<div class="row-fluid">
<legend>
	Student Scholarship for (<?php echo 'Class: '.$det_in['class'].', Department: '.$det_in['department'].', Student Type: '.$det_in['student_type'].', Section: '.$det_in['section']; ?>).
</legend>
</div>-->

<script src="module/fees/js/std_scholarship.js" type="text/javascript"></script>
<!-- ==================================== -->



	<table id="sample-table-22" class="table table-striped table-bordered table-hover" style="font-size:10px;">
		<thead>
			<th style="background-color:#6fb3e0; color:#FFFFFF;">Sl</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Student ID</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Name</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Roll</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Amount</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Purpose</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Months</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Session</th>
			<th style="background-color:#6fb3e0;color:#FFFFFF;">Action</th>
		</thead>
		<tbody>
			<?php
			$i=0;
			foreach($obj->View_Student_List_scholarship("sc._id='$section_id' ORDER BY _section_roll ASC") as $value_s){
			extract($value_s);
			$i++;	
			?>	
			<tr>
				<td class="td_pad">
					<?php echo $i; ?>
				</td>
				<td class="td_pad"><?php echo $value_s['_uniq_id']; ?></td>
				<td class="td_pad"><?php echo $value_s['_full_name']; if(!empty($value_s['_nick_name'])){echo ' ('.$value_s['_nick_name'].')'; } ?></td>
				<td class="td_pad"><?php echo $value_s['_section_roll']; ?></td>
				<td class="td_pad"><?php echo $value_s['_scholar_amount']; ?></td>
				<td class="td_pad"><?php echo $value_s['_purpose']; ?></td>
				<td class="td_pad">

				<?php 

                  $mont=$value_s['_months'];
                  $mn=explode(',',$mont);
                 foreach ($mn as $pe){
                 	if($pe=='1'){
                 		echo "January".", ";
                 	}
                 	else if($pe=='2'){
                 		echo "February".", ";
                 	}
                 	else if($pe=='3'){
                 		echo "March".", ";
                 	}
                 	else if($pe=='4'){
                 		echo "April".", ";
                 	}
                 	else if($pe=='5'){
                 		echo "May".", ";
                 	}

                 	else if($pe=='6'){
                 		echo "June".", ";
                 	}
                 	else if ($pe=='7'){
                 		echo "July".", ";
                 	}
                 	else if ($pe=='8'){
                 		echo "August".", ";
                 	}
                 	else if($pe=='9'){
                 		echo "September".", ";
                 	}
                 	else if($pe=='10'){

                 	echo "October".", ";
                 	}
                 	else if ($pe=='11'){
                 		echo "November".", ";
                 	}
                 	else if ($pe=='12'){
                 		echo "December".", ";
                 	}

                 	else {
                 		echo "";
                 	}
                 }     ?></td>
			  
				<td class="td_pad"><?php echo $value_s['schlor_session']; ?></td>


				<td class="td_pad">
					<?php
					if(empty($value_s['_scholar_amount'])){
						if($_SESSION['add']=='Y'){
					?>
					<!--<i class="icon-plus bigger-150" style="hover:cursor;" href="#modal-table_add" data-toggle="modal" onclick="show_add_view(<?php //echo $value_s['_class_id']; ?>,<?php //echo $value_s['_section_id']; ?>,<?php //echo $value_s['_id']; ?>)"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
                    <i class="icon-plus bigger-150" style="hover:cursor;" href="#modal-table_add" data-toggle="modal" onclick="show_add_head(<?php echo $value_s['_class_id']; ?>,<?php echo $value_s['_section_id']; ?>,<?php echo $value_s['_id']; ?>)"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<?php
					}}
					if($value_s['_scholar_amount']){
					if($_SESSION['edit']=='Y'){						
					?>
					<i class="icon-plus bigger-150" style="hover:cursor;" href="#modal-table_add" data-toggle="modal" onclick="show_add_head(<?php echo $value_s['_class_id']; ?>,<?php echo $value_s['_section_id']; ?>,<?php echo $value_s['_id']; ?>)"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    
                    <i class="icon-edit bigger-170" style="hover:cursor;" href="#modal-table_edit" data-toggle="modal" onclick="show_edit(<?php echo $value_s['schlor_id']?>,<?php echo $section_id; ?>)"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <?php
					}
					if($_SESSION['delete']=='Y'){
					?>	
					<i class="icon-trash bigger-170" style="hover:cursor;" href="#modal-table" data-toggle="modal" onclick="delete_data(<?php echo $value_s['schlor_id']; ?>,<?php echo $value_s['_section_id']; ?>)"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<?php }} ?>
				</td>
				
							
				
			</tr>	
			<?php } ?>
			
			
		</tbody>	

	</table>



<!-- ========================== -->

<div class="row-fluid">	
	<div class="span5"><b>Class Teacher name:</b> <?php echo $tch_det['_full_name']; if(!empty($tch_det['_nick_name'])){ echo ' ('.$tch_det['_nick_name'].')';} ?></div>

	<div class="span3"><b>Mobile No:</b> <?php echo $tch_det['_contact_mobile_no']; ?></div>
</div>


<script type="text/javascript">
	var oTable2 = $('#sample-table-22').dataTable( {
	"aoColumns": [
      { "bSortable": true },
      null, null,null, null,null, null,null,
	  { "bSortable": true }
	  ] } );
</script>



<!--<script type="text/javascript">

$(".chzn-select").chosen(); 

</script>-->


