<?php
session_start();
// ==================			  
include("../../php_crud/my_class.php");
$obj = new my_class();
extract($_GET);
$session;
$section_id;
$ld_grp_id;

$base_url= $_SESSION["BASE_URL"];
//$view = $obj->Details_By_Cond('_int_institute_setup_vw','section_id = "'.$section_id.'"');
?>


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

		<div class="span6">

			<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 $session;?>"/>
														<input type="hidden" name="group_name" id="group_id"  value="<?php echo $ld_grp_id;?>"/>

														<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-35 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 abcd"   >
		<!--PAGE CONTENT BEGINS-->
				<div class="">
					<div class="well" style="padding: 33px;">

						<div class="row-fluid" id="second_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>
														Download Sample Format
														</h4>

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

													<div >
														<label for="exampleInputFile" style="color: red;"> </label></br>
														<a href="./module/general_notice/exce_sheet/sample_con_info.xlsx" target="blank"><button type="button" class="btn btn-info">Download</button></a>
													</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-->
<!--<div class="row-fluid second" id="second_part" style="display:none; margin-top:10px;" align="center">
<h4 class="lighter smaller" style="text-align: center; font-weight:bold;">
<?php echo 'Data Sucessfuly inserted';?></h4>
</div>-->		
<div class="row-fluid" id="load_table">
</div>


<script type="text/javascript">

     $("#upload_xlsx").click(function(){
     	$this = $(this);
		this.disabled = true;
		var file_ = $("#file").val();
		
		var group_id = $("#group_id").val();
         //alert(ld_grp_id);
         var file_data = $('#file').prop('files')[0];   
	    var form_data = new FormData();                  
	    form_data.append('file', file_data);
	   $this.html('<i class="icon-spinner icon-spin orange bigger-125 icon-loading" ></i> Upload... ');
	
	   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/general_notice/insert_excel_add_contact.php?group_id="+group_id,
			   	data:form_data ,
			   	cache:false ,
			   	success:function(st){					      
					alert(st);
					//$('#second_part').remove();
					//$('#first_part_holder').css("display","none");
					//$('.second').css("display","block");
					//$('#no_of_students').html(st);
					//$('.abcd').css("display","none");
					//$('#load_table').load("module/general_notice/add_contact_info_datatable.php");

				  	}
			   	});

		}
			//AJAXProcess('module/profile/student/insert_excel_profile','student_form');
			
});
</script>

















 

