<ul class="breadcrumb">
    <li><a href="<?= site_url('admin/dashboard') ?>">Home</a></li> 
    <li class="active"><?php echo isset($city_id) ? $breadcum_edit : $breadcum ?></li> 
</ul>
<div class="page-content-wrap">
    <div class="row">
        <div class="col-md-12">
            <form action="" class="form-horizontal" method="post" enctype="multipart/form-data">                 
                <div class="panel panel-default">
                    <div class="panel-heading">                       
                        <h3 class="panel-title"><?php if($city_id){ ?>Edit<?php } else { ?> Add<?php } ?> City</h3>
                        <ul class="panel-controls">
                            <li><a href="<?php echo site_url()?>admin/city-list"><span class="fa fa-backward" title="Back"></span></a></li>
                        </ul>
                    </div>
                  
                    <div class="panel-body form-group-separated">
                        
                          
                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">Country *</label>
                            <div class="col-md-6 col-xs-12">                                                                                            
                                <select class="form-control select" data-live-search="true" name="country_id" id="country_id">  
                                    <option value="">Select Country</option>
                                     <?php foreach ($country_list as $country) { ?>
                                    <option value="<?= $country['ct_id']?>"<?php if($country['ct_id']== $country_id) { ?> selected="selected" <?php }?>><?= $country['country_name']?></option>  
                                     <?php }?>
                                </select>
                                 <span class="help-block" style="color: red;"><?= strip_tags(form_error('country_id'))?></span>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">Region *</label>
                            <div class="col-md-6 col-xs-12">                                                                                            
                                <select class="form-control select" data-live-search="true" name="region_id" id="region"> 
			            <option value="">Select Country First</option>
                                     <?php if(isset($city_id)) {?>
                                     <?php foreach ($region_list as $region) { ?>
                                    <option value="<?= $region['region_id']?>"<?php if($region['region_id']== $region_id) { ?> selected="selected" <?php }?>><?= $region['region_name']?></option>  
                                     <?php }}?>
                                </select>
                                <span class="help-block" style="color: red;"><?= strip_tags(form_error('region_id'))?></span>
                            </div>
                        </div>
                      
                         <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">City *</label>
                            <div class="col-md-6 col-xs-12">                                            
                                <div class="input-group">
                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                    <input type="text" name="city_name" class="form-control" value="<?php echo $city_name ?>"/>
                                </div>                                            
                                <span class="help-block" style="color: red;"><?= strip_tags(form_error('city_name'))?></span>
                            </div>
                        </div>

                         <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">Meta Title</label>
                            <div class="col-md-6 col-xs-12">                                            
                                <div class="input-group">
                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                    <input type="text" name="meta_title" class="form-control" value="<?php echo $meta_title ?>"/>
                                </div>                                            
                             
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">Meta Keywords</label>
                            <div class="col-md-9 col-xs-12">                                            
                                <textarea class="form-control ckeditor" name="meta_keywords"><?= $meta_keywords ?></textarea>
                                                       
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-md-3 col-xs-12 control-label">Meta Description</label>
                            <div class="col-md-9 col-xs-12">                                            
                                <textarea class="form-control ckeditor" name="meta_description"><?= $meta_description ?></textarea>                                                       
                            </div>
                        </div>
                      
                     

                    </div>
                    <div class="panel-footer">
                        <button class="btn btn-default" type="reset">Clear Form</button>                                    
                        <button class="btn btn-primary pull-right">Submit</button>
                    </div>
                </div>
            </form>

        </div>
    </div> 
</div>
<script>
       function readURL(input) {
                                        if (input.files && input.files[0]) {
                                            var reader = new FileReader();
                                            //alert(input.id);
                                            reader.onload = function(e) {
                                                $('#' + input.id + '_preview').attr('src', e.target.result);
                                            }
                                            reader.readAsDataURL(input.files[0]);
                                        }
                                    }
                                    
</script>
<script type='text/javascript' src='<?= $this->config->item('adminassets'); ?>js/location.js'></script>