<?php
$this->load->view ( $left );
$this->load->view ( $header );
?>
<style type="text/css">
    .ibox-content {
        border-style : none;
    }
</style>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2><?php echo ($user_id == 0) ? 'New Contact' : 'Edit Contact';?></h2>
    </div>
</div>
<div class="wrapper wrapper-content">
    <div class="row text-center animated fadeInRightBig">
    	<div class="col-lg-12">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active userdata" data-tab-id="1"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> This is tab</a></li>
                    <!-- <li class="userdata" data-tab-id="2"><a data-toggle="tab" href="#tab-2" aria-expanded="false">This is second tab</a></li>
                    <li class="userdata" data-tab-id="3"><a data-toggle="tab" href="#tab-3" aria-expanded="false">This is 3rd tab</a></li> -->
                </ul>
                <div class="tab-content">
                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body">
                            
                        </div>
                    </div>
                   <!--  <div id="tab-2" class="tab-pane">
                        <div class="panel-body">
                            
                        </div>
                    </div>
                    <div id="tab-3" class="tab-pane">
                        <div class="panel-body">
                            
                        </div>
                    </div> -->
                </div>
            </div>   
        </div>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function(){ 
        var activeTab = 1;
        loadUserForm(activeTab);

        $('.userdata').on('click',function(){
            activeTab = $(this).data('tab-id');
            loadUserForm(activeTab);
        });
    });

    function loadUserForm(activeTab){
        var url = "<?php echo site_url('user/user_basic_info');?>";
        // switch(activeTab) {
        //     case 1:
        //         url = "<?php //echo site_url('user/user_basic_info');?>";
        //         break;
        //     // case 2:
        //     //     url = "<?php //echo site_url('user/user_billing_info');?>";
        //     //     break;
        //     // case 3:
        //     //     url = "<?php //echo site_url('user/user_shipping_info');?>";
        //     //     break;
        //     default:
        //         url = "<?php //echo site_url('user/user_basic_info');?>";
        //         break;
        // }
        $.ajax({
            url: url,
            type: "POST",
            data:{'user_id' : '<?php echo $user_id;?>'},
            success: function(response){ 
                $('#tab-'+activeTab+' > .panel-body').html(response);
            }
        });
    }
</script>
<?php $this->load->view($footer); ?>
