<?php $this->load->view("top"); ?>
<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-9 col-md-push-3">
                <div class="right_side">
                    <h1>Edit Profile</h1>
                    <div class="wps_right">
                        <div class="row">
                            <?php  echo form_open('', 'class=""');
            error_message(); ?>
                            <div class="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">
                                <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 />
                                <label class="form-label">Mobile Number *</label>
                                </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-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">
                                  <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 />
                                   <label class="form-label">Mobile Number *</label>
                                </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>
                            <?php echo form_close(); ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-md-pull-9">
                <?php $this->load->view('members/left'); ?>
            </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"); ?>
