<?php
include('header.php');



if (count($_FILES) > 0) {
    $signimage = addslashes(file_get_contents($_FILES['sign']['tmp_name']));
    $signimagetype = getimageSize($_FILES['sign']['tmp_name']);
    $stampimage = addslashes(file_get_contents($_FILES['stamp']['tmp_name']));
    $stampimagetype = getimageSize($_FILES['stamp']['tmp_name']);
    $topleftimage = addslashes(file_get_contents($_FILES['statelogo']['tmp_name']));
    $topleftimagetype = getimageSize($_FILES['statelogo']['tmp_name']);
    $toprightimage = addslashes(file_get_contents($_FILES['formlogo']['tmp_name']));
    $toprightimagetype = getimageSize($_FILES['formlogo']['tmp_name']);

    date_default_timezone_set("Asia/Kolkata");   //India time (GMT+5:30)
    $date = date('d-m-Y H:i:s');
    $state = mysqli_real_escape_string($conn,$_POST['state']) ;
    $hospital = mysqli_real_escape_string($conn,$_POST['hospital']) ;
    $govten = mysqli_real_escape_string($conn,$_POST['govten']) ;
    $govtlocal = mysqli_real_escape_string($conn,$_POST['govtlocal']) ;
    $dept = mysqli_real_escape_string($conn,$_POST['dept']) ;
    $deptlocal = mysqli_real_escape_string($conn,$_POST['deptlocal']) ;
    $hospitalname = mysqli_real_escape_string($conn,$_POST['hospitalname']) ;
    $hospitalnamelocal = mysqli_real_escape_string($conn,$_POST['hospitalnamelocal']) ;
    $district = mysqli_real_escape_string($conn,$_POST['district']) ;
    $districtlocal = mysqli_real_escape_string($conn,$_POST['districtlocal']) ;
    $tahsildistrict = mysqli_real_escape_string($conn,$_POST['tahsildistrict']) ;
    $tahsildistrictlocal = mysqli_real_escape_string($conn,$_POST['tahsildistrictlocal']) ;
    
    $userphone = $udata['phone'];
    $sql = "INSERT INTO `portal`(`state`, `hospital`, `govten`, `govtlocal`, `dept`, `deptlocal`, `hospitalname`, `hospitalnamelocal`, `birthlanglocal`, `line1local`, `line1`, `line2local`, `line2`, `namelocal`, `genderlocal`, `doblocal`, `poblocal`, `mnamelocal`, `fnamelocal`, `birthaddresslocal`, `permanentaddresslocal`, `regnolocal`, `regdatelocal`, `remarkslocal`, `doilocal`, `ialocal`, `registrarlocal`, `registrar`, `reghospitallocal`, `reghospital`, `lastlinelocal`, `aadharlocal`, `topleftlocal`, `toprightlocal`, `signimage`, `stampimage`, `topleftimage`, `toprightimage`, `signimagetype`, `stampimagetype`, `topleftimagetype`, `toprightimagetype`, `username`) VALUES ('$state','$hospital','$govten',N'" . $govtlocal . "','$dept',N'" . $deptlocal . "','$hospitalname',N'" . $hospitalnamelocal . "',N'" . $birthlanglocal . "',N'" . $lineonelocal . "',N'" . $lineone . "',N'" . $linetwolocal ."','$linetwo',N'" . $namelocal . "',N'" . $genderlocal . "',N'" . $doblocal . "',N'" . $poblocal . "',N'" . $mnamelocal . "',N'" . $fnamelocal . "',N'" . $birthaddresslocal . "',N'" . $permanentaddresslocal . "',N'" . $regnolocal . "',N'" . $regdatelocal . "',N'" . $remarkslocal . "',N'" . $doilocal . "',N'" . $ialocal . "',N'" . $districtlocal . "',N'" . $district . "',N'" . $tahsildistrict . "',N'" . $tahsildistrictlocal . "',N'" . $lastlinelocal . "',N'" . $aadharlocal . "',N'" . $topleftlocal . "',N'" . $toprightlocal . "','$signimage','$stampimage','$topleftimage','$toprightimage','{$signimagetype['mime']}','{$stampimagetype['mime']}','{$topleftimagetype['mime']}','{$toprightimagetype['mime']}', '$userphone')";
  
    
        $querysql = mysqli_query($conn, $sql);
        
        if ($querysql) {
            ?>
            <script>
                $(function(){
                    Swal.fire(
                        'Success',
                        'Hospital Added Successfully',
                        'success'
                    )

                });
            </script>
            <?php
        } else {
            echo  $conn->error;
            ?>
            <script>
                $(function(){
                    Swal.fire(
                        'Opps',
                        'Internal Server Error Try AGain',
                        'error'
                    )

                });
            </script>
            <?php
        }
   
}


?>
<style>
        .payment-form {
            max-width: 90%;
            margin: auto;
            background: #fff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 10px rgb(0 0 0 / 80%);
        }

        .payment-form input {
            width: calc(100% - 20px);
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        .payment-form button {
            width: 100%;
            padding: 10px;
            background: #28a745;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        .payment-form button:hover {
            background: #218838;
        }

        .qr-popup {
            display: none;
            position: fixed;
            top: 70px;
            left: 50%;
            transform: translateX(-50%);
            width: 300px;
            background: rgb(255, 255, 255);
            justify-content: center;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            color: #181818;
            border: 5px solid #28a745;
            /* Add a 5px border with green color */
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
            /* Optional: Add a shadow for better styling */
        }

        .qr-popup img {
            max-width: 200px;
            margin: 10px auto;
        }

        .qr-popup button {
            margin-top: 10px;
            padding: 10px;
            background: #dc3545;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
    </style>
<!-- Content Wrapper. Contains page content -->
<div class="payment-form">
        <h2>Birth Hospital Add Free</h2>
                      






                        
                        <form class="user" method="post" autocomplete="off" onsubmit="return validation();" enctype="multipart/form-data" action="">

                           <div class="form-group row">
                  <div class="col-sm-6 mb-3 mb-sm-0">
    <label>State</label>
    <div class="form-group">
        <select id="state" class="form-control" style="text-transform:uppercase" name="state" required>
                                            <option>Select State</option>
                                            <option value="Andhra Pradesh"> Andhra Pradesh </option>
                                            <option value="Arunachal Pradesh"> Arunachal Pradesh </option>
                                            <option value="Assam"> Assam </option>
                                            <option value="Bihar"> Bihar </option>
                                            <option value="Chandigarh"> Chandigarh </option>
                                            <option value="Chhattisgarh"> Chhattisgarh </option>
                                            <option value="Delhi"> Delhi </option>
                                            <option value="Gujarat"> Gujarat </option>
                                            <option value="Haryana"> Haryana </option>
                                            <option value="Himachal Pradesh"> Himachal Pradesh </option>
                                            <option value="Jammu and Kashmir"> Jammu and Kashmir </option>
                                            <option value="Jharkhand"> Jharkhand </option>
                                            <option value="Karnataka"> Karnataka </option>
                                            <option value="Kerala"> Kerala </option>
                                            <option value="Madhya Pradesh"> Madhya Pradesh </option>
                                            <option value="Maharashtra"> Maharashtra </option>
                                            <option value="Manipur"> Manipur </option>
                                            <option value="Meghalaya"> Meghalaya </option>
                                            <option value="Orissa"> Orissa </option>
                                            <option value="Puducherry"> Puducherry </option>
                                            <option value="Punjab"> Punjab </option>
                                            <option value="Rajasthan"> Rajasthan </option>
                                            <option value="Tamil Nadu"> Tamil Nadu </option>
                                            <option value="Telangana"> Telangana </option>
                                            <option value="Tripura"> Tripura </option>
                                            <option value="Uttar Pradesh"> Uttar Pradesh </option>
                                            <option value="Uttarakhand"> Uttarakhand </option>
                                            <option value="West Bengal "> West Bengal </option>
                                        </select>
    </div>
</div>
                                      
 <div class="col-sm-6">

                                            <label>Government Name</label>

                                            <div class="form-group">

                                                <input class="form-control" id="govten" name="govten" type="text" value="GOVERNMENT OF BIHAR">
                                                 <input class="form-control" style="text-transform:uppercase" name="govtlocal" id="govtlocal" type="text" value="">

                                            </div>

                                        </div>


                                       

                                        <br>
                                        
                                        
                                         <div class="col-sm-6">

                                            <label>Department Name</label>

                                           <div class="form-group">
                <input class="form-control" style="text-transform:uppercase" name="dept" id="dept" type="text" value="DEPARTMENT OF PLANNING AND DEVELOPMENT">
                 <input class="form-control" style="text-transform:uppercase" name="deptlocal" id="deptlocal" type="text" value="">

                                            </div>

                                        </div>


<div class="col-sm-4">
    <label>District</label>
    <div class="form-group">
        
             <input class="form-control" id="district" name="district" type="text" placeholder="Enter District" onkeyup="updateFields()" required="">
            <input class="form-control" style="text-transform:uppercase" name="district" id="districtlocal" type="text" value="">


                                            </div>

                                        </div>
                                        
                                        <div class="col-sm-4">
    <label>TAHSIL/BLOCK</label>
    <div class="form-group">
        <input class="form-control" id="tahsildistrict" name="tahsildistrict" type="text" placeholder="Enter TAHSIL/BLOCK" onkeyup="updateFields()" required="">
         <input class="form-control" style="text-transform:uppercase" name="tahsildistrictlocal" id="tahsildistrictlocal" type="text" value="">
    </div>
</div>

<div class="col-sm-4">
    <label>Hospital</label>
    <div class="form-group">
   
        <input class="form-control" id="hospitalname" name="hospitalname" type="text" onkeyup="autofillHospitalFields()" placeholder="Enter Hospital Name" required="">
         <input class="form-control" style="text-transform:uppercase" name="hospitalnamelocal" id="hospitalnamelocal" type="text" value="">
    </div>
</div>


                                        
  

 <div class="col-sm-4">
    <label>Select Local Language</label>
    <div class="form-group">
        <select class="form-control" onchange="changelang()" name="language" id="language" required="">
            <option value="">SELECT</option>
            <option value="as">Assamese</option>
            <option value="bn">Bengali</option>
            <option value="gu">Gujarati</option>
            <option value="hi">Hindi</option>
            <option value="kn">Kannada</option>
            <option value="ml">Malayalam</option>
            <option value="mr">Marathi</option>
            <option value="or">Odia</option>
            <option value="pa">Punjabi</option>
            <option value="ta">Tamil</option>
            <option value="te">Telugu</option>
            <option value="ur">Urdu</option>
            <option value="sd">Sindhi</option>
            <option value="kok">Konkani</option>
            <option value="ne">Nepali</option>
            <option value="sat">Santali</option>
            <option value="mai">Maithili</option>
            <option value="bh">Bhojpuri</option>
            <option value="mlt">Manipuri</option>
            <option value="brx">Bodo</option>
            <option value="ks">Kashmiri</option>
            <option value="mni">Meitei</option>
        </select>
        <span id="errorlanguage" class="error"></span>
    </div>
</div>

    <!-- Popup Modal for Default Signatures -->
   

</div>

   
                                        

                                        <br>
                                        <div >
                                        
                                       

                                       



                                           
     <!----Hideen Value End----->  

                                        <br>
                                        
                                         


                                       
                       <!-- Signature Section -->
    <div class="col-sm-4">
    <label for="sign">Add Signature</label>

    <div class="form-group text-center">
        <input type="file" name="sign" class="form-control"  accept="image/png, image/jpeg"  id="signInp">
        <img id="signPreview" src="#" alt="Signature Preview" style="display:none; margin-top: 10px;" height="100px" width="100px">
          <span id="stateLogoError" class="text-danger"></span>
    </div>
                                
    
    </div>
    <!-- Show More button -->
            

    

    
     


                                        
                                        
                                        
                                        <div class="col-sm-12">
                                            <label>&nbsp;</label>
                                            <div class="form-group">
       <button type="submit" name="savedata" class="btn btn-primary">Submit</button>

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

                    </div></form>

                    <!-- /# row -->

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


 <script type="text/javascript">
    
    // Google Translate integration
    function changelang() {
        var lang = document.getElementById("language").value;

        function translate(text, target, elementId) {
            var url = "https://translate.googleapis.com/translate_a/single?client=gtx&sl=EN&tl=" + lang + "&dt=t&q=" + encodeURIComponent(text);
            $.get(url, function (data, status) {
                var result = data[0].map(item => item[0]).join('');
                document.getElementById(elementId).value = result;
            });
        }
        

        translate($("#txtSource").val(), lang, 'txtTarget');
        translate($("#govten").val(), lang, 'govtlocal');
        translate($("#dept").val(), lang, 'deptlocal');
        translate($("#hospitalname").val(), lang, 'hospitalnamelocal');
        translate($("#tahsildistrict").val(), lang, 'tahsildistrictlocal');
        translate($("#district").val(), lang, 'districtlocal');
        translate($("#registrar").val(), lang, 'registrarlocal');
        translate($("#reghospital").val(), lang, 'reghospitallocal');
        translate($("#lineone").val(), lang, 'lineonelocal');
       //
       
        translate($("#Top_Left").val(), lang, 'topledtlocal');
        translate($("#Top_Right").val(), lang, 'topformlocal');
        translate($("#Birth_Certificate").val(), lang, 'birthlanglocal');
        translate($("#namelocalE").val(), lang, 'namelocal');
        translate($("#genderlocalE").val(), lang, 'genderlocal');
        translate($("#doblocalE").val(), lang, 'doblocal');
        translate($("#poblocalE").val(), lang, 'poblocal');
        translate($("#mnamelocalE").val(), lang, 'mnamelocal');
        translate($("#fnamelocalE").val(), lang, 'fnamelocal');
        translate($("#birthaddresslocalE").val(), lang, 'birthaddresslocal');
        translate($("#permanentaddresslocalE").val(), lang, 'permanentaddresslocal');
        translate($("#regnolocalE").val(), lang, 'regnolocal');
        translate($("#regdatelocalE").val(), lang, 'regdatelocal');
        translate($("#remarkslocalE").val(), lang, 'remarkslocal');
        translate($("#doilocalE").val(), lang, 'doilocal');
        translate($("#ialocalE").val(), lang, 'ialocal');
        translate($("#lastlinelocalE").val(), lang, 'lastlinelocal');
        translate($("#aadharlocalE").val(), lang, 'aadharlocal');
        
    }

   

</script>



<img id="blah" style="display:none;">
<img id="blahs" style="display:none;">





   <!-- footer -->
            <!-- ============================================================== -->
            <footer class="footer text-center text-muted">
               
            </footer>
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- End Wrapper -->
    <!-- ============================================================== -->
    <!-- All Jquery -->
    <!-- ============================================================== -->
    <script src="../assets/libs/jquery/dist/jquery.min.js"></script>
    <script src="../assets/libs/popper.js/dist/umd/popper.min.js"></script>
    <script src="../assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- apps -->
    <!-- apps -->
    <script src="../dist/js/app-style-switcher.js"></script>
    <script src="../dist/js/feather.min.js"></script>
    <script src="../assets/libs/perfect-scrollbar/dist/perfect-scrollbar.jquery.min.js"></script>
    <script src="../dist/js/sidebarmenu.js"></script>
    <!--Custom JavaScript -->
    <script src="../dist/js/custom.min.js"></script>
    <!--This page JavaScript -->
    <script src="../assets/extra-libs/c3/d3.min.js"></script>
    <script src="../assets/extra-libs/c3/c3.min.js"></script>
    <script src="../assets/libs/chartist/dist/chartist.min.js"></script>
    <script src="../assets/libs/chartist-plugin-tooltips/dist/chartist-plugin-tooltip.min.js"></script>
    <script src="../assets/extra-libs/jvector/jquery-jvectormap-2.0.2.min.js"></script>
    <script src="../assets/extra-libs/jvector/jquery-jvectormap-world-mill-en.js"></script>
    <script src="../dist/js/pages/dashboards/dashboard1.min.js"></script>



		
		<script>
		document.addEventListener('contextmenu', event => event.preventDefault());
document.onkeydown = function(e) {
    if(e.keyCode == 123) {
     return false;
    }
    if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){
     return false;
    }
    if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){
     return false;
    }
    if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){
     return false;
    }

    if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)){
     return false;
    }      
 }
		</script>
	 
<!-- /disable right click and ctrl u-->




   <!-- footer -->
            <!-- ============================================================== -->
            <footer class="footer text-center text-muted">
               
            </footer>
            <!-- ============================================================== -->
            <!-- End footer -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Page wrapper  -->
        <!-- ============================================================== -->
    </div>
    <!-- /.content -->


</div>

</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Select2 -->
<script src="plugins/select2/js/select2.full.min.js"></script>

<!-- SweetAlert -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/8.11.8/sweetalert2.all.min.js"></script>

<!-- DataTables  & Plugins -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>

<script src="plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.colVis.min.js"></script>

<!-- ChartJS -->
<script src="plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="plugins/sparklines/sparkline.js"></script>
<!-- JQVMap -->
<script src="plugins/jqvmap/jquery.vmap.min.js"></script>
<script src="plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
<!-- jQuery Knob Chart -->
<script src="plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="plugins/moment/moment.min.js"></script>
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="dist/js/pages/dashboard.js"></script>

<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.3/jquery.validate.min.js" integrity="sha512-37T7leoNS06R80c8Ulq7cdCDU5MNQBwlYoy1TX/WUsLFC2eYNqtKlV0QjH7r8JpG/S0GUMZwebnVFLPd6SU5yg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.js" integrity="sha512-zlWWyZq71UMApAjih4WkaRpikgY9Bz1oXIW5G0fED4vk14JjGlQ1UmkGM392jEULP8jbNMiwLWdM8Z87Hu88Fw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script>
    function alertMessage(type, message) {
        if (type == 'error') {
            type = 'danger';
        }

        return "<div class='alert alert-" + type + " alert-dismissible'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a> " + message + " </div>";
    }
</script>
<script>
    function updateFields() {
    // Get the values of all dependent fields
    const state = document.getElementById('state').value.toUpperCase();
    let district = document.getElementById('district').value.toUpperCase();

    // Check if "Other" is selected and use the input value instead
    const otherDistrictInput = document.getElementById('otherDistrict');
    if (otherDistrictInput && otherDistrictInput.style.display === 'block' && otherDistrictInput.value.trim() !== '') {
        district = otherDistrictInput.value.toUpperCase();
    }

    const tahsilBlock = document.getElementById('tahsildistrict').value.toUpperCase();
    const hospitalName = document.getElementById('hospital').value.toUpperCase();

    // Update "Government Name" field
    const governmentField = document.getElementById('govten');
    governmentField.value = `GOVERNMENT OF ${state}`;

    // Update "Line no. 1" field
    const lineOneField = document.getElementById('lineone');
    lineOneField.value = `(ISSUED UNDER SECTION 12/17 OF THE REGISTRATION OF BIRTHS & DEATHS ACT, 1969 AND RULE 8/13 OF THE ${state} REGISTRATION OF BIRTHS & DEATHS RULES 1999.)`;

    // Update "Line no. 2" field
    const lineTwoField = document.getElementById('linetwo');
    lineTwoField.value = `THIS IS TO CERTIFY THAT THE FOLLOWING INFORMATION HAS BEEN TAKEN FROM THE ORIGINAL RECORD OF BIRTH WHICH IS THE REGISTER FOR ${hospitalName || "[HOSPITAL NAME]"} OF TAHSIL/BLOCK ${tahsilBlock || "TAHSIL/BLOCK"} OF DISTRICT ${district || "DISTRICT"} OF STATE/UNION TERRITORY ${state || "STATE"}, INDIA.`;

    // Auto-fill related hospital fields
    if (hospitalName) {
        document.getElementById("hospitalname").value = hospitalName;
        document.getElementById("reghospital").value = hospitalName;
    }
}

// Add event listeners to all fields to trigger updates
document.getElementById('state').addEventListener('change', updateFields);
document.getElementById('district').addEventListener('change', updateFields);
document.getElementById('tahsildistrict').addEventListener('input', updateFields);
document.getElementById('hospital').addEventListener('input', updateFields);

// Additional listener for "Other" district input
const districtDropdown = document.getElementById('district');
districtDropdown.addEventListener('change', function () {
    const otherDistrictInput = document.getElementById('otherDistrict');
    if (this.value === 'other' && otherDistrictInput) {
        otherDistrictInput.style.display = 'block';
        otherDistrictInput.addEventListener('input', updateFields);
    } else if (otherDistrictInput) {
        otherDistrictInput.style.display = 'none';
        otherDistrictInput.value = '';
        updateFields(); // Update fields when switching back from "Other"
    }
});

</script>

</body>

</html>