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

//$branch_id = $_SESSION['LOGIN_BRANCH'];
$session_input='';

$table_name="_student_admission_master a LEFT JOIN _student_admission_details b ON a._id=b._master_id";
$column="DISTINCT a._session";
$where_cond="a._status='A'";
$result=$obj->View_column_details_By_Cond($table_name,$column,$where_cond);
$session_input=$result['_session'];
$_SESSION['ADMISSION_SESSION'] = $session_input;

$table_name='_students_admission_mark_settings';
$where_cond="current_session='".$session_input."'";
$column = '	total_mark,pass_mark';
$settings=$obj->View_all_data_row_column_By_Cond($table_name,$column, $where_cond);
if(count($settings)>0){ 
$total_mark = '';
$pass_mark = '';
foreach($settings AS $index=>$setting){
$total_mark = $setting['total_mark'];
$pass_mark = $setting['pass_mark'];
}

?>
<script src="module/admission/js/result_processing.js" type="text/javascript"></script>
<script src="asset/theme/js/jquery.gritter.min.js"></script>
<div class="row-fluid">
    <div class="span12">
        <div class="widget-header widget-header-large" style="border: 0;   background:none">
            <h3 class=" lighter pull-left position-relative" style="color: #2679B5;">
                <i class="icon-hand-right green"></i>
                Admission Result Processing
            </h3>
		</div>
        <div class="hr hr-18 hr-double dotted"></div>
    </div>
</div>
    <?php if($_SESSION['view']=='Y'){?>      
		<div class="row-fluid"> 	
		<div class="span3">
			<div class="control-group">
				<label class="control-label" for="form-field-1">Select Shift <font color="#FF0000">*</font></label>
				<div class="controls">
					<select id="shift_id" onchange="call_medium_from_admission_details(this.value)" >
					<?php
						$table_name = "_student_admission_master a LEFT JOIN _student_admission_details b ON a._id=b._master_id LEFT JOIN _int_institute_setup c ON b._shift_id=c._id";
						$column = "DISTINCT b._shift_id,c._name";
						$where_cond="a._session='".$session_input."'  AND a._status='A'";
						$child_list=$obj->View_all_data_row_column_By_Cond($table_name,$column,$where_cond);
							//$qry4_shift=mysql_query("SELECT _id,_name FROM _int_institute_setup WHERE _pid='$branch_id' AND _type='SH' AND _status='A'");
					?>
						<option value="">---SELECT---</option>
						<?php
							foreach($child_list AS $index1=>$child){
								echo "<option value='".$child['_shift_id']."'>".$child['_name']."</option>";
							}
						?>									
					</select>								
				</div>
			</div>
		</div>
		<div class="span3">
			<div class="control-group" >
				<label class="control-label" for="form-field-1">Medium Name<font color="#FF0000">*</font></label>
				<div class="controls" id="medium_control">
					<select >
					</select>
				</div>
			</div>
		</div>
		<div class="span3">
			<div class="control-group" >
				<label class="control-label" for="form-field-1">Class Name<font color="#FF0000">*</font></label>
				<div class="controls" id="class_control">
					<select >
					</select>
				</div>
			</div>
		</div>
		<div class="span3">
			<div class="control-group" >
				<label class="control-label" for="form-field-1">Department Name<font color="#FF0000">*</font></label>
				<div class="controls" id="department_control">
					<select >
					</select>
				</div>
			</div>
		</div>
    </div>
	<div class="row-fluid">
		<div class="span3">
			<div class="control-group">
					<label class="control-label form-label" for="pass_mark">Choose Status : <span style="color:red">*</span></label>
					<div class="controls">
						<select id="choose_status" name="choose_status" onchange="hide_print_btn()">
							<option selected="selected" value="both">Both</option>
							<option value="pass">Pass</option>
							<option value="fail">Fail</option>
						</select>
					</div>
			</div>
		</div>
		<div class="span3">
			<!--<input type="hidden" name="branch_id" value="<?php //echo $branch_id; ?>" id="branch_id" type="hidden">-->
            <input type="hidden" name="total_mark" value="<?php echo $total_mark; ?>" id="total_mark"/>
            <input name="pass_mark" value="<?php echo $pass_mark; ?>" id="pass_mark" type="hidden" />
            <button id="action-btn" type="button" class="btn btn-small btn-success update" onclick="perform_result_processing()" style="margin-top: 25px;">
           		<i class="icon-search bigger-110"></i>
				Submit  
      		</button>
            <br>
            <br>	
		</div>
            
    </div>
<?php } ?>    
<div class="row-fluid" id="candidate_list_with_result">
</div>
</div>

<?php }else{
echo $notification = 'Please, Setup mark settings before processing Result.  ';
} 

?>
<script>
 /*$( "#choose_class" ).change(function() {
  		var val = $(this).val();
		if(val=='nine' || val=='eleven'){
			//$("#choose_department").prop('disabled', false);
			$("#dpt-style").css('display', 'block');
		}else{
			//$("#choose_department").val('');
			$("#dpt-style").css('display', 'none');
			
			}	
	});
	
	$('#action-btn').on('click', function(){
		var branch_id	= $("#branch_id").val();
		var total_mark	= $("#total_mark").val();
		var pass_mark	= $("#pass_mark").val();
		var classes	= $("#choose_class").val();
		var choose_status	= $("#choose_status").val();
		
		var dataStr = "class="+classes+"&branch_id="+branch_id+"&total_mark="+total_mark+"&pass_mark="+pass_mark+"&choose_status="+choose_status;
		if(classes=='nine' || classes=='eleven'){
			var dpt = 	$("#choose_department").val();
			if(dpt) var dataStr = dataStr+"&dpt="+dpt;
		}
		if(classes){
			$("#candidate-list").css('display', 'block');
			$("#candidate-list").load("module/admission/load_result_processing_class.php",dataStr);
		}else{
			alert('Choose Class');
			
			}
		return false;
	});
*/
 </script>       
        

