@extends('layouts.master')
@section('page_title')
    @if(isset($page_title))
        {{ $page_title }}
    @endif
@endsection
@section('css')
  <link href="{!! url('public/assets/vendors/bootstrap-daterangepicker/daterangepicker.css') !!}" rel="stylesheet">
  <link href="{!! url('public/assets/vendors/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css') !!}" rel="stylesheet">
@endsection
@section('content')
  <div class="">
    <div class="page-title">
      <div class="title_left" style="width:800px !important;">
        <ol class="breadcrumb">
          <li><a href="{!! url('dashboard') !!}">Dashboard</a></li>
          <li class="active">Create Marketing Report</li>
        </ol>
      </div>
    </div>
    <div class="clearfix"></div>
      <div class="row">
        <div class="col-md-10 col-sm-12 col-xs-12">
          <div class="x_panel">
              <div class="x_title">
                @include('commons.notifications')
                <div class="clearfix"></div>
              </div>
                {{-- start of content --}}
                <div class="x_content">
                  <br>
                      {!! Form::open(['url' => 'marketreport', 'class' => 'form-horizontal form-label-left']) !!}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="client">Client</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('client') ? 'has-error' : ''}}">
                          {!! Form::select('client', $clients ,old('client'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Client' , 'id' => 'client']) !!}
                          {!! $errors->first('client', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="service">Service</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('service') ? 'has-error' : ''}}">
                          {!! Form::select('service', $service ,old('service'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select Service' , 'id' => 'service']) !!}
                          {!! $errors->first('service', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="contact_person">Contact Person</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('contact_person') ? 'has-error' : ''}}">
                          {!! Form::text('contact_person', old('contact_person'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Contact Person' , 'id' => 'contact_person']) !!}
                          {!! $errors->first('contact_person', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="email">Email</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('email') ? 'has-error' : ''}}">
                          {!! Form::text('email', old('email'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter Email' , 'id' => 'email']) !!}
                          {!! $errors->first('email', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="discussion">Discussion</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('discussion') ? 'has-error' : ''}}">
                          {!! Form::textarea('discussion', old('discussion'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter discussion' , 'id' => 'discussion']) !!}
                          {!! $errors->first('discussion', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="payment_type">Payment Type</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('payment_type') ? 'has-error' : ''}}">
                          {!! Form::select('payment_type', $payment_type ,old('payment_type'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select payment type' , 'id' => 'payment_type']) !!}
                          {!! $errors->first('payment_type', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="current_balance">Current Balance</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('current_balance') ? 'has-error' : ''}}">
                          {!! Form::text('current_balance', old('current_balance'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Enter current balance' , 'id' => 'current_balance']) !!}
                          <small class="help-block">Enter amount without comma</small>
                          {!! $errors->first('current_balance', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="payment_status">Payment Status</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('payment_status') ? 'has-error' : ''}}">
                          {!! Form::select('payment_status', $payment_status ,old('payment_status'), ['class' => 'form-control col-md-7 col-xs-12', 'placeholder'=>'Select payment Status' , 'id' => 'payment_status']) !!}
                          {!! $errors->first('payment_status', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last_follow_up_date">Last Follow Up Date</label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('last_follow_up_date') ? 'has-error' : ''}}">
                          <!-- <input type="text" class="form-control has-feedback-left" id="single_cal" placeholder="First Name" aria-describedby="inputSuccess2Status3"> -->

                          {!! Form::text('last_follow_up_date', old('last_follow_up_date'), ['class' => 'form-control col-md-7 col-xs-12 followUpdates', 'placeholder'=>'Enter date' , 'id' => 'last_follow_up_date']) !!}
                          {!! $errors->first('last_follow_up_date', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="next_follow_up_date">Next Follow Up Date </label>
                        <div class="col-md-6 col-sm-6 col-xs-12 {{ $errors->has('next_follow_up_date') ? 'has-error' : ''}}">
                          {!! Form::text('next_follow_up_date', old('next_follow_up_date'), ['class' => 'form-control col-md-7 col-xs-12 followUpdates', 'placeholder'=>'Enter date' , 'id' => 'next_follow_up_date']) !!}
                          {!! $errors->first('next_follow_up_date', '<p class="help-block">:message</p>') !!}
                        </div>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button type="submit" class="btn btn-success btn-block"><i class="fa fa-save"></i> Submit</button>
                        </div>
                      </div>
                  {!! Form::close() !!}
                </div>
                {{-- end of x_content --}}
              </div>
              {{-- end of x_panel --}}
            </div>
          </div>
          
        </div>

@endsection

@section('javascript')
<script src="{!! url('public/assets/vendors/moment/min/moment.min.js') !!}"></script>
<script src="{!! url('public/assets/vendors/bootstrap-daterangepicker/daterangepicker.js') !!}"></script>
<script src="{!! url('public/assets/vendors/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js') !!}"></script>
<script type="text/javascript">
  $(function(){
    $('select').select2();

    $('.followUpdates').daterangepicker({
      singleDatePicker: true,
      singleClasses: "picker_3",
      locale: {
        format: 'YYYY-MM-DD'
        }
    }, 
    function(start, end, label) {
      console.log(start.toISOString(), end.toISOString(), label);
    });

  });
</script>
@endsection
