@extends('layouts.app') @section('title', __('stage_academy.cards.users')) @push('styles') @endpush @section('content')
| {{ __('stage_academy.users.fields.image') }} | {{ __('stage_academy.users.fields.name') }} | {{ __('stage_academy.users.fields.country') }} | {{ __('stage_academy.users.fields.province') }} | {{ __('stage_academy.users.fields.gender') }} | {{ __('stage_academy.users.fields.phone') }} | {{ __('common.actions') }} |
|---|---|---|---|---|---|---|
|
@if(! empty($user->image) && \Illuminate\Support\Facades\Schema::hasColumn('stage_academy_users', 'image'))
|
{{ $user->name }} | {{ $countries[$user->country] ?? $user->country }} | @if($user->country === 'iq' && !empty($user->province)) {{ $provinceLabels[$user->province] ?? $user->province }} @else - @endif | {{ __('stage_academy.users.gender.' . $user->gender) }} | {{ $user->phone }} |
@if($isPosStageAcademy)
@php
$phoneDigits = preg_replace('/\\D+/', '', (string) $user->phone);
$waPhone = $phoneDigits;
if (str_starts_with($waPhone, '00')) {
$waPhone = substr($waPhone, 2);
}
if ($user->country === 'iq') {
if (str_starts_with($waPhone, '0')) {
$waPhone = '964'.ltrim($waPhone, '0');
} elseif (! str_starts_with($waPhone, '964') && strlen($waPhone) <= 11) {
$waPhone = '964'.$waPhone;
}
}
$portalUrl = route('stage-academy-portal.login');
$message = __('stage_academy.users.whatsapp.message', [
'name' => $user->name,
'link' => $portalUrl,
'username' => $user->phone,
'password' => '123456789',
]);
$message = str_replace(["\\r\\n", "\\n", "\\r"], "\n", (string) $message);
$message = str_replace(["\r\n", "\r"], "\n", (string) $message);
if ($user->name && ! str_contains($message, (string) $user->name)) {
$message = str_replace(['مرحباً عزيزنا،', 'مرحبا عزيزنا،', 'مرحباً عزيزنا', 'مرحبا عزيزنا'], 'مرحباً '.$user->name.'،', $message);
$message = str_replace('Hello,', 'Hello '.$user->name.',', $message);
}
$waUrl = ($waPhone !== '')
? 'https://api.whatsapp.com/send?phone='.$waPhone.'&text='.rawurlencode($message)
: 'https://api.whatsapp.com/send?text='.rawurlencode($message);
@endphp
{{ __('stage_academy.users.share_whatsapp') }}
@endif
{{ __('stage_academy.users.courses.button') }}
|