<?php defined('BASEPATH') OR exit('No direct script access allowed');?>
<!-- new admin data -->
<div class="container">
    <div class="row">
        <div class="col-12 text-center mt-3 " style="border-bottom:1px solid #d9d9d9;">
            <h3 class="pink"><?php echo display('member_area'); ?></h3>
        </div>
    </div>
</div>
<div class="container display-table">
    <div class="row display-table-row">
        <div class="col-md-2 col-sm-1 hidden-xs display-table-cell v-align box" id="navigation">
            <?php
$this->load->view('web/customer/include/customer_menu');
?>
            <!-- <div class="logo text-center">
                <img src="<?php echo base_url('my-assets/image/user_image/sample1.png'); ?>" class="img-fluid">

              <p><?php if ($customerDetails['first_name']) {echo html_escape($customerDetails['first_name']) . ' ' . html_escape($customerDetails['last_name']);}?></p>
            </div>
            <div class="navi">
                <ul>

                    <li class="active">
                        <a href="<?php echo base_url('customer/order_record'); ?>">
                            <span class="hidden-xs hidden-sm">訂單記錄</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="<?php echo base_url('customer/wish_list'); ?>">
                            <span class="hidden-xs hidden-sm">喜愛清單</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="<?php echo base_url('customer/shop_cart'); ?>">
                            <span class="hidden-xs hidden-sm">購物車</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="<?php echo base_url('customer/fun_shop'); ?>">
                            <span class="hidden-xs hidden-sm">積分商城</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="<?php echo base_url('customer/cust_info'); ?>">
                            <span class="hidden-xs hidden-sm">帳戶資料</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="<?php echo base_url('customer/delivery_address'); ?>">
                            <span class="hidden-xs hidden-sm">送貨地址</span>
                        </a>
                    </li>
                    <li class="active">
                        <a href="<?php echo base_url('logout'); ?>">
                            <span class="hidden-xs hidden-sm">登出</span>
                        </a>
                    </li>
                </ul>
            </div> -->
            <!-- <p>member area</p> -->
        </div>
        <!-- end column 2 -->

        <!-- inner column -->
        <div class="col-12 col-md-10" >
            <div class="container">
                <div class="row">
                    <div class="col-12 pt-5">
                        <!-- alert message -->
        <?php
$message = $this->session->userdata('message');
if (isset($message)) {
	?>
        <div class="alert alert-info alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <?php echo $message ?>
        </div>
        <?php
$this->session->unset_userdata('message');
}
$error_message = $this->session->userdata('error_message');
if (isset($error_message)) {
	?>
        <div class="alert alert-danger alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <?php echo $error_message ?>
        </div>
        <?php
$this->session->unset_userdata('error_message');
}
?>
                     <!--end alert message -->
                     <?php //var_dump($customerinfo);?>
                     <h4><?php echo display('customer_edit'); ?> </h4>

                     <!-- billing address -->
                      <?php echo form_open_multipart('customer/customer_delivery_address_update', array('class' => 'form-vertical', 'id' => 'validate')) ?>



                        <h3><?php echo display('billing_address'); ?></h3>
                        <div class="col-12">
                            <!-- customer billing address -->
                            <input type="hidden" value="{customer_id}" name="customer_id">
                        <div class="form-group row">
                            <label for="customer_address_1 " class="col-sm-3 col-form-label"><?php echo display('customer_address_1') ?></label>
                            <div class="col-sm-6">
                                <textarea class="form-control" name="customer_address_1" id="customer_address_1 " rows="3" placeholder="<?php echo display('customer_address_1') ?>"><?php echo $customerinfo[0]['customer_address_1']; ?></textarea>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="customer_address_2 " class="col-sm-3 col-form-label"><?php echo display('customer_address_2') ?></label>
                            <div class="col-sm-6">
                                <textarea class="form-control" name="customer_address_2" id="customer_address_2 " rows="3" placeholder="<?php echo display('customer_address_2') ?>"><?php echo $customerinfo[0]['customer_address_2']; ?></textarea>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="city " class="col-sm-3 col-form-label"><?php echo display('city') ?></label>
                            <div class="col-sm-6">
                                <input class="form-control" name ="city" id="city" type="text" placeholder="<?php echo display('city') ?>"  value="<?php echo $customerinfo[0]['city']; ?>">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="state " class="col-sm-3 col-form-label"><?php echo display('state') ?></label>
                            <div class="col-sm-6">
                                <select class="form-control select2 width_100p" id="state" name="state">
                                    <option value=""><?php echo display('select_one') ?></option>
                                    <?php
if ($state_list) {
	foreach ($state_list as $state) {
		?>
                                    <option value="<?php echo html_escape($state->name) ?>" <?php if ($state->name == $customerinfo[0]['state']) {echo "selected";}?>><?php echo html_escape($state->name) ?></option>
                                    <?php
}
}
?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                             <label for="country " class="col-sm-3 col-form-label"><?php echo display('country') ?></label>
                             <div class="col-sm-6">
                                <select class="form-control select2 width_100p" id="country" name="country">

                                     <option value=""><?php echo display('select_one') ?></option>
                                    <?php
if ($selected_country_info) {
	foreach ($selected_country_info as $country) {
		?>
                                    <option value="<?php echo html_escape($country->id) ?>" <?php if ($country->id == $customerinfo[0]['country']) {echo "selected";}?>><?php echo html_escape($country->name) ?></option>
                                    <?php
}
}
?>


                                     </select>
                                 </div>
                        </div>

                        <div class="form-group row">
                            <label for="zip " class="col-12 col-md-3 col-form-label"><?php echo display('zip') ?></label>
                            <div class="col-12 col-md-6">
                                <input class="form-control" name ="zip" id="zip" type="text" placeholder="<?php echo display('zip') ?>" value="<?php echo $customerinfo[0]['zip']; ?>">
                            </div>
                        </div>

                        <div class="form-group row">
                        <!--     <label for="example-text-input" class="col-sm-4 col-form-label"></label> -->
                            <div class="col-sm-9 text-center">
                                <input type="submit" id="add-Customer" class="btn btn-block checkoutbtn" name="add-Customer" value="<?php echo display('save_changes') ?>" />
                            </div>
                        </div>
                     <!-- end billing address -->








                    </div>
                    <?php echo form_close() ?>
                </div>
            </div>
        </div>
        <!-- end inner column -->
    </div>
</div>
</div>
<!-- end new admin data -->

<script src="<?php echo MOD_URL . 'dashboard/assets/js/edit_customer_form.js'; ?>"></script>
