<?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;

?>
<style>


    input.upload-button,input[type="file"] {width: 76%;height: 100%;background: #3A87AD;border: medium none;color: white;}
    .table-bordered th, .table-bordered td {border-left: 1px dotted rgb(221, 221, 221);border-style: dotted;border-bottom: 1px;border-color: rgb(221, 221, 221);border-right: 1px dotted rgb(221, 221, 221);}
    .widget-main.no-padding .table-bordered th:first-child, .widget-main.padding-0 .table-bordered th:first-child, .widget-main.no-padding .table-bordered td:first-child, .widget-main.padding-0 .table-bordered td:first-child {border-left-width: 0; }
    .hr-18, .hr18 {margin: 6px 0px; }
    .table-bordered {border-style: dotted;}
    .form-label{float: left;width: 156px;margin-top: 4px; }
    .widget-main.no-padding .table, .widget-main.padding-0 .table { border-top: 1px solid #E5E5E5;}
    .list-striped > li:nth-child(2n+1) {background-color: rgb(238, 238, 238);}
    .list-striped.pricing-table-header > li:nth-child(2n) { background-color: #FFF;}
    input[type="text"], .input-append, .input-prepend{margin-bottom: 1px;}
	.widget-main.no-padding .table, .widget-main.padding-0 .table {  border: 1px dotted #DDD;}
	.btn {padding: 0px 11px;}
	img#avatar{width:180; height:200px; }
	.alert {margin-bottom: 3px;}
	.profile-user-info {margin: 0px 0px;}
	.profile-info-name{width: 158px;}
	.profile-info-value {margin-left: 172px;}
	.label-large {padding: 3px 8px 12px;}
	.label-large.arrowed::before, .label-large.arrowed-in::before {
    	border-width: 12px 9px !important;
	}
	
</style>

<script src="module/admission/js/admission_form_excel.js" type="text/javascript"></script>
<script src="asset/theme/js/jquery.gritter.min.js"></script>
<div class="widget-header" style="margin-bottom: 17px;">

            <h3 class=" lighter pull-left position-relative" style="color: #2679B5;">
                <i class="icon-hand-right green"></i>
                 Admission Form Excel Upload
            </h3>			
			</div>
                    <div class="row-fluid" id="first_part">
                    <div class="span12" id="admission_details_info_holder">
                        <table class="table table-striped table-bordered">
                            <tbody>
                                <tr>
                                    <td class="hidden-480">Shift : <span style="color:red">*</span></td>
									<td class="hidden-480">
										<div class="controls" id="shift_control_for_admission_form_excel">
											<select id="shift_id_for_admission_form" onchange="call_medium_from_admission_details(this.value)">
											<option value="">---Select---</option>
											<?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' and b._status='A'";
													$data_list = $obj->View_all_data_row_column_By_Cond($table_name,$column,$where_cond);
													foreach ($data_list AS $index1 => $value1) {
														echo '<option value="' . $value1['_shift_id'] . '">' . $value1['_name'] . '</option>';
													}
											?>
											</select>
										</div>
									</td>
									<td class="hidden-480">Medium : <span style="color:red">*</span></td>
									<td>
										<div class="controls" id="medium_control_for_admission_form_excel">
											<select >
											</select>
										</div>
									</td>
								</tr>
								<tr>
									<td class="hidden-480">Class : <span style="color:red">*</span></td>
									<td>
										<div class="controls" id="class_control_for_admission_form_excel">
											<select >
											</select>
										</div>
									</td>
									<span>
										<td class="hidden-480">Department : <span style="color:red">*</span></td>
									</span>
									<td>
									   <div class="controls" id="department_control_for_admission_form_excel">
											<select >
											</select>
										</div>
									</td>
								</tr>							
                            </tbody>
                        </table><br>
						<div class="span3" style="margin-left: 750px;" >
						   <button id="go_to_next_section_btn" style="font-size: 17px;" type="button" class="btn btn-info" onclick="load_next_section_of_admission_form()">
								Next
								<i class="icon-arrow-right icon-on-right bigger-110"></i>
						   </button>
						</div>
                    </div>
					</div>
	
                    
                                          
<div class="row-fluid std_admission_excel"  id="second_part">
</div>
<!--<script>
function getFile(){
        document.getElementById("upload").click();
    }

$('#upload').change(function () {
        //fire your ajax call  
        file_upload();
    })
    var fileInput = $('input[type=file]'),
            button = $('#upload');
    button.on('focusout', function () {

// Access the files property, which holds
// an array with the selected files

    });
    function file_upload() {
		
        var files = fileInput.prop('files');
// No file was chosen!
        if (files.length == 0) {
            alert('Please choose a file to upload!');
            return false;
        }

        var br_id = $("#admission_form_id").val();
        if (br_id == '') {
            alert('Enter Invoice Number');
            //$('#_invoice_number').focus();

            return false;
        }
        else {
// Create a new FormData object
            var fd = new FormData();
            fd.append('file', files[0]);
            fd.append('id', br_id);
// Upload the file to assets/php/upload.php, which only prints the filename
            $.ajax({
                url: 'module/common/upload_admission.php',
                data: fd,
                contentType: false,
                processData: false,
                type: 'POST',
                success: function (m) {

                    //$('#image').attr('src','asset/custom/upload/x2015_03_20_26_5_b.jpg.pagespeed.ic.wGOLVYlwPH.jpg');
                    var a = JSON.parse(m);

                    if (a.status != 'Error') {

                        var image_path = 'asset/custom/upload/' + a.image;
                      
					  	 $('img#avatar ').attr('src',image_path);
                        $('#file_path').val(image_path);
						// $('#branch-img').html('<img src="'+image_path+'" style="height:150px;" />');
						
                    }
                    else {

                        alert(a.message);
                    }
                }
            });
        }
    }
 function call_child(val){
	 
	 	
	 
	 
	 }
function call_child(val,id){
	var datastr="parent_id="+val;
	$('#'+id).load("module/admission/get_thana_list.php",datastr);
}

$("#add_more").click(function(){
		var more = parseInt($("#more_row_num").val()) + 1;
		$("#more_row_num").val(more) ;
	//	var row = $("#academic-row").html() ;
	//	alert(row);
		var tr = '<tr id><td class="center">'+more+'</td><td><input type="text" name="ac['+(more-1)+'][exam]" style="width:80px"></td><td>';
                                 <?php
                                                /*$str = '';
												$table_name = '_int_common_setup';
                                                $where_cond = " _type='EB' AND _status!='D' ";
                                                $data_list = $obj->View_All_By_Cond($table_name, $where_cond);
                                                foreach ($data_list AS $index1 => $value1) {
                                                    $str .= '<option value="'.$value1['_id'].'">'.$value1['_name'].'</option>';
                                                }*/
                                  ?>
   var str = '<?php echo $str; ?>';
   tr = tr +'<select name="ac['+(more-1)+'][education_board]"><option value="">--Select--</option>'+str+'</select></td><td><input type="text" name="ac['+(more-1)+'][roll]" style="width:109px"></td><td><input type="text" name="ac['+(more-1)+'][pass_year]" style="width:109px"></td><td><input type="text" name="ac['+(more-1)+'][institute]" style="width:200px"></td><td ><input type="text" name="ac['+(more-1)+'][gpa]" style="width:80px"><a href="#" class="close close-this" title="Removed this row">X</a></td></tr>';
	   
	   
	   $("table.academic-table tbody").last().append(tr);
	   
	});
</script>-->
