diff --git a/app/Http/Controllers/ConfirmClientFromBitrix.php b/app/Http/Controllers/ConfirmClientFromBitrix.php
index 1d6cb09..3cd2000 100644
--- a/app/Http/Controllers/ConfirmClientFromBitrix.php
+++ b/app/Http/Controllers/ConfirmClientFromBitrix.php
@@ -29,7 +29,7 @@ public function confirm(Request $request)
])->error(
json_encode(
[
- 'is_uniaue' => $request->is_unique,
+ 'is_unique' => $request->is_unique,
'deal' => $deal->id,
'status' => $deal->status
]
diff --git a/app/Livewire/ClientsTable.php b/app/Livewire/ClientsTable.php
index 04b5e0f..9c3de67 100644
--- a/app/Livewire/ClientsTable.php
+++ b/app/Livewire/ClientsTable.php
@@ -10,6 +10,8 @@
use App\Models\Company\CompanyAdmin;
use App\Models\Deal\Deal;
+use App\Models\Deal\DealStatus;
+
class ClientsTable extends Component
{
use WithPagination;
@@ -43,20 +45,23 @@ public function getDeals()
public function render()
{
$deals = $this->getDeals();
- if ($this->status && $this->status == 'UNIQUE')
+ if ($this->status && $this->status == DealStatus::UNIQUE)
{
- $deals = $deals->where('status', $this->status)->paginate(8);
+ $deals = $deals
+ ->whereIn('status', [DealStatus::UNIQUE])
+ ->orderBy('id', 'desc')->paginate(10, ['*'], 'unique_clients');
}
else
{
- $deals = $deals->paginate(8);
+ $deals = $deals->orderBy('id', 'desc')->paginate(10, ['*'], 'all_clients');
}
;
return view(
'livewire.clients-table',
[
- 'deals' => $deals
+ 'deals' => $deals,
+ 'statuses' => DealStatus::class
]
);
}
diff --git a/app/Livewire/CreateClientForm.php b/app/Livewire/CreateClientForm.php
index 45e7330..ebea135 100644
--- a/app/Livewire/CreateClientForm.php
+++ b/app/Livewire/CreateClientForm.php
@@ -60,6 +60,8 @@ public function updated($propertyName)
$this->status = self::NEW;
if ($propertyName == 'client.phone')
{
+ //$this->dispatch('phone-updated', ['newPhone' => 111]);
+ //$this->js("checkPhoneFormat('123')");
$phone = preg_replace('/[^0-9]/', "", $this->client['phone']);
if (strlen($phone) == 10)
{
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 452e6b6..abd395f 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -3,22 +3,24 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
+use Illuminate\Pagination\Paginator;
class AppServiceProvider extends ServiceProvider
-{
+ {
/**
* Register any application services.
*/
public function register(): void
- {
+ {
//
- }
+ }
/**
* Bootstrap any application services.
*/
public function boot(): void
- {
- //
+ {
+ Paginator::useBootstrapFive();
+ Paginator::useBootstrapFour();
+ }
}
-}
diff --git a/lang/ru/pagination.php b/lang/ru/pagination.php
index d481411..90e7b72 100644
--- a/lang/ru/pagination.php
+++ b/lang/ru/pagination.php
@@ -13,7 +13,7 @@
|
*/
- 'previous' => '« Previous',
- 'next' => 'Next »',
+ 'previous' => '« Назад',
+ 'next' => 'Вперед »',
];
diff --git a/resources/css/app.css b/resources/css/app.css
index 2aef201..edf78f5 100644
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -31,4 +31,22 @@ input[type="radio"]:checked+label {
background-color: #e6662a !important;
color: white !important;
border-color: #e6662a !important;
+}
+
+/*pagination*/
+.page-item,
+.page-link {
+ color: #ccc;
+ border-color: #ccc
+}
+
+.active>.page-link {
+ background-color: #e6662a !important;
+ color: white !important;
+ border-color: #e6662a !important;
+}
+
+.page-item:not(.active)>.page-link:hover {
+ color: #e6662a !important;
+ border-color: #ccc
}
\ No newline at end of file
diff --git a/resources/views/company/create.blade.php b/resources/views/company/create.blade.php
index 9d020a5..1d057ec 100644
--- a/resources/views/company/create.blade.php
+++ b/resources/views/company/create.blade.php
@@ -26,7 +26,7 @@
@if($type)
-
+
@error('name')
diff --git a/resources/views/livewire/clients-table.blade.php b/resources/views/livewire/clients-table.blade.php
index 7a66359..4cbbee4 100644
--- a/resources/views/livewire/clients-table.blade.php
+++ b/resources/views/livewire/clients-table.blade.php
@@ -9,6 +9,13 @@
{{ $deal->user->name }}
+ @if($deal->status == $statuses::MODERATION)
+
+
+ На проверке уникальности
+
+
+ @endif
|
{{ $deal->user->phone }}
@@ -25,6 +32,6 @@
-
+ {{ $deals->links('vendor.pagination.bootstrap-5') }}
diff --git a/resources/views/livewire/create-client-form.blade.php b/resources/views/livewire/create-client-form.blade.php
index 29fb82e..3f9dc3c 100644
--- a/resources/views/livewire/create-client-form.blade.php
+++ b/resources/views/livewire/create-client-form.blade.php
@@ -17,7 +17,7 @@ class="form-control rounded-4 @error('client.firstName') is-invalid @enderror"
name="client.firstName" required autocomplete="client.firstName" placeholder="Имя">
@error('client.firstName')
-
+
{{ $message }}
@enderror
@@ -30,7 +30,7 @@ class="form-control rounded-4 @error('client.secondName') is-invalid @enderror"
name="client.secondName" required autocomplete="client.secondName" placeholder="Фамилия">
@error('client.secondName')
-
+
{{ $message }}
@enderror
@@ -46,7 +46,7 @@ class="form-control rounded-4 @error('client.phone') is-invalid @enderror"
name="client.phone" required autocomplete="phone" placeholder="Телефон клиента">
@error('client.phone')
-
+
{{ $message }}
@enderror
@@ -59,7 +59,7 @@ class="form-control rounded-4 @error('client.city') is-invalid @enderror" name="
required autocomplete="city" placeholder="Город">
@error('client.city')
-
+
{{ $message }}
@enderror
@@ -79,7 +79,7 @@ class="form-select rounded-4 @error('client.complexId') is-invalid @enderror" id
@error('client.complexId')
-
+
{{ $message }}
@enderror
@@ -99,7 +99,7 @@ class="form-select rounded-4 @error('agent') is-invalid @enderror" id="agent"
@error('agent')
-
+
{{ $message }}
@enderror
@@ -161,4 +161,32 @@ class="btn btn-lg active border-2 rounded">Повторить
@endif
+ @script
+
+ @endscript
diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php
new file mode 100644
index 0000000..63c6f56
--- /dev/null
+++ b/resources/views/vendor/pagination/bootstrap-4.blade.php
@@ -0,0 +1,46 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/bootstrap-5.blade.php b/resources/views/vendor/pagination/bootstrap-5.blade.php
new file mode 100644
index 0000000..770f262
--- /dev/null
+++ b/resources/views/vendor/pagination/bootstrap-5.blade.php
@@ -0,0 +1,88 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php
new file mode 100644
index 0000000..0db70b5
--- /dev/null
+++ b/resources/views/vendor/pagination/default.blade.php
@@ -0,0 +1,46 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/semantic-ui.blade.php b/resources/views/vendor/pagination/semantic-ui.blade.php
new file mode 100644
index 0000000..ef0dbb1
--- /dev/null
+++ b/resources/views/vendor/pagination/semantic-ui.blade.php
@@ -0,0 +1,36 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php
new file mode 100644
index 0000000..4bb4917
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php
@@ -0,0 +1,27 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-bootstrap-5.blade.php b/resources/views/vendor/pagination/simple-bootstrap-5.blade.php
new file mode 100644
index 0000000..a89005e
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-bootstrap-5.blade.php
@@ -0,0 +1,29 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php
new file mode 100644
index 0000000..36bdbc1
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-default.blade.php
@@ -0,0 +1,19 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/simple-tailwind.blade.php b/resources/views/vendor/pagination/simple-tailwind.blade.php
new file mode 100644
index 0000000..ea02400
--- /dev/null
+++ b/resources/views/vendor/pagination/simple-tailwind.blade.php
@@ -0,0 +1,25 @@
+@if ($paginator->hasPages())
+
+@endif
diff --git a/resources/views/vendor/pagination/tailwind.blade.php b/resources/views/vendor/pagination/tailwind.blade.php
new file mode 100644
index 0000000..aee2ad2
--- /dev/null
+++ b/resources/views/vendor/pagination/tailwind.blade.php
@@ -0,0 +1,106 @@
+@if ($paginator->hasPages())
+
+@endif
|