Skip to content

Commit

Permalink
revised the initial page and added facility directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald-pro committed Jan 26, 2024
1 parent f34a318 commit 598f215
Show file tree
Hide file tree
Showing 7 changed files with 412 additions and 100 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function redirectTo() {
Session::flash('statuscode', 'success');
return '/admin/dashboard';
}else {
return '/';
return '/login';
}
}
/**
Expand Down
28 changes: 28 additions & 0 deletions app/Http/Controllers/DirectoryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;

class DirectoryController extends Controller
{
public function directory(Request $request, $facility)
{
$mfl = implode('', range(0, 9));

$apiUrl = env('ART_URL') . "directory/{$mfl}/{$facility}";

$response = Http::get($apiUrl);

if ($response->successful()) {

$apiData = $response->json();
return response()->json($apiData);
} else {

$errorData = $response->json();
return response()->json(['error' => 'API request failed'], $response->status());
}
}
}
12 changes: 10 additions & 2 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
</head>

<body>
<div class="left-end" style="margin-top: 20px; margin-left: 20px;">
<a href="{{ url('/') }}" style="text-decoration: none; color: #333; display: flex; align-items: center;">
<i class="fas fa-chevron-left" style="margin-right: 5px;"></i> Go back
</a>
</div>

<div class="auth-layout-wrap">
<div class="auth-content">
<div class="card o-hidden">
Expand All @@ -22,7 +28,9 @@
<img src="{{ asset('/assets/images/Ushauri_big.png') }}" style="margin-left: 230px;" height="40">

</div>
<div class="text-center"> <h4>Login</h4> </div>
<div class="text-center">
<h4>Login</h4>
</div>

<form method="POST" id="login_form" action="{{ route('login') }}">
@csrf
Expand Down Expand Up @@ -131,4 +139,4 @@
</body>
</html>
</html>
189 changes: 93 additions & 96 deletions resources/views/clients/adolescents_clients.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,114 +6,111 @@

@section('main-content')
<div class="breadcrumb">
<ul>
<li><a href="">Adolescent Clients</a></li>
<li></li>
</ul>
</div>
<ul>
<li><a href="">Adolescent Clients</a></li>
<li></li>
</ul>
</div>

<div class="col-md-12 mb-4">
<div class="card text-left">
<div class="card text-left">

<div class="card-body">
<! <h4 class="card-title mb-3">ADOLESCENT Grouping List</h4>
<div class="col-md-12" style="margin-top:10px; ">
<div class="card-body">
<! <h4 class="card-title mb-3">ADOLESCENT Grouping List</h4>
<div class="col-md-12" style="margin-top:10px; ">

</div>
<div class="table-responsive">
<table id="multicolumn_ordering_table" class="display table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>No.</th>
<th>Clinic Number</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Phone No</th>
<th>Grouping</th>
<th>Treatment</th>
<th>Date Enrolled</th>

</tr>
</thead>
<tbody>
@if (count($all_adolescents_clients) > 0)
@foreach($all_adolescents_clients as $result)
<tr>
<td> {{ $loop->iteration }}</td>
<td> {{$result->clinic_number}}</td>
<td> {{$result->f_name}}</td>
<td> {{$result->m_name}}</td>
<td> {{$result->l_name}}</td>
<td> {{$result->phone_no}}</td>
<td> {{$result->name}}</td>
<td> {{$result->client_status}}</td>
<td> {{$result->enrollment_date}}</td>
</tr>
@endforeach
@endif
</tbody>
</div>
<div class="table-responsive">
<table id="multicolumn_ordering_table" class="display table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>No.</th>
<th>Clinic Number</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Phone No</th>
<th>Grouping</th>
<th>Treatment</th>
<th>Date Enrolled</th>

</table>
</tr>
</thead>
<tbody>
@if (count($all_adolescents_clients) > 0)
@foreach($all_adolescents_clients as $result)
<tr>
<td> {{ $loop->iteration }}</td>
<td> {{$result->clinic_number}}</td>
<td> {{$result->f_name}}</td>
<td> {{$result->m_name}}</td>
<td> {{$result->l_name}}</td>
<td> {{$result->phone_no}}</td>
<td> {{$result->name}}</td>
<td> {{$result->client_status}}</td>
<td> {{$result->enrollment_date}}</td>
</tr>
@endforeach
@endif
</tbody>

</div>
</table>

</div>
</div>
</div>
<!-- end of col -->

</div>
</div>
</div>
<!-- end of col -->

@endsection

@section('page-js')

<script src="{{asset('assets/js/vendor/datatables.min.js')}}"></script>
<script type="text/javascript">
// multi column ordering
$('#multicolumn_ordering_table').DataTable({
columnDefs: [{
targets: [0],
orderData: [0, 1]
}, {
targets: [1],
orderData: [1, 0]
}, {
targets: [4],
orderData: [4, 0]
}],
"paging": true,
"responsive":true,
"ordering": true,
"info": true,
dom: 'Bfrtip',
buttons: [
{
extend: 'copy',
title: 'Active LTFU Appointments',
filename: 'Active LTFU Appointments'
},
{
extend: 'csv',
title: 'ADOLESCENT CLIENTS',
filename: 'ADOLESCENT'
},
{
extend: 'excel',
title: 'ADOLESCENT CLIENTS',
filename: 'ADOLESCENT'
},
{
extend: 'pdf',
title: 'ADOLESCENT CLIENTS',
filename: 'ADOLESCENT'
},
{
extend: 'print',
title: 'ADOLESCENT CLIENTS',
filename: 'ADOLESCENT'
}
]
});</script>
<script src="{{asset('assets/js/vendor/datatables.min.js')}}"></script>
<script type="text/javascript">
// multi column ordering
// multi column ordering
$(document).ready(function() {
$('#multicolumn_ordering_table').DataTable({
columnDefs: [{
targets: [0],
orderData: [0, 1]
},
{
targets: [1],
orderData: [1, 0]
},
{
targets: [2],
orderData: [2, 0]
}
],
"paging": true,
"responsive": true,
"ordering": true,
"info": true,
"lengthMenu": [5, 10, 25], // Set the desired values for the number of entries per page
dom: 'Bfrtip',
buttons: [{
extend: 'copy'
},
{
extend: 'csv'
},
{
extend: 'excel'
},
{
extend: 'pdf'
},
{
extend: 'print'
}
]
});
});
</script>


@endsection
@endsection
Loading

0 comments on commit 598f215

Please sign in to comment.