@extends('layout.app') @php $checkRole = checkRoleAlready(); $roleGlobal = auth()->user()?:[]; @endphp @section('_style') @endsection @section('content')

{{$title}} {{isset($customer) ? '('.$customer->account_code.')':''}}

@if (isset($customer)) {!! Form::model($customer, array('url' => url('customers/'.$customer->id), 'method' => 'put', 'files'=> true, 'id'=>'fvalidate','autocomplete'=>'off')) !!} @else {!! Form::open(array('url' => route('customers.store'), 'method' => 'post', 'files'=> true, 'id'=>'fvalidate','autocomplete'=>'off')) !!} @endif
{!! Form::label('full_name', 'Tên KH', array('class' => 'control-label')) !!} {!! Form::text('full_name', null, array('class' => 'form-control')) !!} {{ $errors->first('full_name', ':message') }}
{!! Form::label('phone', 'Số điện thoại', array('class' => 'control-label')) !!} {!! Form::text('phone', isset($customer)? auth()->user()->permission('phone.open')? $customer->phone :@str_limit($customer->phone,7,'xxx'):null, array('id' => 'phone','class' => 'form-control')) !!} {{ $errors->first('phone', ':message') }}
{{-- @if (isset($customer))--}} {{--
--}} {{--
--}} {{-- {!! Form::label('membership', 'Mã thành viên (MEMBERSHIP)') !!}--}} {{-- {!! Form::text('membership', null, array('id' => 'membership','maxLength'=>9,'class' => 'form-control')) !!}--}} {{-- {{ $errors->first('membership', ':message') }}--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- {!! Form::label('fb_name', 'Nghề nghiêp') !!}--}} {{-- {!! Form::text('fb_name', null, array('id' => 'fb_name','class' => 'form-control')) !!}--}} {{-- {{ $errors->first('fb_name', ':message') }}--}} {{--
--}} {{--
--}}
{!! Form::label('numerology', 'Thần số học') !!} {!! Form::text('numerology', null, array('class' => 'form-control')) !!} {{ $errors->first('numerology', ':message') }}
{!! Form::label('death', 'Tử huyệt') !!} {!! Form::text('death', null, array('class' => 'form-control')) !!} {{ $errors->first('death', ':message') }}
{{-- @endif--}}
{!! Form::label('job', 'Nghề nghiệp') !!} {!! Form::text('job', null, array('class' => 'form-control')) !!} {{ $errors->first('job', ':message') }}
{!! Form::label('birthday', 'Ngày sinh') !!}
{!! Form::text('birthday', null, array('class' => 'form-control fc-datepicker')) !!}
{{ $errors->first('birthday', ':message') }}
{!! Form::label('address', 'Địa chỉ') !!} {!! Form::text('address', null, array('id' => 'address','class' => 'form-control')) !!} {{ $errors->first('address', ':message') }}
{!! Form::label('social_link', 'Facebook') !!} {!! Form::text('social_link', null, array('id' => 'social_link','class' => 'form-control')) !!} {{ $errors->first('social_link', ':message') }}
{!! Form::label('description', 'Mô tả') !!} {!! Form::text('description', null, array('id' => 'description','class' => 'form-control')) !!} {{ $errors->first('description', ':message') }}
{!! Form::label('gender', 'Giới tính', array('class' => 'control-label')) !!} {!! Form::select('gender',[0 => 'Nữ', 1 => 'Nam'], null, array('class' => 'form-control select2', 'placeholder' => 'Chọn giới tính')) !!} {{ $errors->first('gender', ':message') }}
@if(empty($checkRole))
{!! Form::label('branch_id', 'Chi nhánh',['class'=>'required']) !!} {!! Form::select('branch_id',$branchs, null, array('class' => 'form-control select2 branch', 'placeholder' => 'Tất cả chi nhánh')) !!} {{ $errors->first('branch_id', ':message') }}
@else @endif {{--
--}} {{--
--}} {{-- --}} {{-- --}} {{--
--}} {{--
--}}
{!! Form::label('telesales_id', 'Người phụ trách', array('class' => 'control-label required')) !!} {{ $errors->first('telesales_id', ':message') }}
@if(\Illuminate\Support\Facades\Auth::user()->department_id==\App\Constants\DepartmentConstant::CARE_PAGE || \Illuminate\Support\Facades\Auth::user()->department_id==\App\Constants\DepartmentConstant::ADMIN)
{!! Form::label('mkt_id', 'MKT phụ trách', array('class' => 'control-label')) !!} {{ $errors->first('mkt_id', ':message') }}
@endif
{!! Form::label('status_id', 'Trạng thái', array('class' => 'control-label')) !!} {!! Form::select('status_id', $status, @$customer->status_id, array('class' => 'form-control select2')) !!} {{ $errors->first('status_id', ':message') }}
{!! Form::label('source_id', 'Nguồn khách hàng', array('class' => 'required control-label')) !!} {!! Form::select('source_id', $source, @$customer->source_id, array('class' => 'form-control select2', 'placeholder' => 'Nguồn khách hàng')) !!} {{ $errors->first('source_id', ':message') }}
{!! Form::label('group_id', 'Nhóm khách hàng', array('class' => 'required control-label')) !!} @if(isset($customer)) @else {!! Form::select('group_id[]', $group, null, array('class' => 'form-control select2', 'multiple' => 'multiple', 'data-placeholder'=> "Chọn nhóm khách hàng" )) !!} {{ $errors->first('group_id', ':message') }} @endif
{!! Form::label('category_tips', 'Nhóm d.vụ khai tác thêm') !!} @if(isset($customer)) @else {!! Form::select('category_tips[]', $group, null, array('class' => 'form-control select2', 'multiple' => 'multiple', 'data-placeholder'=> "Chọn nhóm khách hàng" )) !!} {{ $errors->first('category_tips', ':message') }} @endif
{!! Form::label('genitive_id', 'Nhóm tính cách') !!} @if(isset($customer)) @else {!! Form::select('genitive_id[]', $genitives,null, array('class' => 'form-control select2','multiple'=>'true')) !!} @endif
{!! Form::label('five_elements', 'Mệnh') !!} {!! Form::select('five_elements', \App\Models\Customer::five_elements, @$customer->five_elements, array('class' => 'form-control select2')) !!} {{ $errors->first('five_elements', ':message') }}
{!! Form::label('interest', 'Sở thích') !!} {!! Form::text('interest', null, array('class' => 'form-control')) !!} {{ $errors->first('interest', ':message') }}
{!! Form::label('facebook', 'Tính cách khách hàng') !!} {!! Form::text('facebook', null, array('id' => 'facebook','class' => 'form-control')) !!} {{ $errors->first('facebook', ':message') }}
{{--
--}} {{--
--}} {{-- {!! Form::label('is_gioithieu', 'SĐT khách giới thiệu') !!}--}} {{-- @if(isset($customer))--}} {{-- {!! Form::text('is_gioithieu',isset($customer)? (@$customer->gioithieu->phone.' ('.@$customer->gioithieu->full_name.' )'):null, array('id' => 'is_gioithieu','class' => 'form-control',$customer->is_gioithieu!=0?'readonly':'')) !!}--}} {{-- @else--}} {{-- {!! Form::text('is_gioithieu',null, array('id' => 'is_gioithieu','class' => 'form-control')) !!}--}} {{-- @endif--}} {{-- {{ $errors->first('is_gioithieu', ':message') }}--}} {{--
--}} {{--
--}}
{!! Form::label('avatar', 'Ảnh đại diện') !!}
@if (isset($customer)) image @endif
{{ Form::close() }}
@endsection @section('_script') @endsection