@extends('adminlte::page')
@section('content')
    <?php Fun::lang()?>
    <style>
        .select2-container--default .select2-selection--single{
            border: none;
        }
        .select2-container--default .select2-selection--single .select2-selection__arrow b {
            border-style: none;
        }
    </style>
    <div class="title-add">
        <div class="page-bar"> 
            <ul class="page-breadcrumb"> 
                <li> <a class="ng-binding" href="#"><i class="fa fa-dashboard"></i> Dashboard</a> </li>
                <li><a href="#">Operation</a></li>
                <li><a href="#">Manage Client</a></li>
                <li><a href="#">Manage CRM</a></li>
                <li><a href="#">Lead</a></li>
                <li><a href="#">Appointment</a></li>
                <li><a href="#">View</a></li>
            </ul> 
        </div>
    </div>
    <div class="page">
        {!! Form::model($meeting) !!}
        <div class="row">
            <div class="col-sm-12">
                <div class="master-form">
                    <div class="form-group col-sm-12 col-xs-12">
                        <fieldset>
                            <legend>
                                {{__('administrator.lead_info')}}
                            </legend>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name" class="required">{{__('administrator.follower')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('agent_lead', optional($lead->agent)->user_firstname.' '.optional($lead->agent)->user_lastname, array('placeholder' =>__('administrator.agent'),'class' => 'form-control','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name" class="required">{{__('administrator.date')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('date', date('d-m-Y',strtotime($lead->date)), array('placeholder' =>__('administrator.date'),'class' => 'form-control','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label for="name" >{{__('administrator.lead')}}</label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('lead', $lead->family_name.' '.$lead->name, array('placeholder' =>__('administrator.lead_source'),'class' => 'form-control no-border no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.gender')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('sex', __('administrator.'.strtolower($lead->sex)), array('placeholder' =>__('administrator.sex'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.contact')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('contact', $lead->contact, array('placeholder' =>__('administrator.contact'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.email')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('email', $lead->email, array('placeholder' =>__('administrator.email'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.address')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('address', $lead->address, array('placeholder' =>__('administrator.address'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.job')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('job', $lead->job, array('placeholder' =>__('administrator.job'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    <div class="form-group col-sm-12 col-xs-12">
                        <fieldset>
                            <legend>
                                {{__('administrator.appointment_log')}}
                            </legend>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name" class="required">{{__('administrator.follower')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('agent_lead', optional($lead->agent)->user_firstname.' '.optional($lead->agent)->user_lastname, array('placeholder' =>__('administrator.agent'),'class' => 'form-control','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label for="name" >{{__('administrator.date')}}</label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('date', date("d-m-Y",strtotime($meeting->date)), array('placeholder' =>__('administrator.lead_source'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.subject')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('subject', null, array('placeholder' =>__('administrator.subject'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.place')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('where',null, array('placeholder' =>__('administrator.place'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label for="name">{{__('administrator.time')}} </label>
                                </div>
                                <div class="col-sm-3 col-xs-12">
                                    {!! Form::text('hour', null,array('placeholder'=> __('administrator.hour'),'class' => 'form-control no-border','required','readonly')) !!}
                                </div>
                                <div class="col-sm-3 col-xs-12">
                                    {!! Form::text('minutes', null,array('placeholder'=>__('administrator.minute'),'class' => 'form-control no-border','required','readonly')) !!}
                                </div>
                                <div class="col-sm-3 col-xs-12">
                                    {!! Form::text('shift', null,array('placeholder'=>'Shift','class' => 'form-control no-border','required','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label  for="name">{{__('administrator.note')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('note', null, array('placeholder' =>__('administrator.note'),'class' => 'form-control no-border','readonly')) !!}
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    @if($meeting->complete_status>0)
                    <div class="form-group col-sm-12 col-xs-12">
                        <fieldset>
                            <legend>
                                {{__('administrator.result')}}
                            </legend>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                    <label for="name" >{{__('administrator.outcome')}}</label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('out_come',null, array('class' => 'form-control','disabled')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-5 col-xs-12 ">
                                    <label  for="name">{{__('administrator.result_percentage')}} </label>
                                </div>
                                <div class="col-sm-7">
                                    {!! Form::text('result_percentage', $meeting->result_percentage.'%', array('placeholder' =>__('%'),'class' => 'form-control no-border','min'=>'0','max'=>'100','readonly')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-3 col-xs-12 ">
                                        <label  for="name">{{__('administrator.note')}} </label>
                                </div>
                                <?php
                                $list = str_replace('|', '&#13;&#10;',$meeting->result);
                                ?>
                                <div class="col-sm-9">
                                    {!! Form::textarea('result',$list?$list:'N/A', array('placeholder' =>__('administrator.note'),'class' => 'form-control no-border no-resize','rows'=>'4','readonly')) !!}
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    @endif
                    <div class="col-sm-12 col-xs-12">
                        <div class="form-group footer-save">
                            <button type="button" onClick="javascript:history.go(-1)" class="button_sm button_warning pull-right">
                                <span class=" fa fa-arrow-circle-left"></span> {{__('administrator.back')}}</button>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        {!! Form::close() !!}
    </div>
@endsection





