ok

Mini Shell

Direktori : /home2/selectio/www/subamangala/admin/modal/
Upload File :
Current File : /home2/selectio/www/subamangala/admin/modal/subcaste-create.php

<?php include "../config/config.php"; ?> 
<style>
.modal-open .modal {
    overflow-x: hidden;
    overflow-y: hidden;
}
</style>
<div class="modal-dialog modal-lg" role="document" id="add_modal" style="overflow-x: hidden; overflow-y: hidden;">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title mt-0" id="myLargeModalLabel"><b>Create Sub Caste Details</b></h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top: -25px;"><i class="fa fa-times"></i></button>
            </div>
            
            <form id="add_form" method="post">
            <div id="content-div">
            
            
            <div class="modal-body" style="padding: 20px 40px 20px 40px;">
                
                    <div class="form-group">
                        <label>Choose Caste</label>
                        <select name="caste_id" class="form-control tip select2" id="caste_id" required>
                            <option value="">All Subcaste</option>
                            <?php $statement = $pdo->prepare("SELECT * FROM `caste` GROUP BY caste.name");
                                $statement->execute();
                                $results = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                foreach ($results as $result) { ?>
                                  <option value="<?=$result['id']?>"><?=$result['name']?></option>
                            <?php } ?>
                        </select>
                    </div>
                    <div class="form-group">
                        <label>Caste</label>
                        <input type="text" name="sub_caste_name" id="sub_caste_name" class="form-control tamil" charset="utf-8" required>
                    </div>
                   
            </div>
            
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">Submit</button>
            </div>
            
            
            </div>
            </form>
            
            
            
            <div id="loading-div" style="display: none; padding-bottom: 80px;">
                    <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center>
            </div>
            
            
            
        </div>
    </div>
<script language=JavaScript src="tamil/utf.js"> </SCRIPT>
<SCRIPT language=JavaScript src="tamil/tamil.js"></SCRIPT>
	<script>
			$(document).ready(function(){
				$('input,textarea').on('keydown',function(event){
					if(event.which==121){
						$(this).toggleClass('tamil');
						return false;
					}
					if($(this).hasClass('tamil')){
						toggleKBMode(event);
					}else{
						return true;
					}
				});
				$('input,textarea').on('keypress',function(event){
					if($(this).hasClass('tamil')){
						convertThis(event);
					}
				});
			});
		</script>
<script>
    $('#add_form').on('submit', function(e){
      //  console.log("Click And Form Working");
                e.preventDefault();
                $('#loading-div').show();
                $('#content-div').hide();
                var formData = new FormData(this);
                formData.append('type', 'create_sub_caste');
                            $.ajax({
                            url: 'apis/subamangala-matrimony.php',
                            type: 'post',
                            dataType: 'json',
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            enctype: 'multipart/form-data',
                            success: function (response) {
                                if(response['status']==200){
                                     alert(response['message']);
                                     $("#add_modal .close").click();
                                     $('#add_form').trigger("reset");
                                     emp_datas();
                                     $('#loading-div').hide();
                                     $('#content-div').show();
                                }else{
                                    alert(response['message']);
                                    $('#loading-div').hide();
                                    $('#content-div').show();
                                }
                                
                               
                            }
                        });
                
    });
</script>

Zerion Mini Shell 1.0