@extends('su-admin.layout.master') @section('content') @php if(!isset($_GET['tab'])){ $tab = ''; }else{ $tab = $_GET['tab']; } $languages = LaravelLocalization::getLocalesOrder(); $tawk_widget = get_setting('settings', 'widget', 'chat-support', 'tawk'); $whatsapp_widget = get_setting('settings', 'widget', 'chat-support', 'whatsapp'); $sections = [ "public" => "pubblico", "customer" => "clienti", "agent" => "agenti", ]; @endphp
@if (session()->has('message')) @endif

Chat Support

{!! Form::open(['url' => Request::url(), 'method' => 'post', 'class' => 'form-horizontal']) !!}
@php $status = get_setting('settings', 'status', 'chat-support'); $checked_off = ($status == 'off') ? true : false; $checked_tawk = ($status == 'tawk') ? true : false; $checked_tidio = ($status == 'tidio') ? true : false; $checked_whatsapp = ($status == 'whatsapp') ? true : false; @endphp
{!! Form::radio('status', 'off', $checked_off, ['class' => 'form-check-input', 'id' => 'status_off', 'required' => 'required', 'disabled' => (plus_active()) ? false : true]) !!} {!! Form::label('status_off', 'Disattivata', ['class' => 'form-check-label'] ) !!}
{!! Form::radio('status', 'tawk', $checked_tawk, ['class' => 'form-check-input', 'id' => 'status_tawk', 'required' => 'required', 'disabled' => (plus_active()) ? false : true]) !!} {!! Form::label('status_tawk', 'Tawk', ['class' => 'form-check-label'] ) !!}
{!! Form::radio('status', 'tidio', $checked_tidio, ['class' => 'form-check-input', 'id' => 'status_tidio', 'required' => 'required', 'disabled' => (plus_active()) ? false : true]) !!} {!! Form::label('status_tidio', 'Tidio', ['class' => 'form-check-label'] ) !!}
{!! Form::radio('status', 'whatsapp', $checked_whatsapp, ['class' => 'form-check-input', 'id' => 'status_whatsapp', 'required' => 'required', 'disabled' => (plus_active()) ? false : true]) !!} {!! Form::label('status_whatsapp', 'Whatsapp', ['class' => 'form-check-label'] ) !!}
{!! Form::hidden('id', 'list', ['class' => 'form-section-id'] ) !!} {!! Form::submit('Salva', ['class' => 'btn btn-primary btn-fw', 'disabled' => (plus_active()) ? false : true] ) !!}
{!! Form::close() !!}
{!! Form::open(['url' => Request::url(), 'method' => 'post', 'class' => 'form-horizontal']) !!}

Generale


{!! Form::label('property_id', 'ID proprietà', ['class' => 'form-label'] ) !!}
{!! Form::input('text', 'property_id', get_setting('settings', 'property_id', 'chat-support', 'tawk'), ['class' => 'form-control', 'required' => 'required']) !!}
{!! Form::label('api_key', 'Api key', ['class' => 'form-label'] ) !!}
{!! Form::input('text', 'api_key', get_setting('settings', 'api_key', 'chat-support', 'tawk'), ['class' => 'form-control']) !!}
@foreach ($sections as $section_key => $section)

Widget {{$section}}


@foreach($languages as $localeCode => $properties)

@php $id_widget_value = ''; if(!empty($tawk_widget[$section_key][$localeCode]['id'])){ $id_widget_value = $tawk_widget[$section_key][$localeCode]['id']; } @endphp
{!! Form::label('id_widget_' . $section_key . '_' . $localeCode, 'ID widget', ['class' => 'input-group-text', 'style' => 'width:80px'] ) !!} {!! Form::text('id_widget_' . $section_key . '_' . $localeCode, $id_widget_value, ['class' => 'form-control']) !!}
@endforeach
@endforeach
{!! Form::hidden('id', 'tawk', ['class' => 'form-section-id'] ) !!} {!! Form::submit('Salva', ['class' => 'btn btn-primary btn-fw'] ) !!}
{!! Form::close() !!}
{!! Form::open(['url' => Request::url(), 'method' => 'post', 'class' => 'form-horizontal']) !!}

Generale


{!! Form::label('public_key', 'Chiave pubblica', ['class' => 'form-label'] ) !!}
{!! Form::input('text', 'public_key', get_setting('settings', 'public_key', 'chat-support', 'tidio'), ['class' => 'form-control', 'required' => 'required']) !!}
{!! Form::label('private_key', 'Chiave privata', ['class' => 'form-label'] ) !!}
{!! Form::input('password', 'private_key', get_setting('settings', 'private_key', 'chat-support', 'tidio'), ['class' => 'form-control', 'required' => 'required']) !!}

Visualizzazione


{!! Form::checkbox('status_public', "1", get_setting('settings', 'status_public', 'chat-support', 'tidio'), ['class' => 'form-check-input', 'id' => 'status_public' ]) !!} {!! Form::label('status_public', 'Visualizza per non autenticati', ['class' => 'form-check-label'] ) !!}
{!! Form::checkbox('status_customer', "1", get_setting('settings', 'status_customer', 'chat-support', 'tidio'), ['class' => 'form-check-input', 'id' => 'status_customer' ]) !!} {!! Form::label('status_customer', 'Visualizza per clienti', ['class' => 'form-check-label'] ) !!}
{!! Form::checkbox('status_agent', "1", get_setting('settings', 'status_agent', 'chat-support', 'tidio'), ['class' => 'form-check-input', 'id' => 'status_agent' ]) !!} {!! Form::label('status_agent', 'Visualizza per agenti', ['class' => 'form-check-label'] ) !!}
{!! Form::hidden('id', 'tidio', ['class' => 'form-section-id'] ) !!} {!! Form::submit('Salva', ['class' => 'btn btn-primary btn-fw'] ) !!}
{!! Form::close() !!}
{!! Form::open(['url' => Request::url(), 'method' => 'post', 'class' => 'form-horizontal']) !!}

Generale


{!! Form::label('color', 'Colore', ['class' => 'form-label'] ) !!} {!! Form::input('color', 'color', get_setting('settings', 'color', 'chat-support', 'whatsapp'), ['class' => 'form-control form-control-color']) !!}
{!! Form::label('color_2', 'Colore 2', ['class' => 'form-label'] ) !!} {!! Form::input('color', 'color_2', get_setting('settings', 'color_2', 'chat-support', 'whatsapp'), ['class' => 'form-control form-control-color']) !!}
{!! Form::label('color_hover', 'Colore hover', ['class' => 'form-label'] ) !!} {!! Form::input('color', 'color_hover', get_setting('settings', 'color_hover', 'chat-support', 'whatsapp'), ['class' => 'form-control form-control-color']) !!}
{!! Form::label('color_text', 'Colore testo', ['class' => 'form-label'] ) !!} {!! Form::input('color', 'color_text', get_setting('settings', 'color_text', 'chat-support', 'whatsapp'), ['class' => 'form-control form-control-color']) !!}
{!! Form::label('position', 'Posizione', ['class' => 'form-label'] ) !!}
{!! Form::select('position', array('right' => 'Destra', 'left' => 'Sinistra'), get_setting('settings', 'position', 'chat-support', 'whatsapp'), ['class' => 'form-select' ]) !!}
@foreach ($sections as $section_key => $section)

Widget {{$section}}


@foreach($languages as $localeCode => $properties)

@php $mobile_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['mobile'])){ $mobile_value = $whatsapp_widget[$section_key][$localeCode]['mobile']; } $message_custom_value = false; if(!empty($whatsapp_widget[$section_key][$localeCode]['message_custom'])){ if($whatsapp_widget[$section_key][$localeCode]['message_custom'] == '1'){ $message_custom_value = true; } } $message_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['message'])){ $message_value = $whatsapp_widget[$section_key][$localeCode]['message']; } $days_value = []; if(!empty($whatsapp_widget[$section_key][$localeCode]['days'])){ $days_value = $whatsapp_widget[$section_key][$localeCode]['days']; } $time_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['time'])){ $time_value = $whatsapp_widget[$section_key][$localeCode]['time']; } $time_end_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['time_end'])){ $time_end_value = $whatsapp_widget[$section_key][$localeCode]['time_end']; } $time2_status_value = false; if(!empty($whatsapp_widget[$section_key][$localeCode]['time2_status'])){ if($whatsapp_widget[$section_key][$localeCode]['time2_status'] == '1'){ $time2_status_value = true; } } $time2_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['time2'])){ $time2_value = $whatsapp_widget[$section_key][$localeCode]['time2']; } $time2_end_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['time2_end'])){ $time2_end_value = $whatsapp_widget[$section_key][$localeCode]['time2_end']; } $timezone_value = 'Europe/Rome'; if(!empty($whatsapp_widget[$section_key][$localeCode]['timezone'])){ $timezone_value = $whatsapp_widget[$section_key][$localeCode]['timezone']; } $disabled_value = 'none'; if(!empty($whatsapp_widget[$section_key][$localeCode]['disabled'])){ $disabled_value = $whatsapp_widget[$section_key][$localeCode]['disabled']; } $message_available_value = 'none'; if(!empty($whatsapp_widget[$section_key][$localeCode]['message_available'])){ $message_available_value = $whatsapp_widget[$section_key][$localeCode]['message_available']; } $message_days_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['message_days'])){ $message_days_value = $whatsapp_widget[$section_key][$localeCode]['message_days']; } $message_times_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['message_times'])){ $message_times_value = $whatsapp_widget[$section_key][$localeCode]['message_times']; } $email_support_value = ''; if(!empty($whatsapp_widget[$section_key][$localeCode]['email_support'])){ $email_support_value = $whatsapp_widget[$section_key][$localeCode]['email_support']; } @endphp
{!! Form::label('mobile_' . $section_key . '_' . $localeCode, 'Cellulare', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::text('mobile_' . $section_key . '_' . $localeCode, $mobile_value, ['class' => 'form-control']) !!}
{!! Form::label('message_custom_' . $section_key . '_' . $localeCode, 'Messaggio custom', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!}
{!! Form::checkbox('message_custom_' . $section_key . '_' . $localeCode, '1', $message_custom_value, ['class' => 'form-check-input', 'id' => 'message_custom_' . $section_key . '_' . $localeCode]) !!} {!! Form::label('message_custom_' . $section_key . '_' . $localeCode, 'Visualizza messaggio personalizzato', ['class' => 'form-check-label'] ) !!}
{!! Form::label('message_' . $section_key . '_' . $localeCode, 'Messaggio', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::textarea('message_' . $section_key . '_' . $localeCode, $message_value, ['class' => 'form-control']) !!}
{!! Form::label('days_' . $section_key . '_' . $localeCode, 'Giorni', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!}
@php $days = [ 1 => "Lunedì", 2 => "Martedì", 3 => "Mercoledì", 4 => "Giovedì", 5 => "Venerdì", 6 => "Sabato", 7 => "Domenica" ]; @endphp @foreach ($days as $day_key => $day) @php $checked_day = (in_array($day_key, $days_value)) ? true : false; @endphp
{!! Form::checkbox('days_' . $section_key . '_' . $localeCode . '[]', $day_key, $checked_day, ['class' => 'form-check-input', 'id' => 'days_' . $section_key . '_' . $localeCode . '_' . $day_key]) !!} {!! Form::label('days_' . $section_key . '_' . $localeCode . '_' . $day_key, $day, ['class' => 'form-check-label'] ) !!}
@endforeach
{!! Form::label('times_' . $section_key . '_' . $localeCode, 'Orari', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!}
@php $times = []; $minutes = 30; $start = "00:00"; $end = "24:00"; $startDate = DateTime::createFromFormat("H:i", $start); $endDate = DateTime::createFromFormat("H:i", $end); $interval = new DateInterval("PT".$minutes."M"); $dateRange = new DatePeriod($startDate, $interval, $endDate); foreach ($dateRange as $date) { $times[$date->format("H:i")] = $date->format("H:i"); } $timezones = array( 'Pacific/Midway' => "(GMT-11:00) Midway Island", 'US/Samoa' => "(GMT-11:00) Samoa", 'US/Hawaii' => "(GMT-10:00) Hawaii", 'US/Alaska' => "(GMT-09:00) Alaska", 'US/Pacific' => "(GMT-08:00) Pacific Time (US & Canada)", 'America/Tijuana' => "(GMT-08:00) Tijuana", 'US/Arizona' => "(GMT-07:00) Arizona", 'US/Mountain' => "(GMT-07:00) Mountain Time (US & Canada)", 'America/Chihuahua' => "(GMT-07:00) Chihuahua", 'America/Mazatlan' => "(GMT-07:00) Mazatlan", 'America/Mexico_City' => "(GMT-06:00) Mexico City", 'America/Monterrey' => "(GMT-06:00) Monterrey", 'Canada/Saskatchewan' => "(GMT-06:00) Saskatchewan", 'US/Central' => "(GMT-06:00) Central Time (US & Canada)", 'US/Eastern' => "(GMT-05:00) Eastern Time (US & Canada)", 'US/East-Indiana' => "(GMT-05:00) Indiana (East)", 'America/Bogota' => "(GMT-05:00) Bogota", 'America/Lima' => "(GMT-05:00) Lima", 'America/Caracas' => "(GMT-04:30) Caracas", 'Canada/Atlantic' => "(GMT-04:00) Atlantic Time (Canada)", 'America/La_Paz' => "(GMT-04:00) La Paz", 'America/Santiago' => "(GMT-04:00) Santiago", 'Canada/Newfoundland' => "(GMT-03:30) Newfoundland", 'America/Buenos_Aires' => "(GMT-03:00) Buenos Aires", 'Greenland' => "(GMT-03:00) Greenland", 'Atlantic/Stanley' => "(GMT-02:00) Stanley", 'Atlantic/Azores' => "(GMT-01:00) Azores", 'Atlantic/Cape_Verde' => "(GMT-01:00) Cape Verde Is.", 'Africa/Casablanca' => "(GMT) Casablanca", 'Europe/Dublin' => "(GMT) Dublin", 'Europe/Lisbon' => "(GMT) Lisbon", 'Europe/London' => "(GMT) London", 'Africa/Monrovia' => "(GMT) Monrovia", 'Europe/Amsterdam' => "(GMT+01:00) Amsterdam", 'Europe/Belgrade' => "(GMT+01:00) Belgrade", 'Europe/Berlin' => "(GMT+01:00) Berlin", 'Europe/Bratislava' => "(GMT+01:00) Bratislava", 'Europe/Brussels' => "(GMT+01:00) Brussels", 'Europe/Budapest' => "(GMT+01:00) Budapest", 'Europe/Copenhagen' => "(GMT+01:00) Copenhagen", 'Europe/Ljubljana' => "(GMT+01:00) Ljubljana", 'Europe/Madrid' => "(GMT+01:00) Madrid", 'Europe/Paris' => "(GMT+01:00) Paris", 'Europe/Prague' => "(GMT+01:00) Prague", 'Europe/Rome' => "(GMT+01:00) Rome", 'Europe/Sarajevo' => "(GMT+01:00) Sarajevo", 'Europe/Skopje' => "(GMT+01:00) Skopje", 'Europe/Stockholm' => "(GMT+01:00) Stockholm", 'Europe/Vienna' => "(GMT+01:00) Vienna", 'Europe/Warsaw' => "(GMT+01:00) Warsaw", 'Europe/Zagreb' => "(GMT+01:00) Zagreb", 'Europe/Athens' => "(GMT+02:00) Athens", 'Europe/Bucharest' => "(GMT+02:00) Bucharest", 'Africa/Cairo' => "(GMT+02:00) Cairo", 'Africa/Harare' => "(GMT+02:00) Harare", 'Europe/Helsinki' => "(GMT+02:00) Helsinki", 'Europe/Istanbul' => "(GMT+02:00) Istanbul", 'Asia/Jerusalem' => "(GMT+02:00) Jerusalem", 'Europe/Kiev' => "(GMT+02:00) Kyiv", 'Europe/Minsk' => "(GMT+02:00) Minsk", 'Europe/Riga' => "(GMT+02:00) Riga", 'Europe/Sofia' => "(GMT+02:00) Sofia", 'Europe/Tallinn' => "(GMT+02:00) Tallinn", 'Europe/Vilnius' => "(GMT+02:00) Vilnius", 'Asia/Baghdad' => "(GMT+03:00) Baghdad", 'Asia/Kuwait' => "(GMT+03:00) Kuwait", 'Africa/Nairobi' => "(GMT+03:00) Nairobi", 'Asia/Riyadh' => "(GMT+03:00) Riyadh", 'Europe/Moscow' => "(GMT+03:00) Moscow", 'Asia/Tehran' => "(GMT+03:30) Tehran", 'Asia/Baku' => "(GMT+04:00) Baku", 'Europe/Volgograd' => "(GMT+04:00) Volgograd", 'Asia/Muscat' => "(GMT+04:00) Muscat", 'Asia/Tbilisi' => "(GMT+04:00) Tbilisi", 'Asia/Yerevan' => "(GMT+04:00) Yerevan", 'Asia/Kabul' => "(GMT+04:30) Kabul", 'Asia/Karachi' => "(GMT+05:00) Karachi", 'Asia/Tashkent' => "(GMT+05:00) Tashkent", 'Asia/Kolkata' => "(GMT+05:30) Kolkata", 'Asia/Kathmandu' => "(GMT+05:45) Kathmandu", 'Asia/Yekaterinburg' => "(GMT+06:00) Ekaterinburg", 'Asia/Almaty' => "(GMT+06:00) Almaty", 'Asia/Dhaka' => "(GMT+06:00) Dhaka", 'Asia/Novosibirsk' => "(GMT+07:00) Novosibirsk", 'Asia/Bangkok' => "(GMT+07:00) Bangkok", 'Asia/Jakarta' => "(GMT+07:00) Jakarta", 'Asia/Krasnoyarsk' => "(GMT+08:00) Krasnoyarsk", 'Asia/Chongqing' => "(GMT+08:00) Chongqing", 'Asia/Hong_Kong' => "(GMT+08:00) Hong Kong", 'Asia/Kuala_Lumpur' => "(GMT+08:00) Kuala Lumpur", 'Australia/Perth' => "(GMT+08:00) Perth", 'Asia/Singapore' => "(GMT+08:00) Singapore", 'Asia/Taipei' => "(GMT+08:00) Taipei", 'Asia/Ulaanbaatar' => "(GMT+08:00) Ulaan Bataar", 'Asia/Urumqi' => "(GMT+08:00) Urumqi", 'Asia/Irkutsk' => "(GMT+09:00) Irkutsk", 'Asia/Seoul' => "(GMT+09:00) Seoul", 'Asia/Tokyo' => "(GMT+09:00) Tokyo", 'Australia/Adelaide' => "(GMT+09:30) Adelaide", 'Australia/Darwin' => "(GMT+09:30) Darwin", 'Asia/Yakutsk' => "(GMT+10:00) Yakutsk", 'Australia/Brisbane' => "(GMT+10:00) Brisbane", 'Australia/Canberra' => "(GMT+10:00) Canberra", 'Pacific/Guam' => "(GMT+10:00) Guam", 'Australia/Hobart' => "(GMT+10:00) Hobart", 'Australia/Melbourne' => "(GMT+10:00) Melbourne", 'Pacific/Port_Moresby' => "(GMT+10:00) Port Moresby", 'Australia/Sydney' => "(GMT+10:00) Sydney", 'Asia/Vladivostok' => "(GMT+11:00) Vladivostok", 'Asia/Magadan' => "(GMT+12:00) Magadan", 'Pacific/Auckland' => "(GMT+12:00) Auckland", 'Pacific/Fiji' => "(GMT+12:00) Fiji", ); @endphp
{!! Form::select('time_' . $section_key . '_' . $localeCode, $times, $time_value, ['class' => 'form-select', 'style' => 'width:150px' ]) !!}
{!! Form::select('time_end_' . $section_key . '_' . $localeCode, $times, $time_end_value, ['class' => 'form-select', 'style' => 'width:150px' ]) !!}
{!! Form::checkbox('time2_status_' . $section_key . '_' . $localeCode, '1', $time2_status_value, ['class' => 'form-check-input', 'id' => 'time2_status_' . $section_key . '_' . $localeCode]) !!} {!! Form::label('time2_status_' . $section_key . '_' . $localeCode, 'Attiva seconda fascia', ['class' => 'form-check-label'] ) !!}
{!! Form::select('time2_' . $section_key . '_' . $localeCode, $times, $time2_value, ['class' => 'form-select', 'style' => 'width:150px' ]) !!}
{!! Form::select('time2_end_' . $section_key . '_' . $localeCode, $times, $time2_end_value, ['class' => 'form-select', 'style' => 'width:150px' ]) !!}
{!! Form::select('timezone_' . $section_key . '_' . $localeCode, $timezones, $timezone_value, ['class' => 'form-select', 'style' => 'width:200px' ]) !!}
{!! Form::label('disabled_' . $section_key . '_' . $localeCode, 'Disattivare', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::select('disabled_' . $section_key . '_' . $localeCode, array('none' => 'Non disattivare', 'disabled' => 'Disattiva in base ai giorni e agli orari', 'disabled_email' => 'Disattiva in base ai giorni e agli orari e abilita supporto email', 'not_visible' => 'Non visualizzare in base ai giorni e agli orari'), $disabled_value, ['class' => 'form-select' ]) !!}
{!! Form::label('message_available_' . $section_key . '_' . $localeCode, 'Messaggio disponibile', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::select('message_available_' . $section_key . '_' . $localeCode, array('none' => 'Non visualizzare', 'auto' => 'Automatico dalle impostazioni', 'message' => 'Messaggio personalizzato'), $message_available_value, ['class' => 'form-select' ]) !!}
{!! Form::label('message_days_' . $section_key . '_' . $localeCode, 'Messaggio giorni', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::input('text', 'message_days_' . $section_key . '_' . $localeCode, $message_days_value, ['class' => 'form-control']) !!}
{!! Form::label('message_times_' . $section_key . '_' . $localeCode, 'Messaggio ore', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::input('text', 'message_times_' . $section_key . '_' . $localeCode, $message_times_value, ['class' => 'form-control']) !!}
{!! Form::label('email_support_' . $section_key . '_' . $localeCode, 'Email supporto', ['class' => 'input-group-text', 'style' => 'width:150px'] ) !!} {!! Form::input('email', 'email_support_' . $section_key . '_' . $localeCode, $email_support_value, ['class' => 'form-control']) !!}
@endforeach
@endforeach
{!! Form::hidden('id', 'whatsapp', ['class' => 'form-section-id'] ) !!} {!! Form::submit('Salva', ['class' => 'btn btn-primary btn-fw'] ) !!}
{!! Form::close() !!}
@endsection