@extends('adminlte::page')
@section('content')
    <?php Fun::lang()?>
    {{--<div class="top-header">--}}
        <ol class="breadcrumb">
            <li><a href="#">{{__('administrator.Dashboard')}}</a></li>
            <li><a>{{__('administrator.appointment_log')}}</a></li>
        </ol>
    {{--</div>--}}
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-12 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3>{{__('administrator.appointment_log')}}</h3>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        {!! Form::model($meeting, ['method' => 'PATCH','route' => ['appointment.update', $meeting->id]]) !!}
        <div class="row">

            <div class="col-sm-12">
                <div class="master-form">
                    <div class="title-note">
                        <h3><span class="fa fa-exclamation-triangle"></span> {{__('administrator.appointment_log')}}
                            <i>({{__('administrator.fields_in_red_are_required')}})</i></h3>
                    </div>
                    <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.lead')}}</label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('lead', $lead->family_name.' '.$lead->name, array('placeholder' =>__('administrator.lead_source'),'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.gender')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('sex', $lead->sex, 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" class="required">{{__('administrator.date')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('date', $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" class="required">{{__('administrator.contact')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('contact', $lead->contact, array('placeholder' =>__('administrator.contact'),'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.email')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('email', $lead->email, array('placeholder' =>__('administrator.email'),'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.address')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('address', $lead->address, array('placeholder' =>__('administrator.address'),'class' => 'form-control','readonly')) !!}
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    <div class="form-group col-sm-12 col-xs-12">
                        <fieldset>
                            <legend>
                                {{__('administrator.meeting_task')}}
                            </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.agent')}} </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', null, array('placeholder' =>__('administrator.lead_source'),'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.subject')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('subject', null, array('placeholder' =>__('administrator.subject'),'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.place')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('where',null, array('placeholder' =>__('administrator.place'),'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 class="required" 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','required','readonly')) !!}
                                </div>
                                <div class="col-sm-3 col-xs-12">
                                    {!! Form::text('minutes', null,array('placeholder'=>__('administrator.minute'),'class' => 'form-control','required','readonly')) !!}
                                </div>
                                <div class="col-sm-3 col-xs-12">
                                    {!! Form::text('shift', null,array('placeholder'=>'Shift','class' => 'form-control','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" class="required">{{__('administrator.note')}} </label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::text('note', null, array('placeholder' =>__('administrator.note'),'class' => 'form-control','readonly')) !!}
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    <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" class="required" >{{__('administrator.outcome')}}</label>
                                </div>
                                <div class="col-sm-9">
                                    {!! Form::select('out_come',[''=>__('administrator.please_select'),'Interest'=>__('administrator.interest'),'Not Interest'=>__('administrator.not_interest'),'Not Response'=>__('administrator.no_response'),'Requested more Information'=>__('administrator.request_more_info'),'Next Time'=>__('administrator.next_time')] ,null, array('class' => 'form-control select2','required')) !!}
                                </div>
                            </div>
                            <div class="form-group col-sm-6 col-xs-12">
                                <div class="col-sm-5 col-xs-12 ">
                                    <label  for="name" class="required">{{__('administrator.result_percentage')}} </label>
                                </div>
                                <div class="col-sm-7">
                                    {!! Form::number('result_percentage', null, array('placeholder' =>__('%'),'class' => 'form-control number-only','min'=>'0','max'=>'100','required')) !!}
                                </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::textarea('result',null, array('placeholder' =>__('administrator.note'),'class' => 'form-control no-resize textarea','rows'=>'4','maxlength'=>'255')) !!}
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    <div class="col-sm-12 col-xs-12">
                        <div class="form-group footer-save">
                            <button type="submit" class="button_sm button_primary pull-right"><span class="fa fa-save"></span> {{__('administrator.save')}}</button>
                            <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
@section('script')
    <script type="text/javascript">
        $(document).ready(function() {
            $('.textarea').on('keyup',function (e) {
                if (e.which == 13) {
                    e.preventDefault();
                    var s = $(this).val();
                    $(this).val(s+'|');
                }
            });
        });
    </script>
@stop




