HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /var/www/html/taxicamera/old/applicationold/views/admin/banner/edit.php
<!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
    <section class="content-header">
      <h1> Edit Banner </h1>
    </section>
    <section class="content">
      <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
          <div class="box box-primary">
          <form role="form" action="" class="" method="post" id="form_area" enctype="multipart/form-data" autocomplete="off">
              <div class="box-body">
              
                
                <?php if($this->session->flashdata('success_msg')):?>
                  <div class="alert alert-success">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
                    <?php echo $this->session->flashdata('success_msg')?>
                  </div>
                <?php endif?>
                <?php if($this->session->flashdata('error_msg')):?>
                  <div class="alert alert-danger">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
                    <?php echo $this->session->flashdata('error_msg')?>
                  </div>
                <?php endif?>

                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                <div class="form-group">
                <label>Name</label>
                    <input type="text" class="form-control" name="banner_name" id="banner_name" placeholder="Name" value="<?php echo $banner['banner_name'];?>">
                  </div>
                  <?php echo form_error('banner_name', '<div class="error">', '</div>'); ?>
                </div> 
                
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                  <div class="form-group">
                    <label for="imgInp">Choose Banner Picture </label>
                    <input type="file" id="imgInp" name="imgInp"> 
                    <?php if(!empty($banner['banner_image'])):?>
                      <img src="<?php echo base_url()?>uploads/banner/<?php echo $banner['banner_image']?>" width="300px">
                    <?php endif?>  
                    <?php echo form_error('imgInp', '<div class="error">', '</div>'); ?>                 
                  </div>
                  
                </div>
                <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                  <button class="btn btn-success btn-md" type="submit">Update</button>
                  <a href="../" class="btn btn-danger btn-md" type="button">Cancel</a>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </section>
  </div>
<script src="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>
<script>
// function readURL(input) {
//     if (input.files && input.files[0]) {
//         var reader = new FileReader();

//         reader.onload = function (e) {
//             $('#blah').attr('src', e.target.result);
//         }

//         reader.readAsDataURL(input.files[0]);
//     }
// }

// $("#imgInp").change(function(){
//     readURL(this);
// });
// CKEDITOR.replace('description');
// CKEDITOR.replace('content');



$( document ).ready(function() {
    get_countries();
    get_states(<?=$banner['country_id'];?>);
    get_role();
});

function get_countries(){	
	$.ajax({
		url: "<?php echo base_url('admin/banner/ajax_countryList');?>",
		type: "POST",			
		data:  {'country_id':<?=$banner['country_id'];?>},
		dataType: "html",
		success:function(result){
			$('#country_id').html(result);
		}
	});		
}

$('#country_id').on('change',function(){
  get_states(this.value);
})

function get_states(country_id){		
	$.ajax({
		url: "<?php echo base_url('admin/banner/ajax_stateList');?>",
		type: "POST",			
		data:  {'country_id':country_id,'state_id':<?=$banner['state_id'];?>},
		dataType: "html",
		success:function(result){
			$('#state_id').html(result);	
		}
	});		
}

function get_role(){	
	$.ajax({
		url: "<?php echo base_url('admin/banner/ajax_role_list');?>",
		type: "POST",			
		data:  {'role_id':<?=$banner['role_id'];?>},
		dataType: "html",
		success:function(result){
			$('#role_id').html(result);
		}
	});
}

</script>

<script>
$(document).ready(function () {
    //called when key is pressed in textbox
        $(".number_validation").keypress(function (event) {
            return validateFloatKeyPress(this,event);
        });
    }); 

    function validateFloatKeyPress(el, evt) {
      var charCode = (evt.which) ? evt.which : event.keyCode;
      var number = el.value.split('.');
      //alert(charCode);alert(number);
        if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
            return false;
        }

        //just one dot (thanks ddlab)
        if(number.length>1 && charCode == 46){
            return false;
        }

        //get the carat position
        var caratPos = getSelectionStart(el);
        var dotPos = el.value.indexOf(".");
        if( caratPos > dotPos && dotPos>-1 && (number[1].length > 1)){
            return false;
        }

        return true;
    }


    function getSelectionStart(o) {
      if (o.createTextRange) {
        var r = document.selection.createRange().duplicate()
          r.moveEnd('character', o.value.length)
          if (r.text == '') return o.value.length
          return o.value.lastIndexOf(r.text)
      } 
      else return o.selectionStart
    }
</script>