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

{{$title}}

@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)? @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', 'Tên Facebook') !!} {!! Form::text('fb_name', null, array('id' => 'fb_name','class' => 'form-control')) !!} {{ $errors->first('fb_name', ':message') }}
@endif
{!! Form::label('birthday', 'Ngày sinh') !!}
{!! Form::text('birthday', null, array('class' => 'form-control fc-datepicker')) !!}
{{ $errors->first('birthday', ':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('facebook', 'Link Facebook') !!} {!! Form::text('facebook', null, array('id' => 'facebook','class' => 'form-control')) !!} {{ $errors->first('facebook', ':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('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('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