@extends('layouts.agencies') @section('content')

    <?php Fun::lang()?>
    <ol class="breadcrumb">
        <li><a href="#">{{__('administrator.Dashboard')}}</a></li>
        <li><a href="#">{{__('administrator.crm')}}</a></li>
        <li class="active">{{__('administrator.add_lead')}}</li>
    </ol>
    <div class="page">
<div class=container-fluid>
        <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.add_lead')}}</h3>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {!! Form::model($lead, ['method' => 'PATCH','route' => ['lead.update', $lead->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.add_lead')}} <i>({{__('administrator.fields_in_red_are_required')}})</i></h3>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label for="name" class="required">{{__('administrator.date')}}</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::text('date', date('d-m-Y'), array('placeholder' => 'administrator.date','class' => 'form-control date_picker','required','')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label for="name" class="required">{{__('administrator.agent')}}</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::select('agent_id', $agent, null,array('class' => 'select2 form-control','required')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label for="name" class="required">{{__('administrator.lead_source')}}</label>
                        </div>
                        <div class="col-sm-8">
                            {!! Form::select('lead_source', $lead_source, null,array('class' => 'select2 form-control','required')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.family_name')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            {!! Form::text('family_name', null, array('placeholder' => __('administrator.family_name'),'class' => 'form-control','required','maxlength'=>'50')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.name')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            {!! Form::text('name', null, array('placeholder' => __('administrator.name'),'class' => 'form-control','required','maxlength'=>'50')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.contact')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            <input type="text" class="form-control number-only" name="contact" data-inputmask="'mask': ['999-999-9999', '+099 99 99 9999[9]-9999']" data-mask placeholder="Phone Number">
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.email')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            {!! Form::email('email', null, array('placeholder' => __('administrator.email'),'class' => 'form-control','required','maxlength'=>'30')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.address')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            {!! Form::text('address', null, array('placeholder' => __('administrator.address'),'class' => 'form-control','required','maxlength'=>'255')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.job')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            {!! Form::text('job', null, array('placeholder' => __('administrator.job'),'class' => 'form-control','required','maxlength'=>'50')) !!}
                        </div>
                    </div>
                    <div class="form-group col-sm-6 col-xs-12">
                        <div class="col-sm-4 col-xs-12 ">
                            <label class="required" for="name">{{__('administrator.workplace')}} </label>
                        </div>
                        <div class="col-sm-8 col-xs-12">
                            {!! Form::text('workplace', null, array('placeholder' => __('administrator.workplace'),'class' => 'form-control','required','maxlength'=>'50')) !!}
                        </div>
                    </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(){

        });
        function get_new_category(){
            $('#category_id').empty();
            $.ajax({
                type: 'GET',
                url: '{{ URL::to('pos/show-new-categorys') }}',
                dataType:'json',
                success: function (data) {
                    $.each(data, function (index, element) {
                        $("#category_id").append('<option value="' + element.id + '">'  +element.category_name  +'</option>');
                    });
                }
            });

        }
    </script>
@endsection