
<style> .alert-successs{background-color: #1eaf59;color: white;display: none}
            .required{color: #FF0000;}
            .error-message{font-size: 12px;color: red;display: none;}
            .col-md-6{margin: 12px;}
            h3 {}
    </style>
<?php 
$teacher_id=''; $marital=''; $staff_position='';
if(isset($_POST['search'])){
$teacher_id= $_POST["teacher_id"];
$search= $_POST["search"];
   
  $result=mysqli_query($con, "SELECT * FROM `teacher` WHERE `teacher_id` = '$teacher_id'");
   while($teacher_row=mysqli_fetch_assoc($result)) {

    $teacher_id         =$teacher_row['teacher_id'];
    $teacher_sr         =$teacher_row['teacher_sr'];
    $name               =$teacher_row['name']; 
    $father             =$teacher_row['father']; 
    $mother             =$teacher_row['mother']; 
    $mobile             =$teacher_row['mobile']; 
    $mobile2            =$teacher_row['mobile2']; 
    $brday              =$teacher_row['brday']; 
    $nid_bid            =$teacher_row['nid_bid']; 
    $teacher_img        =$teacher_row['teacher_img']; 
    $village            =$teacher_row['village']; 
    $blood              =$teacher_row['blood']; 
    $post               =$teacher_row['post']; 
    $thana_idf          =$teacher_row['thana_idf']; 
    $thana_idf          =$teacher_row['thana_idf']; 
    $district_idf       =$teacher_row['district_idf']; 
    $p_village          =$teacher_row['p_village']; 
    $p_post             =$teacher_row['p_post']; 
    $p_thana_idf        =$teacher_row['p_thana_idf']; 
    $p_district_idf     =$teacher_row['p_district_idf']; 
    $marital            =$teacher_row['marital']; 
    $board              =$teacher_row['board']; 
    $qualifications     =$teacher_row['qualifications']; 
    $staff_division     =$teacher_row['staff_division']; 
    $title              =$teacher_row['title']; 
    $salary             =$teacher_row['salary']; 
    $admissionyear      =$teacher_row['admissionyear']; 
    $admissiondate      =$teacher_row['admissiondate']; 
    $date_appointment   =$teacher_row['date_appointment']; 
    $staff_position     =$teacher_row['staff_position']; 
    $tc_date            =$teacher_row['tc_date']; 
    $tc_comment         =$teacher_row['tc_comment']; 
    $status             =$teacher_row['status']; 
    $teacher_punch_id   =$teacher_row['teacher_punch_id']; 
    
   }

}

$id_form=mysqli_query($con,"SELECT teacher_id FROM `teacher`  order by teacher_id desc limit 1");
$id_form_row= mysqli_fetch_assoc($id_form);

$yearf=mysqli_query($con,"SELECT year FROM `academic_year`  order by year desc limit 1");
$year_row= mysqli_fetch_assoc($yearf);
///////////////////////////////////////////////////////////////////
if (isset($_POST['submit'])){
	$teacher_sr     =$_POST['teacher_sr'];
    $te_id          =$_POST['teacher_id'];
	$name           =$_POST['name'];
	$father         =$_POST['father'];
	$mother         =$_POST['mother'];
	$mobile         =$_POST['mobile'];
	$brday          =$_POST['brday'];
	$nid_bid        =$_POST['nid_bid'];
	$village        =$_POST['village'];
	$post           =$_POST['post'];
	$thana_idf      =$_POST['thana_idf'];
	$district_idf   =$_POST['district_idf'];
	$p_village      =$_POST['p_village'];
	$p_post         =$_POST['p_post'];
	$p_thana_idf    =$_POST['p_thana_idf'];
	$p_district_idf =$_POST['p_district_idf'];
	$marital        =$_POST['marital'];
	$board          =$_POST['board'];
	$staff_division =$_POST['staff_division'];
	$qualifications =$_POST['qualifications'];
	$title          =$_POST['title'];
	$salary         =$_POST['salary'];
	$admissionyear  =$_POST['admissionyear'];
	$admissiondate  =$_POST['admissiondate'];
	$staff_position =$_POST['staff_position'];
	$date_appointment=$_POST['date_appointment'];
    $blood_group    =$_POST['blood_group'];
    $tc_date        =$_POST['tc_date'];
    $tc_comment     =$_POST['tc_comment'];
    $status         =$_POST['status'];
    $teacher_punch_id=$_POST['teacher_punch_id'];
    $user_idf       =$_POST['user_idf'];
   
    $rec_img        = $_FILES['upload_img'];
    $teacher_img    =   $mobile.$rec_img['name']; 
    $img_tmp_name   = $rec_img['tmp_name'];


$update= "UPDATE teacher SET  teacher_sr='$teacher_sr', name='$name', father='$father', mother='$mother',  mobile='$mobile', brday='$brday', title='$title', salary='$salary', marital='$marital', board='$board', qualifications='$qualifications', village='$village', post='$post', p_village='$p_village', p_post='$p_post', staff_position='$staff_position', thana_idf='$thana_idf', district_idf='$district_idf', p_thana_idf='$p_thana_idf', p_district_idf='$p_district_idf', staff_division='$staff_division', date_appointment='$date_appointment', blood='$blood_group', tc_date='$tc_date', tc_comment='$tc_comment',  status='$status', teacher_punch_id='$teacher_punch_id', user_idf='$user_idf'  WHERE teacher_id='$te_id'  ";

$update_result = mysqli_query($con, $update);

if (mysqli_query($con,$update_result)===TRUE){
  
echo '<div class="alert alert-danger" role="alert">সংরক্ষণ হয় নাই</div>';
}else {
    echo '<div class="alert alert-success" role="alert">Data is successful saved !</div>';
}


if($update_result==true){   
echo '<meta http-equiv="refresh" content="3">';
}

    if(!empty($teacher_img)){
        $loc ="teacher_img/";
        move_uploaded_file($img_tmp_name, $loc.$teacher_img);
    }else{
        echo "Your File is emty";
    }

}
?>
    <br>
<form action="" method="POST" enctype="multipart/form-data">   
<div class="container">
    <form>
        <div class="row">
            <!-- Input Field -->
            <div class="col-md-5">
                <input style="color:red" type="text" class="form-control" name="teacher_id" value="<?php echo isset($teacher_id) ? $teacher_id : ''; ?>" placeholder="আইডি">
                <input type="hidden" class="form-control" name="id" value="<?php echo $row['teacher_id']; ?>">
            </div>

            <!-- Search Button -->
            <div class="col-md-4 d-flex align-items-center">
                <button type="submit" name="search" class="btn btn-primary w-100">খোঁজ করুন</button>
            </div>
        </div>
    </form>
</div>
<br>
 <div class="alert alert-successs" id="successMessage">Data is successful saved !</div>

	  <div class="row">
        <div class="col-md-12">
          <!-- Custom Tabs -->
          <div class="nav-tabs-custom">
      
            <div class="tab-content">
<div class="tab-pane active" id="tab_1">
         <div class="row">
    <div class="col-md-4 col-sm-4 col-xs-12" >
<style>
  .red_color{color: red;}
</style>

<!-- /.from -->
<form id="" method="POST" action="" enctype="multipart/form-data">
        <table class="table-condensed"> 	
        		<tr><td><strong>আইডি </strong></td>
				<td> 
                    <input style="color:red" type="text" name="teacher_id" value="<?php echo $id_form_row['teacher_id']+1?>" class="form-control" onkeypress="isInputNumber(event)" readonly="readonly" value="<?php echo isset($teacher_id) ? $teacher_id:'' ?>"autocomplete="off" required data-parsley-trigger="keyup">
                    <input type="hidden" name="teacher_id" class="form-control" value="<?php echo isset($teacher_id) ? $teacher_id:''; ?>">

        <input type="hidden" name="reg_nog">
          <?php if(isset($input_errors['teacher_id'])){
          echo '<span class="red_color">'.$input_errors['teacher_id'].'</span>';}?>     
        </td></tr>
       
			
        	<tr>
        		<td><strong>সিরিয়াল</td><td><input type="text" name="teacher_sr"  id="teacher_sr" class="form-control" onkeypress="isInputNumber(event)" value="<?php echo isset($teacher_sr) ? $teacher_sr:'' ?>" required data-parsley-trigger="keyup" autocomplete="off">
            </td>
        	</tr>
			            <tr>
                <td><strong><?= name?></strong></td><td><input type="text" name="name" id="name" class="form-control" value="<?php echo isset($name) ? $name:''; ?>" required data-parsley-trigger="keyup"></td>
            </tr>
        	<tr>
        		<td><strong> <?= Birthday?></strong></td><td><input type="date" name="brday" id="brday" class="form-control" value="<?php echo isset($brday) ? $brday:'' ?>"></td>
        	</tr>
            
        	<tr>
        		<td><strong> <?= nid?></strong></td><td><input type="text" name="nid_bid" id="nid_bid" class="form-control" onkeypress="isInputNumber(event)" value="<?php echo isset($nid_bid) ? $nid_bid:'' ?>"></td>
        	</tr>
          
           <tr><td><strong><?= FathersName?> </strong></td><td><input type="text" name="father" id="father" class="form-control"  value="<?php echo isset($father) ? $father:'' ?>"></td></tr>
            
            <tr>
                <td><strong><?= Mothersname?> </strong></td><td><input type="text" name="mother" id="mother" class="form-control" value="<?php echo isset($mother) ? $mother:'' ?>"></td>
            </tr>


         
            
        </table>
    </div>

	    <div class="col-md-4 col-sm-6 col-xs-12">
		 <table  class="table-condensed">


         <tr>
        		<td><strong><?= MobileNumber?></strong></td><td><input type="text" name="mobile" id="mobile" class="form-control" onkeypress="isInputNumber(event)" value="<?php echo isset($mobile) ? $mobile:'' ?>"  required data-parsley-trigger="keyup"></td>
        	</tr>
            <tr>
            <td><strong><?= _Category?></strong></td><td>				
	       <?php 
         
    $thana_sql = mysqli_query($con, "SELECT * FROM staff_division WHERE status=1  group by staff_division_name ORDER BY sl2 ASC");

    $edite      = mysqli_query($con,"SELECT * FROM teacher
    LEFT JOIN staff_division on staff_division.staff_division_id=teacher.staff_division  WHERE  `teacher`.`teacher_id` = '$teacher_id'  group by staff_division_name ");

    $row_thana_idf  = mysqli_fetch_array($edite); ?>         
<select class="form-control" name="staff_division" tabindex="11">

 <option value="">বিভাগ সিলেক্ট করুন</option>
 <?php $option = mysqli_query($con, "SELECT DISTINCT staff_division.staff_division_id, staff_division.staff_division_name FROM staff_division");
 foreach($thana_sql as $key => $value){ ?>
                <option value="<?=$value['staff_division_id'] ;?>" <?php if($row_thana_idf['staff_division'] == $value['staff_division_id']){ ?>selected <?php }?>><?=$value['staff_division_name'] ;?></option>
                    <?php }  ?>

        </select></td>
            </tr>
       
        
       
            <tr>
                <td><strong><?= _designation?> </strong></td><td><input type="text" name="title" id="title" class="form-control" value="<?php echo isset($title) ? $title:'' ?>" required data-parsley-trigger="keyup"></td>
            </tr>
            <tr>
                <td><strong><?= salary?> </strong></td><td><input type="text" name="salary" id="salary" class="form-control" onkeypress="isInputNumber(event)" value="<?php echo isset($salary) ? $salary:'' ?>"></td>
            </tr>
           
                <td><strong><?= _marital?></strong></td>			
                
                <td colspan="2">
                    <label class="radio-inline">
                      <input type="radio" name="marital" id="inlineRadio1 marital_status" value="বিবাহিত" <?php if($marital=='বিবাহিত'){echo 'checked'; } ?> >বিবাহিত </label>
                    <label class="radio-inline">
                      <input type="radio" name="marital" id="inlineRadio2 marital_status" value="অবিবাহিত" <?php if($marital=='অবিবাহিত'){echo 'checked'; } ?> >অবিবাহিত                    </label>
             
                </td>

            <tr>
                <td><strong><?= sboard?> </strong></td><td><input type="text" name="board" id="board" class="form-control" value="<?php echo isset($board) ? $board:'' ?>"></td>
            </tr>

            <tr>
                <td><strong><?= Edu_Qua?> </strong></td><td><input type="text" name="qualifications" id="qualifications" class="form-control" value="<?php echo isset($qualifications) ? $qualifications:'' ?>"></td>
            </tr>


                
            </tr></td>
            </tr>
            
        
        </table>
    </div>  
				
	 <div class="col-md-4 col-sm-6 col-xs-12">
		
		
   <table  class="table-condensed">
            <tr>
                <td><strong><?= year?></strong></td><td><input type="text" name="admissionyear" id="admissionyear" readonly="readonly"  value="<?php echo $year_row['year']; ?>" class="form-control" ></td>
            </tr>
            <tr>
                <td><strong><?= _date?></strong></td><td><input type="text" name="admissiondate" value="<?php echo date("d-m-Y");?>" id="admissiondate" readonly="readonly"   required data-parsley-trigger="keyup" class="form-control" ></td>
            </tr>
            <tr>
                <td><strong><?= recruitment_date?></strong></td><td><input type="date" name="date_appointment"  id="date_appointment" value="<?php echo isset($date_appointment) ? $date_appointment:'' ?>"  class="form-control" ></td>
            </tr>

            <tr>
                <td>পাঞ্চ আইডি</td><td><input type="number" name="teacher_punch_id"  id="teacher_punch_id" value="<?php echo isset($teacher_punch_id) ? $teacher_punch_id:'' ?>"  class="form-control" ></td>
            </tr>
        <img src="img/gr man.png" height="100" id="apli_photo_image">
        <input type="file" name="upload_img" id="upload_img" accept="image/jpeg, image/gif, image/png"/>
       

        <td><strong>ইউজার</strong></td>
<td>
    <?php
    // Profile তালিকা রিট্রিভ করা হচ্ছে
    $profile_sql = mysqli_query($con, "SELECT Profile_ID, bangla_name FROM profile WHERE status=1 AND hidden=1 ");

    // Teacher এর বিস্তারিত তথ্য প্রাপ্তি
    $edite = mysqli_query($con, "SELECT * FROM teacher
        LEFT JOIN profile ON profile.Profile_ID = teacher.user_idf
        WHERE teacher.teacher_id = '$teacher_id'");

    $row_user_idf = mysqli_fetch_array($edite);
    ?>
    <select class="form-control" name="user_idf" tabindex="11">
        <option value="">ইউজার সিলেক্ট করুন</option>
        <?php
        while ($profile = mysqli_fetch_assoc($profile_sql)) {
            $selected = ($row_user_idf['user_idf'] == $profile['Profile_ID']) ? 'selected' : '';
            ?>
            <option value="<?= htmlspecialchars($profile['Profile_ID']) ?>" <?= $selected ?>>
                <?= htmlspecialchars($profile['bangla_name']) ?>
            </option>
        <?php } ?>
    </select>
</td>




       </table>
       <br>
               <td><strong>শিক্ষক </strong></td><td>
            <label class="switch3">
              <input type="radio" name="staff_position" value="1"<?php if($staff_position=='1'){echo 'checked';
                                } ?>  >
              <span class="slider3 round"></span>
            </label>
       
       
            <td><strong>কর্মচারী</strong></td><td>
            <label class="switch">
              <input type="radio" name="staff_position" value="2"<?php if($staff_position=='2'){echo 'checked';} ?> >
              <span class="slider2 round"></span>
            </label></td>
    </div>
  
   <table  class="table-condensed">
           
        </table>
    </div>
</div>
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;স্থায়ী ঠিকানা</h3>
   <table  class="table-condensed">
   <tr>
                <td><strong>গ্রাম &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </strong></td><td><input type="text" name="village" id="village" class="form-control" value="<?php echo isset($village) ? $village:'' ?>"></td>
            </tr>
            <tr>
                <td><strong><?= PostOffice?> </strong></td><td><input type="text" name="post" id="post" class="form-control" value="<?php echo isset($post) ? $post:'' ?>"></td>
            </tr>
            <tr>
         <td><strong><?= Thana?></strong></td><td>               
          <?php 
         
    $thana_sql = mysqli_query($con, "SELECT * FROM thana WHERE status=0  group by thana_name ORDER BY sl2 ASC");

    $edite      = mysqli_query($con,"SELECT * FROM teacher
    LEFT JOIN thana on thana.thana_id=teacher.thana_idf  WHERE  `teacher`.`teacher_id` = '$teacher_id'  group by thana_name ");

    $row_thana_idf  = mysqli_fetch_array($edite); ?>         
<select class="form-control" name="thana_idf" tabindex="11">

 <option value="">থানা সিলেক্ট করুন</option>
 <?php $option = mysqli_query($con, "SELECT DISTINCT thana.thana_id, thana.thana_name FROM thana");
 foreach($thana_sql as $key => $value){ ?>
                <option value="<?=$value['thana_id'] ;?>" <?php if($row_thana_idf['thana_idf'] == $value['thana_id']){ ?>selected <?php }?>><?=$value['thana_name'] ;?></option>
                    <?php }  ?>

        </select></td>
            </tr>
            <tr>
            <tr>
  <td><strong><?= Zilla?></strong></td><td>
          <?php 
         
    $district_sql = mysqli_query($con, "SELECT * FROM district WHERE status=0  group by district_name ORDER BY sl2 ASC");

    $edite      = mysqli_query($con,"SELECT * FROM teacher
    LEFT JOIN district on district.district_id=teacher.district_idf  WHERE  `teacher`.`teacher_id` = '$teacher_id'  group by district_name ");

    $row_district_idf  = mysqli_fetch_array($edite); ?>         
<select class="form-control" name="district_idf" tabindex="11">
 <option value="">জেলা সিলেক্ট করুন</option>

 <?php $option = mysqli_query($con, "SELECT DISTINCT district.district_id, district.district_name FROM district");
 foreach($district_sql as $key => $value){ ?>
                <option value="<?=$value['district_id'] ;?>" <?php if($row_district_idf['district_idf'] == $value['district_id']){ ?>selected <?php }?>><?=$value['district_name'] ;?></option>
                    <?php }  ?>

        </select></td>
            </tr>
    <tr>
                </td>
            </tr>
   
           
        </table>
    </div>

	    <div class="col-md-4 col-sm-6 col-xs-12">
        <h3><div class="checkbox">
      <label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox"  name="same" id="same"> &nbsp; বর্তমান ঠিকানা</label>
  </div></h3>
        <table  class="table-condensed">
       


        <tr>
                <td><strong>গ্রাম &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></td><td><input type="text" name="p_village" id="p_village" value="<?php echo isset($p_village) ? $p_village:'' ?>" class="form-control" ></td>
            </tr>
            <tr>
                <td><strong><?= PostOffice?></strong></td><td><input type="text" name="p_post" id="p_post" value="<?php echo isset($p_post) ? $p_post:'' ?>" class="form-control" ></td>
            </tr>
            <tr>
         <td><strong><?= Thana?></strong></td><td>               
          <?php 
         
    $thana_sql = mysqli_query($con, "SELECT * FROM thana WHERE status=0  group by thana_name ORDER BY sl2 ASC");

    $edite      = mysqli_query($con,"SELECT * FROM teacher
    LEFT JOIN thana on thana.thana_id=teacher.p_thana_idf  WHERE  `teacher`.`teacher_id` = '$teacher_id'  group by thana_name ");

    $row_thana_idf  = mysqli_fetch_array($edite); ?>         
<select class="form-control" name="p_thana_idf" tabindex="11">

 <option value="">থানা সিলেক্ট করুন</option>
 <?php $option = mysqli_query($con, "SELECT DISTINCT thana.thana_id, thana.thana_name FROM thana");
 foreach($thana_sql as $key => $value){ ?>
                <option value="<?=$value['thana_id'] ;?>" <?php if($row_thana_idf['p_thana_idf'] == $value['thana_id']){ ?>selected <?php }?>><?=$value['thana_name'] ;?></option>
                    <?php }  ?>

        </select></td>
            </tr>
            <tr>
         <td><strong><?= Zilla?></strong></td><td>
          <?php 
         
    $district_sql = mysqli_query($con, "SELECT * FROM district WHERE status=0  group by district_name ORDER BY sl2 ASC");

    $edite      = mysqli_query($con,"SELECT * FROM teacher
    LEFT JOIN district on district.district_id=teacher.p_district_idf  WHERE  `teacher`.`teacher_id` = '$teacher_id'  group by district_name ");

    $row_district_idf  = mysqli_fetch_array($edite); ?>         
<select class="form-control" name="p_district_idf" tabindex="11">
 <option value="">জেলা সিলেক্ট করুন</option>

 <?php $option = mysqli_query($con, "SELECT DISTINCT district.district_id, district.district_name FROM district");
 foreach($district_sql as $key => $value){ ?>
                <option value="<?=$value['district_id'] ;?>" <?php if($row_district_idf['p_district_idf'] == $value['district_id']){ ?>selected <?php }?>><?=$value['district_name'] ;?></option>
                    <?php }  ?>

        </select></td>
            </tr>
        </table>
<br><br>
        <button type="submit" name="submit" class="btn btn-md btn btn-info btn-block text-uppercase"><span class="fa fa-plus"></span>  সম্পদনা</button><br>
    </div>
	    <div class="col-md-4 col-sm-6 col-xs-12">

    </table>

        
        
   <table  class="table-condensed">
 <div class="form-group">
                <label>রক্তের গ্রুপ</label>
                <div class="input-group">
                  <div class="input-group-addon"><i class="fa fa-fw fa-tint text-red"></i></div>
    <?php 
    $blood_sql = mysqli_query($con, "SELECT * FROM blood_group WHERE status=1  group by blood_name ORDER BY blood_group_id ASC");
    $edite      = mysqli_query($con,"SELECT * FROM teacher
    LEFT JOIN blood_group on blood_group.blood_name=teacher.blood  WHERE  `teacher`.`teacher_id` = '$teacher_id'  group by blood_name ");

    $row_class_idf  = mysqli_fetch_array($edite); ?>         
<select class="form-control" name="blood_group" tabindex="12">

 <option value="">রক্তের গ্রুপ সিলেক্ট করুন</option>
 <?php $option = mysqli_query($con, "SELECT DISTINCT blood_group.blood_name FROM blood_group");
 foreach($blood_sql as $key => $value){ ?>
                <option value="<?=$value['blood_name'] ;?>" <?php if($row_class_idf['blood'] == $value['blood_name']){ ?>selected <?php }?>><?=$value['blood_name'] ;?></option>
                    <?php }  ?>

        </select>
                </div>
              </div>

           


        <td><strong>চালু </strong></td><td>
            <label class="switch3">
              <input type="radio" name="status" value="1"<?php if($status=='1'){echo 'checked'; } ?>  >
              <span class="slider3 round"></span>
            </label>
       
       
            <td><strong>বন্ধ</strong></td><td>
            <label class="switch">
              <input type="radio" name="status" value="0"<?php if($status=='0'){ echo 'checked'; } ?> >
              <span class="slider2 round"></span>
            </label></td>


        <tr>
                <td><strong>কারণ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></td><td>
                    <input type="text" name="tc_comment" id="tc_comment" value="<?php echo isset($tc_comment) ? $tc_comment:'' ?>" class="form-control" ></td>
            </tr>


        <tr>
                <td><strong>তারিখ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></td><td>
                    <input type="date" name="tc_date" id="tc_date" value="<?php echo isset($tc_date) ? $tc_date:'' ?>" class="form-control" ></td>
            </tr>

        </table>
    </div>
</div>
		<br>
    </div>
  </div>








  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
    
    $("#apli_photo").change(function () {
        if (this.files && this.files[0]) {
            var reader = new FileReader();

            reader.onload = function (e) {
                $('#apli_photo_image').attr('src', e.target.result);
            }
            reader.readAsDataURL(this.files[0]);
        }
    });
$(document).ready(function() { 
    $('#father').change(function() {
      $('#Guardian').val($('#father').val())($('#Relation').val('পিতা'));
    });
$('#same').click(function(){
if($(this).is(':checked')){
$('#pre_district').val($('#district').val());
$('#p_thana_idf').val($('#thana').val());
$('#p_post').val($('#post').val());
$('#p_village').val($('#village').val());
} else {
$('#pre_district').val('');
$('#p_thana_idf').val('#thana');
$('#p_post').val('');
$('#p_village').val('');

}
});

$('#gsame').click(function(){
if($(this).is(':checked')){
$('#g_district').val($('#district').val());
$('#g_thana').val($('#thana').val());
$('#p_post').val($('#post').val());
$('#g_village').val($('#village').val());
}else {
$('#g_district').val('');
$('#g_thana').val('');
$('#p_post').val('');
$('#g_village').val('');

}
});
});

</script>
</form>
</div>




        <script>  
            function isInputNumber(evt){               
                var ch = String.fromCharCode(evt.which);         
                if(!(/[0-9]/.test(ch))){
                    evt.preventDefault();
                }             
            }
            function isInputResult(evt){          
                var ch = String.fromCharCode(evt.which); 
                if(!(/[0-9 .]/.test(ch))){
                    evt.preventDefault();
                }                
            }
        </script>  		
	<!-- Latest compiled and minified JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>					
              </div>
              <!-- /.tab-pane -->
            </div>
            <!-- /.tab-content -->
          </div>
          <!-- nav-tabs-custom -->
        </div>
</div>


<script type="text/javascript">
  $("form#ajaxForm").on("submit",function (e) {
      e.preventDefault();
      var name = $("#name").val();
      var academic_add = $("#academic_add").val();
      var contact = $("#contact").val();
      if (name == ""){
          $("#nameError").show();
          $("#nameError").html("অনুগ্রহ করে আপনার প্রতিষ্ঠানের  নাম লিখুন");
          $("#nameError").fadeOut(4000);
          $("#name").focus();
      }else if (academic_add == ""){
          $("#academic_addError").show();
          $("#academic_addError").html("অনুগ্রহ করে ঠিকানা লিখুন");
          $("#academic_addError").fadeOut(4000);
          $("#academic_add").focus();       
      }else{
          $("#submitBtn").hide('fast');
          $("#loader").show('fast');
         
      }
  });
</script>
<script>
        $(document).ready(function() {
        $('#country-dropdown').on('change', function() {
        var division_id_f = this.value;
        $.ajax({
        url: "class_name.php",
        type: "POST",
        data: {
            division_id_f: division_id_f
        },
        cache: false,
        success: function(result){
        $("#state-dropdown").html(result);
        $('#city-dropdown').html('<option value="">Select State First</option>'); 
        }
        });
        });  

        $('#state-dropdown').on('change', function() {
        var class_idf = this.value;
        $.ajax({
        url: "section_name.php",
        type: "POST",
        data: {
            class_idf: class_idf
        },
        cache: false,
        success: function(result){
        $("#city-dropdown").html(result);
        }
        });
        });
        });
    </script>