<!-- <style>
.nav-tabs-custom>.tab-content{
  border:1px solid #d2d6de !important;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.nav-tabs-custom>.nav-tabs{
  background-color: #3c8dbc !important;
}
.nav-tabs-custom>.nav-tabs>li a{
  color: #ffffff !important;
}
.nav-tabs-custom>.nav-tabs>li.active a{
  color: #000000 !important;
}
.nav-tabs-custom>.nav-tabs>li.active {
  padding-left: 3px;
}
</style> -->
<?php $__env->startSection('header-php'); ?>
  <?php
  $body_id = '';
  $body_class = '';
  ?>
<?php $__env->stopSection(); ?> 

<?php $__env->startSection('meta-dynamic'); ?>
  <title>coreCMS</title>  
  <meta name="description" content="-">    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('main'); ?>
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      Contacts | Create
    </h1>
    
    <!-- 
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
      <li class="active">Here</li>
    </ol> 
    -->

  </section>

  <!-- Main content -->
    <section class="content container-fluid">
        
        <!--------------------------
          | Your Page Content Here |
          -------------------------->

        <?php if(Session::has('message')): ?>
            <div class="alert <?php echo e(Session::get('alert_class')); ?>">
              <button type="button" class="close" data-dismiss="alert">&times</button>
              <?php echo e(Session::get('message')); ?>

            </div>
        <?php endif; ?>             

        <?php if($errors->any()): ?>
            <div class="alert alert-danger">
                <button type="button" class="close" data-dismiss="alert">&times</button>
                <ul>
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>         
        
        <div class="box box-primary">

          <?php echo e(Form::open(array('url' => 'contact/store', 'class' => '', 'id' => 'add-contact-form'))); ?>

            <div class="box-body">
              <div id="" class="form-group">
                <div class="box-body">
                  <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                      <li class="active"><a href="#tab_variation_0" data-toggle="tab"><strong>Contact Information</strong></a></li>
                      <li class=""><a href="#tab_variation_1" data-toggle="tab"><strong>Business Information</strong></a></li>
                      <li class=""><a href="#tab_variation_2" data-toggle="tab"><strong>Loan Information</strong></a></li>
                      <li class=""><a href="#tab_variation_3" data-toggle="tab"><strong>Broker Information</strong></a></li>
                    </ul>

                    <div class="tab-content">
                      <div class="active tab-pane" id="tab_variation_0">
                        <?php echo $__env->make('contact.create_personal_info', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                      </div>
                      <div class="tab-pane" id="tab_variation_1">
                        <?php echo $__env->make('contact.create_business_info', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                      </div>

                      <div class="tab-pane" id="tab_variation_2">
                        <?php echo $__env->make('contact.create_loan_info', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                      </div>

                      <div class="tab-pane" id="tab_variation_3">
                        <?php echo $__env->make('contact.create_broker_info', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                      </div>

                    </div>
                  </div>
                </div>
              </div>
                                                                                                                                       
            </div>            
            <!-- /.box-body -->

            <div class="box-footer">
              <button type="submit" class="btn btn-success">Add</button>
              <a class="btn btn-primary" href="<?php echo e(route('contact')); ?>">Cancel</a>
            </div>
          <?php echo Form::close(); ?>     

        </div>        

    </section>
  <!-- /.content -->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-footer-scripts'); ?>
<script>
  var base_url = '<?php echo url("/"); ?>'; 

  $("#filed_bankruptcy").change(function(){
    var selected = $(this).val();
    if( selected == 'Yes' ){
      $(".date-bankruptcy-container").removeClass("hide");
    }else{
      $(".date-bankruptcy-container").addClass("hide");
    }
  });
  
  function load_company_users_dropdown() {

      /*$.get(base_url + '/contact/ajax_load_company_users', $('#add-contact-form').serialize() , function (o) {
        $('#company-users-container').html('<br /><div style="text-align: center;" class="wrap"><i class="fa fa-spin fa-spinner"></i> Loading</div><br />');

        setTimeout(function () {
          $('#company-users-container').html(o);
        }, 250);
      }); */ 

      var company_id = $('#company_id').val();
      var c_user_id = 0;
      $('#company-users-container').html('<br /><div style="text-align: center;" class="wrap"><i class="fa fa-spin fa-spinner"></i> Loading</div><br />');
      var url = base_url + '/contact/ajax_load_company_users'
      $.ajax({
           type: "GET",
           url: url,               
           data: {
              "company_id":company_id,
              'c_user_id':c_user_id
              }, 
           success: function(o)
           {
              $('#company-users-container').html(o);
           }
      });          
  }

  function load_stage_status_dropdown() {
    var stage_id = $('#stage_id').val();
    $('#stage-status-container').html('<br /><div style="text-align: center;" class="wrap"><i class="fa fa-spin fa-spinner"></i> Loading</div><br />');
    var url = base_url + '/workflow/ajax_load_stage_status'
    $.ajax({
         type: "GET",
         url: url,               
         data: {"stage_id":stage_id}, 
         success: function(o)
         {
            $('#stage-status-container').html(o);
         }
    });
  }

  $(function () {

    $('#company_assigned_users').select2({

    });  
    $('#company_assigned_users2').select2({

    });

    var company_name = $("#company_id option:selected").text();
    $('#business_name').val(company_name);

    $('.bankruptcy_filed').datepicker({
      autoclose: true,
      format: 'yyyy-mm-dd',
    });

    $('.date_settled').datepicker({
      autoclose: true,
      format: 'yyyy-mm-dd',
    });

    $(".default-select2").select2();



    load_company_users_dropdown();
    load_stage_status_dropdown();
    $('#company_id').change(function () {
      var company_name = $("#company_id option:selected").text();
      $('#business_name').val(company_name);

      /*$.get(base_url + '/contact/ajax_load_company_users', $('#add-contact-form').serialize() , function (o) {
        $('#company-users-container').html('<br /><div style="text-align: center;" class="wrap"><i class="fa fa-spin fa-spinner"></i> Loading</div><br />');

        setTimeout(function () {
          $('#company-users-container').html(o);
        }, 250);
      });*/

      var company_id = $('#company_id').val();
      var c_user_id = 0;
      $('#company-users-container').html('<br /><div style="text-align: center;" class="wrap"><i class="fa fa-spin fa-spinner"></i> Loading</div><br />');
      var url = base_url + '/contact/ajax_load_company_users'
      $.ajax({
           type: "GET",
           url: url,               
           data: {
              "company_id":company_id,
              'c_user_id':c_user_id
              }, 
           success: function(o)
           {
              $('#company-users-container').html(o);
           }
      });   

    });

    $('#stage_id').change(function(){
      load_stage_status_dropdown();
    }); 
  });

</script>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layouts.backend.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\laragon\www\coreCMS\resources\views/contact/create.blade.php ENDPATH**/ ?>