<?php $this->load->view('theme/include/header'); ?>
<!--Statt Main Content-->
<section>
<div class="main-content">
<div class="row">
<div class="inner-contatier">    
<div class="col-md-12 col-lg-12 col-sm-12 content-title"><h4>Change Logo</h4></div>
<?php
$message = $this->session->userdata('success');
if($message){?>
<!-- Alert Box -->
<div class="alert my-alert alert-success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success! </strong><?php echo $message; ?>
</div>
<?php
}else{
  $message = $this->session->userdata('error');
  if($message){
  ?>
 <!-- Alert Box -->
<div class="alert my-alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Alert! </strong><?php echo $message; ?>
</div>
<?php
  }
}
if(isset($error)) {
?>
<!-- Alert Box //validation error -->
<div class="alert my-alert alert-danger">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<?php echo $error; ?>
</div>
<?php } ?>

<div class="col-md-3 col-sm-3 col-lg-3">
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">Change Logo - PNG</div>
<div class="panel-body"> 

<form enctype="multipart/form-data" id="upload-photo" method="post" action="<?php echo site_url('Settings/uploadLogo') ?>">
<div class="form-group">

<img src="<?php echo base_url() ?>assets/images/logo.png" class="setting-logo"/>

<input type="file" name="logo" style="visibility:hidden; height:0px" id="logo" />
<input type="button" class="btn btn-info" id="clickme" value="Select PNG Image" /> 
</div>

<button type="submit"  class="mybtn btn-submit btn-block" ><i class="fa fa-upload"></i> Upload</button>
</form>
</div>   
</div>      
    
</div>  
    

</div><!--End Inner container--->
</div><!--End Row-->
</div><!--End Main-content DIV-->
</section><!--End Main-content Section-->

<?php $this->load->view('theme/include/footer'); ?>

<script type="text/javascript">
$(document).ready(function() {
 
$('#clickme').click(function(){
 $('#logo').click();     
 });
    
$('#logo').change(function () {
    readURL(this);
});   
    
function readURL(input) {

    if (input.files && input.files[0]) {
        var reader = new FileReader();

        reader.onload = function (e) {
            $('.setting-logo').attr('src', e.target.result);
        }

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

    
});

</script>
</body>

</html>
