Commit 30d354c5 authored by Michael Ngei's avatar Michael Ngei

Merge branch 'iprsv2_mike' into 'master'

Iprsv2 mike

See merge request !25
parents 559c6ca4 0e4b99ea
...@@ -21,3 +21,4 @@ supervisord.pid ...@@ -21,3 +21,4 @@ supervisord.pid
supervisord.log supervisord.log
worker.log worker.log
composer.lock composer.lock
/config
...@@ -104,13 +104,10 @@ class PaymentsAPI extends Controller ...@@ -104,13 +104,10 @@ class PaymentsAPI extends Controller
$consumer_name = str_replace( ' ', '_', strtoupper($contract->client->name_sh)); $consumer_name = str_replace( ' ', '_', strtoupper($contract->client->name_sh));
//$res=Redis::set('name', 'mikee'); //$res=Redis::set('name', 'mikee');
//$checkKey = Redis::get('search_quota:countsse:user23'); //$checkKey = Redis::get('search_quota:countsse:user23');
try{ try{
if (Redis::exists("search_quota:max:".$consumer_name)) { if (Redis::exists("search_quota:max:".$consumer_name)) {
$tokens = $validated['tokens']; $tokens = $validated['tokens'];
$maxToken = Redis::get("search_quota:max:".$consumer_name); $maxToken = Redis::get("search_quota:max:".$consumer_name);
// added tokens // added tokens
$newMax = $tokens + $maxToken; $newMax = $tokens + $maxToken;
//set tokens //set tokens
...@@ -126,11 +123,16 @@ class PaymentsAPI extends Controller ...@@ -126,11 +123,16 @@ class PaymentsAPI extends Controller
'contract_id' => $validated['contract_id'], 'contract_id' => $validated['contract_id'],
'USER_ID' => $validated['user_id'], 'USER_ID' => $validated['user_id'],
]); ]);
//update tokens
Tokens::where('contract_id', $validated['contract_id'])->update([
'total_tokens' => $newMax,
]);
// Return success JSON response // Return success JSON response
return response()->json([ return response()->json([
'success' => true, 'success' => true,
'message' => 'Payment created successfully', 'message' => 'Payment created successfully',
$this->jsonData,
], 201); ], 201);
} }
}else{ }else{
...@@ -148,7 +150,6 @@ class PaymentsAPI extends Controller ...@@ -148,7 +150,6 @@ class PaymentsAPI extends Controller
return response()->json([ return response()->json([
'success' => true, 'success' => true,
'message' => 'Payment created successfully', 'message' => 'Payment created successfully',
$this->jsonData,
], 201); ], 201);
} }
}catch (\Predis\Connection\ConnectionException $redisException) { }catch (\Predis\Connection\ConnectionException $redisException) {
...@@ -234,7 +235,6 @@ class PaymentsAPI extends Controller ...@@ -234,7 +235,6 @@ class PaymentsAPI extends Controller
] ]
]); ]);
if ($response->successful()) { if ($response->successful()) {
//save it locally
$tokens = Tokens::create([ $tokens = Tokens::create([
'TOTAL_TOKENS' => $tokens, 'TOTAL_TOKENS' => $tokens,
'contract_id' => $cid, 'contract_id' => $cid,
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Client;
use App\Models\Contract;
use App\Models\Tokens; use App\Models\Tokens;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis; use Illuminate\Support\Facades\Redis;
...@@ -29,12 +31,27 @@ class TokensController extends Controller ...@@ -29,12 +31,27 @@ class TokensController extends Controller
} }
} while ($cursor !== '0'); } while ($cursor !== '0');
dd($searchQuotas); $counts = [];
foreach ($searchQuotas as $key => $value) {
if (str_contains($key, 'search_quota:count:')) {
$clientName = str_replace('search_quota:count:', '', $key);
$counts[$clientName] = $value;
}
}
// Update the Tokens table
foreach ($counts as $clientName => $usedTokens) {
$clients_found = Client::where('name_sh', $clientName)->first();
if($clients_found){
$contract = Contract::where('client_rid', $clients_found->rid)->first();
if ($contract) {
$updated = Tokens::where('CONTRACT_ID', $contract->rid)->update(['USED_TOKENS' => $usedTokens]);
}
}
}
$tokens = Tokens::with('contract.client')->get(); $tokens = Tokens::with('contract.client')->get();
return view('tokens.tokens', [ return view('tokens.tokens', [
'tokens' => $tokens, 'tokens' => $tokens,
'searchQuotas' => $searchQuotas
]); ]);
} }
/* public function index() /* public function index()
......
...@@ -15,12 +15,13 @@ class BirthModal extends Component ...@@ -15,12 +15,13 @@ class BirthModal extends Component
{ {
protected $listeners = ['openBirthModal']; protected $listeners = ['openBirthModal'];
public $human; public $birth_human;
public $hasRole = false; public $hasRole = false;
public $role; public $role;
public $isOpen = false; public $isOpen = false;
public $docums; public $birth_docums;
public $serialNum=''; public $birth_serialNum='';
public $birth_familyrelation;
public function mount() public function mount()
{ {
/** @var Auth $user current logged-in user */ /** @var Auth $user current logged-in user */
...@@ -46,15 +47,14 @@ class BirthModal extends Component ...@@ -46,15 +47,14 @@ class BirthModal extends Component
public function openBirthModal($data): void public function openBirthModal($data): void
{ {
$entryNum= $data['entry_num']; $entryNum= $data['entry_num'];
$birth_human = $this->getHumanBirth($entryNum); $birth= $this->getHumanBirth($entryNum);
if($birth){
if($birth_human){ $this->birth_human = $birth[0];
$this->human = $birth_human[0]; $this->birth_docums = $birth[1];
$this->docums = $birth_human[1]; $this->birth_familyrelation = $birth[2];
$this->familyrelation = $birth_human[2];
$this->serialNum = $data['entry_num'];
}
$this->isOpen = true; $this->isOpen = true;
$this->birth_serialNum = $data['entry_num'];
}
} }
/*public function placeholder() /*public function placeholder()
...@@ -63,7 +63,7 @@ class BirthModal extends Component ...@@ -63,7 +63,7 @@ class BirthModal extends Component
}*/ }*/
public function closeModal() public function closeModal()
{ {
$this->isOpen = false; // $this->isOpen = false;
} }
private function getHumanBirth($entry_num) private function getHumanBirth($entry_num)
......
...@@ -72,7 +72,9 @@ class Searchform extends Component ...@@ -72,7 +72,9 @@ class Searchform extends Component
break; break;
case 'Birth' : case 'Birth' :
if(!empty($this->searchBirthEntryNum)){ if(!empty($this->searchBirthEntryNum)){
$this->search_count = 0;
$this->getBirthHuman(); $this->getBirthHuman();
}else{ }else{
session()->flash('error', 'Birth entry number not provided'); session()->flash('error', 'Birth entry number not provided');
} }
...@@ -235,23 +237,33 @@ class Searchform extends Component ...@@ -235,23 +237,33 @@ class Searchform extends Component
}else{ }else{
session()->flash('error', 'Search parameter is missing..'); session()->flash('error', 'Search parameter is missing..');
}*/ }*/
$rid = Docum::where('ser_num', '=', $this->searchBirthEntryNum)->value('rid_h'); if(!empty($this->searchBirthEntryNum)) {
$this->search_count=1;
$this->records_found=[];
$this->records_not_found=[];
$this->doctype ='Birth';
if($rid){ $rid = Docum::where('ser_num', '=', $this->searchBirthEntryNum)->value('rid_h');
$human = Human::where('rid','=', $rid)->whereColumn('rid', 'pid') if ($rid) {
$human = Human::where('rid', '=', $rid)->whereColumn('rid', 'pid')
->get(['rid', 'pid', 'name', 'surn', 'last_name', 'sex', 'date_birth', 'date_death', 'o_pid']); ->get(['rid', 'pid', 'name', 'surn', 'last_name', 'sex', 'date_birth', 'date_death', 'o_pid']);
// dd($human); // dd($human);
if($human->isEmpty()){ if ($human->isEmpty()) {
throw new ModelNotFoundException('No record found'); throw new ModelNotFoundException('No record found');
}else{ } else {
$this->search_count=1;
$this->doctype ='Birth'; $this->records_found[] = $this->searchBirthEntryNum;
$this->records_found[]=$this->searchBirthEntryNum; $this->serial_number[] = $this->searchBirthEntryNum;
$this->serial_number[]=$this->searchBirthEntryNum; $this->humans = $human;
$this->humans[] = $human;
$this->showTableResults(); $this->showTableResults();
/* $this->dispatch('viewResults', $this->humans,$this->serial_number,
$this->doctype,$this->records_not_found,
$this->search_count,$this->records_found);*/
} }
} }
}else{
session()->flash('error', 'Search parameter is missing..');
}
} }
/** /**
...@@ -260,6 +272,7 @@ class Searchform extends Component ...@@ -260,6 +272,7 @@ class Searchform extends Component
*/ */
public function showTableResults(): void public function showTableResults(): void
{ {
$this->dispatch('viewResults', $this->humans,$this->serial_number, $this->dispatch('viewResults', $this->humans,$this->serial_number,
$this->doctype,$this->records_not_found, $this->doctype,$this->records_not_found,
$this->search_count,$this->records_found); $this->search_count,$this->records_found);
......
...@@ -12,6 +12,7 @@ class Tableresult extends Component ...@@ -12,6 +12,7 @@ class Tableresult extends Component
protected $human=[]; protected $human=[];
public $records_not_found=[]; public $records_not_found=[];
public $search_count=0; public $search_count=0;
public $records_found= []; public $records_found= [];
...@@ -51,7 +52,7 @@ class Tableresult extends Component ...@@ -51,7 +52,7 @@ class Tableresult extends Component
$this->dispatch('openPassportModal', ['id'=>$id,'pass_no'=>$pass_no,'doctype'=>$doctype]); $this->dispatch('openPassportModal', ['id'=>$id,'pass_no'=>$pass_no,'doctype'=>$doctype]);
} }
public function birthresultsModal($entry_num): void public function birthresultsModal($entry_num)
{ {
$decodedId = urldecode($entry_num); $decodedId = urldecode($entry_num);
$this->dispatch('openBirthModal', ['entry_num' => $decodedId ]); $this->dispatch('openBirthModal', ['entry_num' => $decodedId ]);
...@@ -59,6 +60,7 @@ class Tableresult extends Component ...@@ -59,6 +60,7 @@ class Tableresult extends Component
public function render() public function render()
{ {
\Log::info('Rendering Tableresult');
return view('livewire.search.tableresult'); return view('livewire.search.tableresult');
} }
/* public function placeholder() /* public function placeholder()
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
$modalStatus= 'show'; $modalStatus= 'show';
$modalStyle="display: block;"; $modalStyle="display: block;";
} }
$fname = $human['name'] ?? ''; $fname = $birth_human['name'] ?? '';
$oname = $human['last_name'] ?? ''; $oname = $birth_human['last_name'] ?? '';
$surname = $human['surn'] ?? ''; $surname = $birth_human['surn'] ?? '';
@endphp @endphp
......
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
<div class="row" style="width: 100%;"> <div class="row" style="width: 100%;">
@if($role->hasPermissionTo("Basic View Birth Details")) @if($role->hasPermissionTo("Basic View Birth Details"))
<div class="col-12 text-center"> <div class="col-12 text-center">
@if(isset($human)) @if(isset($birth_human))
<small class="">Birth Entry Number</small> <small class="">Birth Entry Number</small>
<h4 class="upi"> <h4 class="upi">
{{ $docums[0]['SER_NUM'] }} {{ $birth_docums[0]['SER_NUM'] }}
</h4> </h4>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</div> </div>
<div class="col-12 text-center"> <div class="col-12 text-center">
@if(isset($human)) @if(isset($birth_human))
<small class="">Country of Birth</small> <small class="">Country of Birth</small>
<p class="card-text">{{ $human->birth_country }}</p> <p class="card-text">{{ $human->birth_country }}</p>
<span class="fi fi-ke" style="font-size: 2rem;"></span> <span class="fi fi-ke" style="font-size: 2rem;"></span>
...@@ -40,24 +40,24 @@ ...@@ -40,24 +40,24 @@
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<small>First name</small> <small>First name</small>
@if(isset($human->name)) @if(isset($birth_human->name))
<p class="field-value">{{ $human->name }}</p> <p class="field-value">{{ $birth_human->name }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</div> </div>
<div class="col-6"> <div class="col-6">
<small>Surname</small> <small>Sur name</small>
@if(isset($human->surn)) @if(isset($birth_human->surn))
<p class="field-value">{{ $human->surn }}</p> <p class="field-value">{{ $birth_human->surn }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</div> </div>
<div class="col-6"> <div class="col-6">
<small>Other name</small> <small>Other name</small>
@if(isset($human->last_name)) @if(isset($birth_human->last_name))
<p class="field-value">{{ $human->last_name }}</p> <p class="field-value">{{ $birth_human->last_name }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
...@@ -66,16 +66,16 @@ ...@@ -66,16 +66,16 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<small>Date of Birth</small> <small>Date of Birth</small>
@if(isset($human->date_birth)) @if(isset($birth_human->date_birth))
<p class="field-value">{{ Carbon::parse($human->date_birth)->format("d-m-Y") }}</p> <p class="field-value">{{ Carbon::parse($birth_human->date_birth)->format("d-m-Y") }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</div> </div>
<div class="col-6"> <div class="col-6">
<small>Gender</small> <small>Gender</small>
@if(isset($human->sex)) @if(isset($birth_human->sex))
<p class="field-value">{{ $human->sex }}</p> <p class="field-value">{{ $birth_human->sex }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
...@@ -89,10 +89,10 @@ ...@@ -89,10 +89,10 @@
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<small>Mother</small> <small>Mother</small>
@if(isset($docums[0]['M_NAME'])) @if(isset($birth_docums[0]['M_NAME']))
<p class="field-value"> <p class="field-value">
<i class="fas fa-female" style="color: #008500;"></i> <i class="fas fa-female" style="color: #008500;"></i>
{{ $docums[0]['M_NAME'] }} {{ $docums[0]['M_OTHNAME'] }} {{ $docums[0]['M_SURN'] }} {{ $birth_docums[0]['M_NAME'] }} {{ $birth_docums[0]['M_OTHNAME'] }} {{ $birth_docums[0]['M_SURN'] }}
</p> </p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
...@@ -101,9 +101,9 @@ ...@@ -101,9 +101,9 @@
@if($role->hasPermissionTo("Basic View Birth Mother ID number")) @if($role->hasPermissionTo("Basic View Birth Mother ID number"))
<div class="col-4"> <div class="col-4">
<small>ID no.</small> <small>ID no.</small>
@if(isset($docums[0]['MOTHER_DOC_NUMBER'])) @if(isset($birth_docums[0]['MOTHER_DOC_NUMBER']))
<p class="field-value"> <p class="field-value">
{{ $docums[0]['MOTHER_DOC_NUMBER'] }} {{ $birth_docums[0]['MOTHER_DOC_NUMBER'] }}
</p> </p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
...@@ -112,10 +112,10 @@ ...@@ -112,10 +112,10 @@
@endif @endif
<div class="col-8"> <div class="col-8">
<small>Father</small> <small>Father</small>
@if(isset($docums[0]['F_NAME'])) @if(isset($birth_docums[0]['F_NAME']))
<p class="field-value"> <p class="field-value">
<i class="fas fa-male" style="color: #008500;"></i> <i class="fas fa-male" style="color: #008500;"></i>
{{ $docums[0]['F_NAME'] }} {{ $docums[0]['F_OTHNAME'] }} {{ $docums[0]['F_SURN'] }} {{ $birth_docums[0]['F_NAME'] }} {{ $birth_docums[0]['F_OTHNAME'] }} {{ $birth_docums[0]['F_SURN'] }}
</p> </p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</div> </div>
@if($role->hasPermissionTo("Basic View Birth Father ID number")) @if($role->hasPermissionTo("Basic View Birth Father ID number"))
<div class="col-4"> <div class="col-4">
@if(isset($docums[0]['F_NAME'])) @if(isset($birth_docums[0]['F_NAME']))
<small>ID no.</small> <small>ID no.</small>
- -
@endif @endif
...@@ -138,8 +138,8 @@ ...@@ -138,8 +138,8 @@
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<small>District</small> <small>District</small>
@if(isset($human->addressBirth->adresComp)) @if(isset($birth_human->addressBirth->adresComp))
<p class="field-value">{{ $human->addressBirth->adresComp->name }}</p> <p class="field-value">{{ $birth_human->addressBirth->adresComp->name }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
...@@ -171,36 +171,38 @@ ...@@ -171,36 +171,38 @@
<x-adminlte-datatable id="clients-table searchResultsCard" :heads="$headings"> <x-adminlte-datatable id="clients-table searchResultsCard" :heads="$headings">
<tr> <tr>
<td> <td>
@if(isset($docums[0]['O_PID'])) @if(isset($birth_docums[0]['O_PID']))
<p class="field-value">{{ $docums[0]['O_PID'] }}</p> <p class="field-value">{{ $birth_docums[0]['O_PID'] }}</p>
@else @else
- -
@endif @endif
</td> </td>
<td> <td>
@if(isset($docums[0]['SER_NUM'])) @if(isset($birth_docums[0]['SER_NUM']))
<p class="field-value">{{ $docums[0]['SER_NUM'] }}</p> <p class="field-value">{{ $birth_docums[0]['SER_NUM'] }}</p>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</td> </td>
<td> <td>
@if(isset($docums[0]['O_DATE'])) @if(isset($birth_docums[0]['O_DATE']))
{{ Carbon::parse($human->data_scan)->format("d-m-Y") }} {{ Carbon::parse($birth_human->data_scan)->format("d-m-Y") }}
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</td> </td>
<td> <td>
@if(isset($docums[0]['SER_NUM'])) @if(isset($birth_docums[0]['SER_NUM']))
<span class="badge badge-success"> <span class="badge badge-success">
<i class="fa fa-check-circle"></i>Current</span> <i class="fa fa-check-circle"></i>
Current
</span>
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
</td> </td>
</tr> </tr>
@if(isset($docums))<p>Replaced: <strong>{{ count($docums)-1 }}</strong> times</p>@endif @if(isset($birth_docums))<p>Replaced: <strong>{{ count($birth_docums)-1 }}</strong> times</p>@endif
</x-adminlte-datatable> </x-adminlte-datatable>
</div> </div>
</div> </div>
......
...@@ -12,28 +12,28 @@ ...@@ -12,28 +12,28 @@
<div class="col-3"> <div class="col-3">
<small>PIN</small> <small>PIN</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
{{ $human->pid ?? '-' }} {{ $birth_human->pid ?? '-' }}
</p> </p>
</div> </div>
<div class="col-3"> <div class="col-3">
<small>First name</small> <small>First name</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
{{ $human->name ?? '-' }} {{ $birth_human->name ?? '-' }}
</p> </p>
</div> </div>
<div class="col-3"> <div class="col-3">
<small>Other names</small> <small>Other names</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
{{ $human->last_name ?? '-' }} {{ $birth_human->last_name ?? '-' }}
</p> </p>
</div> </div>
<div class="col-3"> <div class="col-3">
<small>Sur name</small> <small>Sur name</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
{{ $human->surn ?? '-' }} {{ $birth_human->surn ?? '-' }}
</p> </p>
</div> </div>
...@@ -43,20 +43,20 @@ ...@@ -43,20 +43,20 @@
<div class="col-3"> <div class="col-3">
<small>ID Number</small> <small>ID Number</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
{{ $human->o_pid ?? '-' }} {{ $birth_human->o_pid ?? '-' }}
</p> </p>
</div> </div>
<div class="col-3"> <div class="col-3">
<small>Gender</small> <small>Gender</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
{{ $human->sex ?? '-' }} {{ $birth_human->sex ?? '-' }}
</p> </p>
</div> </div>
<div class="col-3"> <div class="col-3">
<small>Date of Birth</small> <small>Date of Birth</small>
<p class="field-value user-field-data"> <p class="field-value user-field-data">
@if(isset($human->date_birth)) @if(isset($birth_human->date_birth))
{{ Carbon::parse($human->date_birth)->format("d-m-Y") }} {{ Carbon::parse($birth_human->date_birth)->format("d-m-Y") }}
@else @else
- -
@endif @endif
......
@php use Carbon\Carbon; @php
use Carbon\Carbon;
$currentDate = Carbon::now()->format('d-m-Y');
@endphp @endphp
@foreach($passport as $human_passport) @foreach($passport as $human_passport)
...@@ -14,8 +16,6 @@ ...@@ -14,8 +16,6 @@
@endif @endif
</x-adminlte-card> </x-adminlte-card>
<div class="row" style="width: 100%;"> <div class="row" style="width: 100%;">
@if($role->hasPermissionTo("Basic View ID Details")) @if($role->hasPermissionTo("Basic View ID Details"))
<div class="col-12 text-center"> <div class="col-12 text-center">
@if(isset($human_passport->identity_card_no)) @if(isset($human_passport->identity_card_no))
...@@ -168,14 +168,31 @@ ...@@ -168,14 +168,31 @@
<td> <td>
@if(isset($human_passport->expiry_date)) @if(isset($human_passport->expiry_date))
<p class="field-value">{{ Carbon::parse($human_passport->expiry_date)->format("d-m-Y") }}</p> <p class="field-value">{{ Carbon::parse($human_passport->expiry_date)->format("d-m-Y") }}</p>
@php
$doc_date = Carbon::parse($human_passport->expiry_date)->format("d-m-Y") ?? '';
@endphp
@else @else
- -
@endif @endif
</td> </td>
<td> <td>
@if(isset($human_passport->expiry_date)) @if(isset($human_passport->expiry_date))
<span class="badge badge-secondary"> @if ($doc_date < $currentDate)
<i class="fa fa-check-circle"></i>Current</span> <h4>
<span class="badge badge-danger">
EXPIRED
</span>
</h4>
@else
<h4>
<span class="badge badge-success">
<i class="fa fa-check-circle"></i>
Current
</span>
</h4>
@endif
@else @else
<div class="skeleton skeleton-text short"></div> <div class="skeleton skeleton-text short"></div>
@endif @endif
...@@ -188,13 +205,7 @@ ...@@ -188,13 +205,7 @@
</div> </div>
<style> <style>
.idDocimg{
background-image:url("../images/national_ID.png");
background-size: 30rem;
width: 80vw;
height: 25vh;
background-repeat: no-repeat
}
.skeleton-img{ .skeleton-img{
padding: 8rem; padding: 8rem;
} }
......
...@@ -6,12 +6,13 @@ ...@@ -6,12 +6,13 @@
$modalStatus= 'show'; $modalStatus= 'show';
$modalStyle="display: block;"; $modalStyle="display: block;";
} }
$fname = $passport['first_names'] ?? ''; $fname = $passport[0]['first_names'] ?? '';
$sname = $passport['last_name'] ?? ''; $sname = $passport[0]['last_name'] ?? '';
@endphp @endphp
<x-adminlte-modal id="searchModalPassport" class="{{ $modalStatus }}" style="{{ $modalStyle }}" size="lg" title="Passport Details: {{ $fname }} {{ $sname }}" v-centered static-backdrop scrollable>
<x-adminlte-modal id="searchModalPassport" class="{{ $modalStatus }}" style="{{ $modalStyle }}" size="lg"
title="Passport for: {{ $fname }} {{ $sname }}" v-centered static-backdrop scrollable>
<div class="modal-body"> <div class="modal-body">
<ul class="nav nav-tabs" id="custom-tabs-four-tab" role="tablist"> <ul class="nav nav-tabs" id="custom-tabs-four-tab" role="tablist">
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div class="row"> <div class="row">
<x-adminlte-card theme="lightblue" theme-mode="outline"> <x-adminlte-card theme="lightblue" theme-mode="outline">
<div> <div>
<h5>Searched for: {{ $doctype }} record.</h5> <h5>Searched for: <strong>{{ $doctype }} </strong></h5>
<small>Requested: </small> <small>Requested: </small>
<strong>{{ $search_count }} Record(s)</strong> <strong>{{ $search_count }} Record(s)</strong>
</div> </div>
...@@ -88,7 +88,23 @@ ...@@ -88,7 +88,23 @@
default: default:
$docNumTitle='Doc Number'; $docNumTitle='Doc Number';
} }
if($doctype === 'ID')
{
$headings = [
'Maisha Num.',
'Serial Num.',
'First Name',
'Other Name',
'Sur Name',
'Nationality',
'Gender',
'Date of Birth',
'Date of Issue',
'Date of Expiry',
'Action'
];
$count=0;
}
if($doctype === 'Passport') if($doctype === 'Passport')
{ {
$headings = [ $headings = [
...@@ -104,17 +120,17 @@ ...@@ -104,17 +120,17 @@
'Action' 'Action'
]; ];
$count=0; $count=0;
} else{ }
if($doctype === 'Birth') {
$headings = [ $headings = [
'ID number', 'Entry Number',
$docNumTitle,
'First name', 'First name',
'Other names', 'Other names',
'Sur name', 'Sur name',
'Nationality', 'COB',
'Gender', 'Gender',
'Date of birth', 'Date of birth',
'Action' 'Details'
]; ];
$count=0; $count=0;
} }
...@@ -123,31 +139,27 @@ ...@@ -123,31 +139,27 @@
<x-adminlte-datatable id="clients-table searchResultsCard" :heads="$headings" striped hoverable bordered> <x-adminlte-datatable id="clients-table searchResultsCard" :heads="$headings" striped hoverable bordered>
@foreach($humans as $human) @foreach($humans as $human)
@if($doctype === 'Birth') @if($doctype === 'Birth')
<tr> <tr>
<td>
<h4 class="text-black">{{ $doc_human['o_pid'] ?? '-' }}</h4>
</td>
<td> <td>
<h4 class="text-info">{{ $serial_number[$count] ?? '-' }}</h4> <h4 class="text-info">{{ $serial_number[$count] ?? '-' }}</h4>
</td> </td>
<td> <td>
{{ $doc_human['name'] ?? '-' }} {{ $human['name'] ?? '-' }}
</td> </td>
<td> <td>
{{ $doc_human['last_name'] ?? '-' }} {{ $human['last_name'] ?? '-' }}
</td> </td>
<td> <td>
{{ $doc_human['surn'] ?? '-' }} {{ $human['surn'] ?? '-' }}
</td> </td>
<td> <td>
KENYAN <span class="fi fi-ke" style="font-size: 1rem;"></span> KEN
</td> </td>
<td> <td>
{{ $doc_human['sex'] ?? '-' }} {{ $human['sex'] ?? '-' }}
</td> </td>
<td></td> <td> {{ Carbon::parse($human['date_birth'])->format("d-m-Y") ?? '-' }}</td>
<td> <td>
<x-adminlte-button <x-adminlte-button
label="Details" label="Details"
...@@ -226,7 +238,7 @@ ...@@ -226,7 +238,7 @@
{{ $doc_human['surn'] ?? '-' }} {{ $doc_human['surn'] ?? '-' }}
</td> </td>
<td> <td>
KENYAN <span class="fi fi-ke" style="font-size: 1rem;"></span> KEN <span class="fi fi-ke" style="font-size: 1rem;"></span>
</td> </td>
<td> <td>
{{ $doc_human['sex'] ?? '-' }} {{ $doc_human['sex'] ?? '-' }}
...@@ -234,6 +246,12 @@ ...@@ -234,6 +246,12 @@
<td> <td>
{{ Carbon::parse($doc_human['date_birth'])->format("d-m-Y") ?? '-' }} {{ Carbon::parse($doc_human['date_birth'])->format("d-m-Y") ?? '-' }}
</td> </td>
<td>
-
</td>
<td>
-
</td>
<td> <td>
<x-adminlte-button <x-adminlte-button
label="Details" label="Details"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment