<?php $this->load->view("top"); ?>
 <div class="clearfix"></div>
  <section class="banner_category" style="background-image: url('<?php echo theme_url();?>images/listing-banner.jpg');">
    <div class="container">
     
      <h1 class="banner_title">Edit Profile</h1>
    </div>
  </section>
<div class="page_breadcrumbs">
    <div class="container">
        <ul>
            <li><a href="<?= site_url(); ?>" title="Home">Home</a>
            </li>
            <li>Edit Profile</li>
        </ul>
    </div>
</div>
<section class="my_account_page">
    <div class="container">
        <div class="row">
            <div class="col-md-3">
                <?php $this->load->view('members/left'); ?>
            </div>
            <div class="col-md-9">
                <div class="right_side">
                    <h1>Edit Profile</h1>
                    <div class="wps_right">
                        
                            <?php  echo form_open('', 'class=""');
            echo error_message(); echo validation_message(); ?>
                        <?php if ($this->session->flashdata('success')) echo '
          <div class="alert alert-success success" style="padding: 8px 8px 8px 40px;">' . $this->session->flashdata('success') . '</div>
          <br/>'; ?>
                       
                        <div class="row">
                            <div class="col-lg-6 col-sm-6">
                                <h3>Shipping Address<br /></h3>
                                <div class="cb40"></div>
                                <div class="form-group">
                                    <input type="text" name="ship_name" value="<?php echo ($mres1['name']) ? $mres1['name'] : $mres['first_name']; ?>" class="form-control" required />
                                    <label class="form-label">Name *</label>
                                </div>
                                <div class="form-group">
                                <label class="form-label relative">Mobile Number *</label>
                                <input type="tel" pattern="[1-9]{1}[0-9]{9}" maxlength="10" minlength="10" name="ship_mobile" value="<?php echo ($mres1['mobile']) ? $mres1['mobile'] : $mres['mobile_number']; ?>" class="form-control" required />
                                </div>
                                
                                <div class="form-group">
                                <textarea name="ship_address" cols="1" rows="3" class="form-control" required><?php echo $mres1['address']; ?></textarea>
                                <label class="form-label">Address *</label>
                                </div>
                                
                                <div class="form-group">
                                <input type="text" name="ship_lmark" value="<?php echo $mres1['landmark']; ?>" class="form-control" required/>
                                <label class="form-label">Landmark *</label>
                                </div>
                                
                                <div class="form-group">
                                <input type="text" name="ship_city" value="<?php echo $mres1['city']; ?>" class="form-control" required />
                                <label class="form-label">City *</label>
                                </div>
                                 <div class="form-group">
                                 <input type="text" name="ship_pin" value="<?php echo $mres1['zipcode']; ?>" class="form-control" required />
                                 <label class="form-label">Pincode *</label>
                                </div>
                                 <div class="form-group">
                                 <input type="text" name="ship_state" value="<?php echo $mres1['state']; ?>" class="form-control" required />
                                 <label class="form-label">State *</label>
                                </div>
                                 <div class="form-group">
                                 <?php echo CountrySelectBox(array("name" => "ship_country", 'current_selected_val' => $mres1['country'], "format" => 'class="form-control" required')); ?>
                                 <!--<label class="form-label">Country *</label>-->
                                </div>
                                 
                                <button class="edit_save_btn" type="submit">Save</button>
                            </div>
                            <div class="col-lg-6 col-sm-6">
                                <h3>Billing Address</h3>
                                <div class="checkbox-same">
                                    <label>
                                        <input id="check_add" class="" name="check_add" onClick="Check_Bill_Ship(this.form);" value="Y" type="checkbox"> Same as Shipping address
                                    </label>
                                </div>
                                    
                                    
                                   
                              
                    
                                <div class="form-group">
                                  <input type="text" name="bil_name" value="<?php echo ($mres1['bil_name']) ? $mres1['bil_name'] : $mres['first_name']; ?>" class="form-control" required />
                                   <label class="form-label">Name *</label>
                                </div>
                                <div class="form-group">
                                <label class="form-label relative">Mobile Number *</label>
                                  <input type="tel" pattern="[1-9]{1}[0-9]{9}" maxlength="10" minlength="10" name="bil_mobile" value="<?php echo ($mres1['bil_mobile']) ? $mres1['bil_mobile'] : $mres['mobile_number']; ?>" class="form-control" required />
                                </div>
                                <div class="form-group">
                                    <textarea name="bil_address" cols="1" rows="3" class="form-control unicase-form-control" required><?php echo $mres1['bil_address']; ?></textarea>
                                   <label class="form-label">Address *</label>
                                </div>
                                <div class="form-group">
                                  <input type="text" name="bil_lmark" value="<?php echo $mres1['bil_landmark']; ?>" class="form-control" />
                                   <label class="form-label">Landmark *</label>
                                </div>
                                <div class="form-group">
                                  <input type="text" name="bil_city" value="<?php echo $mres1['bil_city']; ?>" class="form-control" required />
                                   <label class="form-label">City *</label>
                                </div>
                                <div class="form-group">
                                  <input type="text" name="bil_pin" value="<?php echo $mres1['bil_zipcode']; ?>" class="form-control" required />
                                   <label class="form-label">Pincode *</label>
                                </div>
                                <div class="form-group">
                                   <input type="text" name="bil_state" value="<?php echo $mres1['bil_state']; ?>" class="form-control" required />
                                   <label class="form-label">State *</label>
                                </div>
                                <div class="form-group">
                                  <?php echo CountrySelectBox(array("name" => "bil_country", 'current_selected_val' => $mres1['bil_country'], "format" => 'class="form-control unicase-form-control text-input" required')); ?>
                                   <!--<label class="form-label">Country *</label>-->
                                </div>
                            </div>
                        </div>
                        
                        <?php echo form_close(); ?>
                        
                    </div>
                </div>
            </div>
            
        </div>
    </div>
</section>


<script type="text/javascript">
    function Check_Bill_Ship(chk) {
        if (chk.check_add.checked == 1) {
            //chk.bmtitle.value = chk.mtitle.value;
            chk.bil_name.value = chk.ship_name.value;
            chk.bil_mobile.value = chk.ship_mobile.value;
            chk.bil_address.value = chk.ship_address.value;
            chk.bil_lmark.value = chk.ship_lmark.value;
            chk.bil_city.value = chk.ship_city.value;
            chk.bil_pin.value = chk.ship_pin.value;
            chk.bil_state.value = chk.ship_state.value;
            chk.bil_country.value = chk.ship_country.options[chk.ship_country.selectedIndex].value;
        }
        if (chk.check_add.checked == 0) {
            //chk.bmtitle.value = '';
            chk.bil_name.value = '';
            chk.bil_mobile.value = '';
            chk.bil_address.value = '';
            chk.bil_lmark.value = '';
            chk.bil_city.value = '';
            chk.bil_pin.value = '';
            chk.bil_state.value = '';
            chk.bil_country.value = chk.ship_country.options[0].value;
        }
    }

</script>
<?php $this->load->view("bottom"); ?>
