<?php
session_start();
// ==================	
include("../../asset/theme/css/myfunc.php");		  
include("../../php_crud/my_class.php");
$obj = new my_class();
extract($_GET);
$session;
$subject_id;
$section_id;
$department_id;
$exam_term_id;
$exam_session;
$base_url= $_SESSION["BASE_URL"];





?>

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

<div class="page-content">
<div class="row-fluid">


<div class="span6" id="step">
<!--PAGE CONTENT BEGINS-->

<div class="">
<div class="well">

<div class="row-fluid" id="first_part">
<div class="login-container">


<div class="space-6"></div>

<div class="row-fluid">
<div class="position-relative">
<div id="login-box" class="login-box visible widget-box no-border">
<div class="widget-body">
<div class="widget-main">
<h4 class="header blue lighter bigger">
<i class="icon-coffee green"></i>
Please Enter Excel File
</h4>

<div class="space-6"></div>

<form enctype="multipart/form-data" id="profil_form"/>

<fieldset>
<label>
<span class="block input-icon input-icon-right">
<input type="hidden" name="section_idd" id="section_idd" value="<?php echo $section_id; ?>"/>
<input type="hidden" name="session_value" id="session_value"  value="<?php echo $exam_session;?>"/>

<input type="file" name="file" id="file" class="input-large">
<i class="icon-cloud-upload"></i>
</span>
</label>



<div class="space"></div>

<div class="clearfix loading-div">


<button onclick="return false;" class="width-30 pull-right btn btn-small btn-primary" id="upload_xlsx" name="upload_xlsx" value="upload" >
<i class="icon-key"></i>
Upload
</button>
</div>

<div class="space-4"></div>
</fieldset>
</form>




</div><!--/widget-main-->



</div><!--/widget-body-->

</div><!--/login-box-->




</div><!--/position-relative-->
</div>
</div>
</div>	



</div>
</div><!--PAGE CONTENT ENDS-->

</div><!--/.span-->




<div class="span6" id="step1" style="display:none;">
<!--PAGE CONTENT BEGINS-->

<div class="">
<div class="well">

<div class="row-fluid" id="first_part">
<div class="login-container">


<div class="space-6"></div>

<div class="row-fluid">
<div class="position-relative">
<div id="login-box" class="login-box visible widget-box no-border">
<div class="widget-body">
<div class="widget-main">
<h4 class="header blue lighter bigger">
<i class="icon-coffee green"></i>
Notice:
</h4>

<div class="space-6"></div>

<?php 

$view = $obj->Details_By_Cond('_int_institute_setup_vw','section_id = "'.$section_id.'"');
$sec = $view['section'];

?>
<div class="row-fluid second" id="second_part" style="display:none;font-size:18px;font-weight:bold">
Result are inserted.
   
</div>

<div class="row-fluid third" id="" style="display:none;font-size:18px;font-weight:bold;">
Please Enter Excel Sheet in Proper Format.
</div>





</div><!--/widget-main-->



</div><!--/widget-body-->

</div><!--/login-box-->




</div><!--/position-relative-->
</div>
</div>
</div>	



</div>
</div><!--PAGE CONTENT ENDS-->

</div><!--/.span-->




</div><!--/.row-fluid-->
</div><!--/.page-content-->

<!--/#ace-settings-container-->
<!--	</div><!--/.main-content-->
<!-- </div> --><!--/.main-container-->



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



<script type="text/javascript">

     $("#upload_xlsx").click(function(){
     	$this = $(this);

        var term_id = '<?php echo $exam_term_id; ?>';
        var subject_id = '<?php echo $subject_id; ?>';
		
        var section_idd=$("#section_idd").val();
         var session=$("#session_value").val();
		 /* alert(session);
		exit(); */
         var file_ = $("#file").val();
         var file_data = $('#file').prop('files')[0];   
	    var form_data = new FormData();                  
	    form_data.append('file', file_data);
	  
      if(file_==""){
		alert("Select Excel Data ");
		$('#file_data').focus();
		return false;
	    }
	   
       else{
        $.ajax({

                dataType: 'text',  // what to expect back from the PHP script, if anything
                cache: false,
                contentType: false,
                processData: false,
                type:"post" ,
			   
			   url:"module/exam/insert_excel_mark.php?sc_id="+section_idd+"&sess="+session+"&term_id="+term_id+"&subject_id="+subject_id,
			   	data:form_data ,
			   	cache:false ,
			   	success:function(st){	
					//alert(st);
					
					/* if(st) {alert('Success');}
					else  { alert('hmm no');} */
					if(st='ok')
					{
					$('#step').remove();
					$('.second').css("display","block");
					$('#step1').css("display","block");}
					else {
						
						$('#step').remove();
					    $('.third').css("display","block");
					   $('#step1').css("display","block");}
					
					
				  	}
			   	});

	   }
			//AJAXProcess('module/profile/student/insert_excel_profile','student_form');
			 $this.html('<i class="icon-spinner icon-spin orange bigger-125 icon-loading" ></i> Upload... ');
	
		


			});
</script>

















 

