<link rel="stylesheet" href="<?php echo base_url();?>assets/js/validationEngine.jquery.css" type="text/css" />
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/cust_paginition.css" type="text/css" />
<div class="" id="addSub">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal heading -->
<div class="modal-header">
    <a class="btn  pull-right mar" href="<?php echo base_url(); ?>index.php/subscriber/subscriber_list"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> </a>
    <h3 class="modal-title" align="left">Update language Details</h3>
</div>
<!-- // Modal heading END -->
<!-- Modal body -->
<div class="modal-body">
<div class="innerAll">
<div class="innerLR">
<form class="form-horizontal" role="form" id = "add_subscriber" action="<?php echo base_url(); ?>index.php/language/edit_lang" method = "post" enctype="multipart/form-data">
<?php $this->load->view('admin/flashdata_admin'); ?>
    <div id="errorMsg" style="text-align: center"></div>
<div class = "form-group mmar" id="give_msgs" style="text-align: center"></div>
<div class="form-group mmar">
    <label  class="col-sm-3 control-label text-left">Name: </label>
    <div class="col-sm-9">
        <input type="text" class="form-control validate[required, maxSize[100], custom[onlyLetterSp]] text-input" name = "name" id="name" value="<?php echo $arrData['name'];?>"/>
    </div>


</div>
<div class="form-group">
    <div class="col-sm-offset-4 col-sm-8">
        <input type="hidden" name="lang_id" value="<?php echo $strAgentId; ?>" />
        <button type="submit" class="btn btn-primary" id="submit_sub">Submit</button>
        <a class="btn" href="<?php echo base_url(); ?>index.php/agent/agent_listing"> <button type="button" class="btn btn-primary" >Cancel</button></a>
    </div>
</div>
</form>
</div>
</div>
</div>
<!-- // Modal body END -->
</div>
</div>
</div>
<script src="<?php echo base_url();?>assets/js/main.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/custom.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine.js" type="text/javascript"></script>
<script>
    $(document).ready(function() {
        $("#add_subscriber").validationEngine();
        $("#submit_sub").click(function(){
            var strLangName = $("#name").val();
            var count = 0;
            $.ajax({
                url:"<?php echo base_url(); ?>index.php/language/fnCheckGivenLanguage",
                'data' : {
                    'language_name' :strLangName
                },
                'type' : 'GET',
                async: false,
                success:function(result){
                    if (result > 0) {
                        var msg = "<p style='color: red'>Language Name already exists</p>"
                        $("#errorMsg").html(msg);
                        count = 1;
                    }


                }
            });

            if (count > 0) {
                return false;
            }
        });
    });
</script>