<?php $this->view("includes/Inc_pagehead");?>
<!-- Page Styles Goes Here-->

<?php $this->view("includes/Inc_navigation");?>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
  <!-- BEGIN: Subheader -->
  <div class="m-subheader ">
    <div class="d-flex align-items-center">
      <div class="mr-auto">
        <h3 class="m-subheader__title m-subheader__title--separator">
          Customer Profile
        </h3>
        <ul class="m-subheader__breadcrumbs m-nav m-nav--inline">
          <li class="m-nav__item m-nav__item--home">
            <a href="#" class="m-nav__link m-nav__link--icon">
              <i class="m-nav__link-icon la la-home"></i>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo $this->session->userdata("dashboard_link")?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Home
              </span>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo base_url().'customer/profile/'.$customer_data->customer_id ?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Customer Profile
              </span>
            </a>
          </li>


        </ul>
      </div>
      <div>

      </div>
    </div>
  </div>
  <!-- END: Subheader -->
  <div class="m-content">

    <div class="row">
      <div class="col-xl-3 col-lg-4">
        <div class="m-portlet m-portlet--full-height  ">

          <div class="m-portlet__body" style="padding-top: 0px">
            <div class="m-card-profile">
              <div class="m-card-profile__title m--hide">
                Customer Profile
              </div>
              <div class="m-card-profile__pic">
                <div class="m-card-profile__pic-wrapper">
                  <img src="<?php echo base_url()?>/template/assets/app/media/img/users/user.png" alt=""/>
                </div>
              </div>
              <div class="m-card-profile__details">
                <span class="m-card-profile__name">
                  #<?php echo $customer_data->customer_id?>
                  <br/><?php echo $customer_data->customer_name?>
                </span>
                <br>

              </div>

              <div class="m-card-profile__details">
                <span class="m-card-profile__name">

                </span>
              </div>
              <br/>
            </div>
            <ul class="m-nav m-nav--hover-bg m-portlet-fit--sides">
              <li class="m-nav__separator m-nav__separator--fit" style="margin-top: 0px"></li>
              <li class="m-nav__section m--hide">
                <span class="m-nav__section-text">
                  Section
                </span>
              </li>
              <li class="m-nav__item profile_nav" id="nav_info" data-nav="info" data-table-name=''>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-info-circle"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Customer Info
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_enquiries" data-nav="enquiries" data-table-name='enquiries_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-edit"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Enquiries
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_responses" data-nav="responses" data-table-name='enquiry_response_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-comments"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Responses
                      </span>
                    </span>
                  </span>
                </a>
              </li>
              <li class="m-nav__item profile_nav" id="nav_followups" data-nav="followups" data-table-name='enquiry_followups_view_table'>
                <a href="javascript:;" class="m-nav__link">
                  <i class="m-nav__link-icon fa fa-bell"></i>
                  <span class="m-nav__link-title">
                    <span class="m-nav__link-wrap">
                      <span class="m-nav__link-text">
                        Followups
                      </span>
                    </span>
                  </span>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="col-xl-9 col-lg-8">
        <div id="div_info" class="profile_nav_div">
          <div class="m-portlet">
            <div class="m-portlet__head">
              <div class="m-portlet__head-caption">
                <div class="m-portlet__head-title">
                  <h3 class="m-portlet__head-text">
                    Customer Info
                  </h3>
                </div>
              </div>
            </div>
            <div class="m-portlet__body">
              <form autocomplete="off" class="m-form m-form--fit m-form--label-align-right">
                <div class="m-portlet__body">
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Customer ID
                    </label>
                    <div class="col-xl-7 col-lg-7">
                      <div class="input-group m-input-group--air">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-hashtag"></i>
                          </span>
                        </div>
                        <input disabled type="text" class="form-control m-input m-input--solid" value="<?php echo $customer_data->customer_id?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Customer/Company Name
                    </label>
                    <div class="col-xl-7 col-lg-7">
                      <div class="input-group m-input-group--air">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-calendar-alt"></i>
                          </span>
                        </div>
                        <input disabled type="text" class="form-control m-input m-input--solid" value="<?php echo $customer_data->customer_name?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Contact Person
                    </label>
                    <div class="col-xl-7 col-lg-7">
                      <div class="input-group m-input-group--air">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-calendar-alt"></i>
                          </span>
                        </div>
                        <input disabled type="text" class="form-control m-input m-input--solid" value="<?php echo $customer_data->contact_person?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Place
                    </label>
                    <div class="col-xl-7 col-lg-7">
                      <div class="input-group m-input-group--air">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-toolbox"></i>
                          </span>
                        </div>
                        <input disabled type="text" class="form-control m-input m-input--solid" value="<?php echo $customer_data->customer_location?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Mobile
                    </label>
                    <div class="col-xl-7 col-lg-7">
                      <div class="input-group m-input-group--air">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-edit "></i>
                          </span>
                        </div>
                        <input disabled type="text" class="form-control m-input m-input--solid" value="<?php echo $customer_data->customer_phone?>">
                      </div>
                    </div>
                  </div>
                  <div class="form-group m-form__group row">
                    <label class="col-xl-3 col-lg-3 col-form-label">
                      Email
                    </label>
                    <div class="col-xl-7 col-lg-7">
                      <div class="input-group m-input-group--air">
                        <div class="input-group-prepend">
                          <span class="input-group-text">
                            <i class="fa fa-edit "></i>
                          </span>
                        </div>
                        <input disabled type="text" class="form-control m-input m-input--solid" value="<?php echo $customer_data->customer_email?>">
                      </div>
                    </div>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
        <div id="div_enquiries" class="profile_nav_div">
          <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
            <div class="m-portlet__head">
              <div class="m-portlet__head-caption">
                <div class="m-portlet__head-title">
                  <h3 class="m-portlet__head-text">
                    List of Enquiries
                  </h3>
                </div>
              </div>
              <div class="m-portlet__head-tools">
                <a href="#" data-toggle="modal" data-target="#enquiry_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Create New Enquiry
                    </span>
                  </span>
                </a>
              </div>
            </div>
            <div class="m-portlet__body">
              <!--begin: Datatable -->
              <?php $this->view("modules/include_tables/table_enquiries");?>
              <!--end: Datatable -->

              <!--end: Datatable -->
              <?php $this->view("modules/include_modals/modal_enquiries");?>
            </div>
          </div>
        </div>
        <div id="div_responses" class="profile_nav_div">
          <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
            <div class="m-portlet__head">
              <div class="m-portlet__head-caption">
                <div class="m-portlet__head-title">
                  <h3 class="m-portlet__head-text">
                    List of Responses
                  </h3>
                </div>
              </div>
              <div class="m-portlet__head-tools">
                <a href="#" data-toggle="modal" data-target="#enquiry_response_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Create New Response
                    </span>
                  </span>
                </a>
              </div>
            </div>
            <div class="m-portlet__body">
              <!--begin: Datatable -->
              <?php $this->view("modules/include_tables/table_enquiry_responses");?>
              <!--end: Datatable -->

              <!--end: Datatable -->
              <?php $this->view("modules/include_modals/modal_enquiry_responses");?>
            </div>
          </div>
        </div>
        <div id="div_followups" class="profile_nav_div">
          <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
            <div class="m-portlet__head">
              <div class="m-portlet__head-caption">
                <div class="m-portlet__head-title">
                  <h3 class="m-portlet__head-text">
                    List of Followups
                  </h3>
                </div>
              </div>
              <div class="m-portlet__head-tools">
                <a href="#" data-toggle="modal" data-target="#enquiry_followup_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                  <span>
                    <i class="la la-plus"></i>
                    <span>
                      Create New Followup
                    </span>
                  </span>
                </a>
              </div>
            </div>
            <div class="m-portlet__body">
              <!--begin: Datatable -->
              <?php $this->view("modules/include_tables/table_enquiry_followups");?>
              <!--end: Datatable -->

              <!--end: Datatable -->
              <?php $this->view("modules/include_modals/modal_enquiry_followups");?>
            </div>
          </div>
        </div>
      </div>

    </div>


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



<!-- end:: Body -->
<!-- begin::Footer -->

<?php $this->view("includes/Inc_footer");?>
<!-- end::Footer -->
</div>
<!-- end:: Page -->

<?php $this->view("includes/Inc_sidebar");?>
<?php $this->view("includes/Inc_scripts");?>
<!--begin::Page Snippets -->
<script>
$("#table_filter_status").selectpicker();
$("[data-switch=true]").bootstrapSwitch()
</script>

<script>
$("#enquiries_menu").addClass('m-menu__item--active');
function hide_all(){
  $(".profile_nav").removeClass('m-nav__item--active');
  $(".profile_nav_div").hide();
}
function active(menu_name){
  hide_all();
  $("#nav_"+menu_name).addClass('m-nav__item--active');
  $("#div_"+menu_name).show();
  $("#div_"+menu_name).fadeIn("slow");
  $('html, body').animate({
    scrollTop: eval($("#div_"+menu_name).offset().top - 150)
  }, 500);
}
//  Hide All Div and In Active All Menu
hide_all();
//  Active First Menu and Its div
active('info');
$('body').on('click', '.profile_nav', function() {
  var nav = $(this).attr('data-nav');
  active(nav);
})
</script>


<script>

jQuery(document).ready(function() {
  $('.profile_nav').on('click', function(e){
    var table_name = $(this).attr('data-table-name');
    if(table_name!=''){
      var tables = table_name.split(',');
      $.each(tables, function( index, value ){
        var table_name = value;
        $('#'+table_name).dataTable().fnDestroy();
        eval("Datatable_"+table_name).init("reload");
        // eval(table_name).ajax.reload();
      });
    }
  });
})
</script>

<?php $this->view("modules/include_scripts/customers_scripts");?>
<?php $this->view("modules/include_scripts/enquiry_scripts");?>
