Skip to content

Commit

Permalink
UI adjustments on lists of consumer, services lists, officers, accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
darksidebug committed Sep 27, 2021
1 parent bfdcb81 commit 9c4a45e
Show file tree
Hide file tree
Showing 12 changed files with 151 additions and 130 deletions.
4 changes: 3 additions & 1 deletion app/Http/Controllers/WorkOrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Service;

class WorkOrderController extends Controller
{
public function index()
{
return view('pages.work-order');
$services = Service::where('status', 'ready');
return view('pages.work-order', ['services' => $services]);
}
}
3 changes: 2 additions & 1 deletion app/Models/Officer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Officer extends Model

protected static $positions =
[
'internal_auditor_i' => 'Internal Auditor I'
'internal_auditor_i' => 'Internal Auditor I',
'municipal_engineer' => 'Municipal Engineer'
];


Expand Down
2 changes: 1 addition & 1 deletion app/Models/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function getServiceTypes()
return self::$serviceTypes;
}

public function prettyServiceType()
public function prettyServiceType()
{
return self::$serviceTypes[$this->type_of_service];
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/pages/consumer-data-entry.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<small id="error-purchase-option" class="text-danger">
</div>
</div>
<div class="row">
<div class="row mb-4">
<div class="col-12 col-md-5 col-lg-4">
<label for=""><small class="text-muted">Meter Serial Number</small></label>
<input type="text" name="meter_serial_number" id="meter_serial_number" class="form-control mt-2" placeholder="XXXXXX">
Expand Down
46 changes: 24 additions & 22 deletions resources/views/pages/customers-list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
</div>
</form>
</div>
<div class="col-lg-7 col-md-5 col-sm-4" align="right">
<div class="col-lg-7 col-md-5 col-sm-4 pb-0" align="right">
@if(isset($keyword))
<small>
<a class="btn btn-primary mb-3 pb-2 pt-2" href="{{route('admin.customers')}}"><i data-feather="align-center" class="feather-20 mx-1 pb-1 pt-1"></i> Show all</a>
</small>
<a class="btn btn-primary mb-3 pb-2 pt-2 mb-0" href="{{route('admin.existing-customers.index')}}"><i data-feather="align-center" class="feather-20 mx-1 pb-1 pt-1"></i> Show all</a>
@endif
</div>
</div>
Expand All @@ -50,41 +48,45 @@

@foreach ($customers as $customer)
<tr style="cursor: pointer;" onclick='location.href=`{{ route("admin.search-transactions", ["account_number" => $customer->account_number]) }}`'>
<td class="text-primary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} "><strong>{{$customer->account_number}}</strong></td>
<td class="text-primary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} "><strong>{{$customer->account_number}}</strong></td>
@if($customer->isOrgAccount())
<td class="text-secondary border-secondary {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">
<td class="text-secondary border-secondary {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">
ORG/COMPANY: <strong>{{$customer->org_name}}</strong><br>
<small class="text-muted">Registered by ({{$customer->fullname()}})</small>
</td>
@else
<td class="text-secondary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">{{$customer->firstname . ' ' .$customer->middlename. ' '.$customer->lastname}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">{{$customer->firstname . ' ' .$customer->middlename. ' '.$customer->lastname}}</td>
@endif

<td class="text-secondary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">{{Str::ucfirst($customer->civil_status)}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">{{$customer->contact_number}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">{{$customer->purok.', '.$customer->barangay}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">{{Str::ucfirst($customer->connection_type)}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 2) ? 'border-bottom-0' : '' }} ">{{Str::ucfirst($customer->connection_status)}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">{{Str::ucfirst($customer->civil_status)}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">{{$customer->contact_number}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">{{$customer->purok.', '.$customer->barangay}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">{{Str::ucfirst($customer->connection_type)}}</td>
<td class="text-secondary border-top {{ ($customers->count() < 10) ? 'border-bottom-0' : '' }} ">{{Str::ucfirst($customer->connection_status)}}</td>
</tr>
@endforeach
@else
<tr>
<td class="text-center text-secondary py-3 border-top {{ ($customers->count() < 1) ? 'border-bottom-0' : '' }}" colspan="7"><i data-feather="user-x" class="feather-20 me-1"></i> No records to display</td>
<td class="text-center text-secondary py-3 border-top {{ $customers->count() < 1 ? 'border-bottom-0' : '' }}" colspan="7"><i data-feather="user-x" class="feather-20 me-1"></i> No records to display</td>
</tr>
@endif
</tbody>
</table>

</div>

</div>
</div>

</div>
{{-- Export link --}}
@if($customers->count()>0)
<div class="pt-2">
<a href="{{route('admin.customers.export',['keyword'=>isset($keyword)?$keyword:''])}}" class="btn btn-secondary py-2"><i data-feather="download" class="feather-20 me-1 pb-1"></i> Export Data</a>
<div class="row">
<div class="col-md-6 pt-2">
{{ $customers->render() }}
</div>
<div class="col-md-6">
{{-- Export link --}}
@if($customers->count()>0)
<div class="pt-2">
<a href="{{route('admin.customers.export',['keyword'=>isset($keyword)?$keyword:''])}}" class="btn btn-secondary py-2 float-end"><i data-feather="download" class="feather-20 me-1 pb-1"></i> Export Data</a>
</div>
@endif
</div>
</div>
@endif
</div>
@endsection
74 changes: 38 additions & 36 deletions resources/views/pages/officers/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,49 @@

@section('content')

<div class="row mt-3 justify-content-center">

<div class="row mt-5 justify-content-center">
<div class="col-12 col-md-8 col-lg-5 col-xl-4">
<h3 class='text-center mt-3'>New Officer</h3>
<form action="{{route('admin.officers.store')}}" class="mt-5" method="post">
@csrf
<div class="mb-2">
<span class="form-label">Full Name</span>
<input type="text" class="form-control mt-0 @error('fullname') is-invalid @enderror" placeholder="John Doe" name='fullname' value="{{old('fullname')}}">
@error('fullname')
<div class="invalid-feedback">
{{$message}}
</div>
@enderror
<div class="card">
<div class="card-header">
<h4 class='text-center mt-2'><i data-feather="user-plus" class="mb-1"></i> New Officer</h4>
</div>
<div class="card-body">
<form action="{{route('admin.officers.store')}}" class="mt-2" method="post">
@csrf
<div class="mb-2">
<span class="form-label">Full Name</span>
<input type="text" class="form-control mt-0 @error('fullname') is-invalid @enderror" placeholder="John Doe" name='fullname' value="{{old('fullname')}}">
@error('fullname')
<div class="invalid-feedback">
{{$message}}
</div>
@enderror
</div>

<div class="mb-2">
<span class="form-label">Position</span>
<select class="form-select @error('position') is-invalid @enderror" name="position">
<option value="">--Select one--</option>
@foreach($positions as $key=>$value)
@if (old('position') == $key)
<option value="{{$key}}" selected>{{$value}}</option>
@else
<option value="{{$key}}">{{$value}}</option>
@endif
@endforeach
</select>
@error('position')
<div class="invalid-feedback">
{{$message}}
<div class="mb-2">
<span class="form-label">Position</span>
<select class="form-select @error('position') is-invalid @enderror" name="position">
<option value="">--Select one--</option>
@foreach($positions as $key=>$value)
@if (old('position') == $key)
<option value="{{$key}}" selected>{{$value}}</option>
@else
<option value="{{$key}}">{{$value}}</option>
@endif
@endforeach
</select>
@error('position')
<div class="invalid-feedback">
{{$message}}
</div>
@enderror
</div>
@enderror
<center>
<button type="submit" class="btn btn-primary mt-4"><i data-feather="edit-3" class="feather-18 me-1 mb-1"></i>Add Officer</button>
</center>
</form>
</div>



<center>
<button type="submit" class="btn btn-primary mt-4"><i data-feather="edit-3" class="feather-18 me-1 mb-1"></i>Add Officer</button>
</center>
</form>
</div>
</div>
</div>

Expand Down
84 changes: 43 additions & 41 deletions resources/views/pages/officers/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,54 @@

@section('content')

<div class="row mt-3 justify-content-center">

<div class="row mt-5 justify-content-center">
<div class="col-12 col-md-8 col-lg-5 col-xl-4">
<h3 class='text-center mt-3'>Update Officer</h3>
<form action="{{route('admin.officers.update', $officer)}}" class="mt-5" method="post">
@csrf
@method('PUT')
<div class="mb-2">
<span class="form-label">Full Name</span>
<input type="text" class="form-control mt-0 @error('fullname') is-invalid @enderror" placeholder="John Doe" name='fullname' value="{{old('fullname')?? $officer->fullname}}">
@error('fullname')
<div class="invalid-feedback">
{{$message}}
</div>
@enderror
<div class="card">
<div class="card-header">
<h4 class='text-center mt-2'><i data-feather="edit" class="mb-1"></i> Update Officer</h4>
</div>
<div class="card-body">
<form action="{{route('admin.officers.update', $officer)}}" class="mt-5" method="post">
@csrf
@method('PUT')
<div class="mb-2">
<span class="form-label">Full Name</span>
<input type="text" class="form-control mt-0 @error('fullname') is-invalid @enderror" placeholder="John Doe" name='fullname' value="{{old('fullname')?? $officer->fullname}}">
@error('fullname')
<div class="invalid-feedback">
{{$message}}
</div>
@enderror
</div>

<div class="mb-2">
<span class="form-label">Position</span>
<select class="form-select @error('position') is-invalid @enderror" name="position">
<option value="">--Select one--</option>
@foreach($positions as $key=>$value)
@if ($officer->position == $key)
<option value="{{$key}}" selected>{{$value}}</option>
@else
@if (old('position') == $key)
<option value="{{$key}}" selected>{{$value}}</option>
@else
<option value="{{$key}}">{{$value}}</option>
@endif
@endif
@endforeach
</select>
@error('position')
<div class="invalid-feedback">
{{$message}}
<div class="mb-2">
<span class="form-label">Position</span>
<select class="form-select @error('position') is-invalid @enderror" name="position">
<option value="">--Select one--</option>
@foreach($positions as $key=>$value)
@if ($officer->position == $key)
<option value="{{$key}}" selected>{{$value}}</option>
@else
@if (old('position') == $key)
<option value="{{$key}}" selected>{{$value}}</option>
@else
<option value="{{$key}}">{{$value}}</option>
@endif
@endif
@endforeach
</select>
@error('position')
<div class="invalid-feedback">
{{$message}}
</div>
@enderror
</div>
@enderror
<center>
<button type="submit" class="btn btn-primary mt-4"><i data-feather="edit-3" class="feather-18 me-1 mb-1"></i>Update Officer</button>
</center>
</form>
</div>



<center>
<button type="submit" class="btn btn-primary mt-4"><i data-feather="edit-3" class="feather-18 me-1 mb-1"></i>Update Officer</button>
</center>
</form>
</div>
</div>
</div>

Expand Down
12 changes: 9 additions & 3 deletions resources/views/pages/officers/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@

@section('content')

<div class="row">
<div class="row mt-4">
<div class="col-md-8 col-lg-12 mt-3">
@if(session('created'))
<div class="alert alert-success alert-dismissible fade show mt-4" role="alert">
<strong>Great!</strong> {{session('message')}}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
@endif
<h3 >List of Officers</h3>
<a class="btn btn-primary mb-3 pb-2 pt-2 mt-2" href="{{route('admin.officers.create')}}"><i data-feather="user-plus" class="feather-20 mx-1 pb-1 pt-1"></i> New Officer</a>
<div class="row">
<div class="col-md-6">
<h5 class="text-secondary h4 mt-4"><i data-feather="align-right" class="mb-1 feather-30 me-1"></i> Lists of Officers</h5>
</div>
<div class="col-md-6">
<a class="btn btn-primary mb-3 pb-2 pt-2 mt-2 float-end" href="{{route('admin.officers.create')}}"><i data-feather="user-plus" class="feather-20 mx-1 pb-1 pt-1"></i> New Officer</a>
</div>
</div>
<div class="card">
<div class="table-responsive mb-0">
<table class="table mb-0">
Expand Down
19 changes: 12 additions & 7 deletions resources/views/pages/services-list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="col-md-12 mt-4">
<div class="row">
<div class="col-md-8 py-0">
<h3 class="mt-4"><i data-feather="align-left"></i> List of Services</h3>
<h5 class="text-secondary h4 mt-4"><i data-feather="align-right" class="mb-1 feather-30 me-1"></i> Lists of Services</h5>
</div>
<div class="col-md-4 pt-md-3">
<form action="{{ route('admin.services.filter')}}" class="d-flex justify-content-start mb-2" method="get">
Expand Down Expand Up @@ -52,11 +52,7 @@
<form action="{{route("admin.services.destroy",$service)}}" method="post" class="mb-0">
@csrf
@method("DELETE")
<<<<<<< HEAD
<button type="submit" class="btn-link border-0 bg-white"
=======
<button type="submit" class="btn btn-link"
>>>>>>> d4bc8c08d76695cabfb90ae11e0167ae85fb7e2b
onclick="return confirm('Are you sure you want to delete this? You cannot undo this action')">
Delete
</button>
Expand All @@ -66,14 +62,23 @@
</tr>
@empty
<tr>
<td colspan="6" class="text-center border-top border-bottom-0">No records yet!</td>
<td colspan="7" class="text-center border-top border-bottom-0">No records yet!</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
{{$services->render()}}
<div class="row">
<div class="col-md-6">
{{$services->render()}}
</div>
<div class="col-md-6">
@if(request()->filter == "ready" && count($services) > 0)
<a href="{{ route('admin.workorder') }}" class="btn btn-secondary btn-lg rounded-sm float-end mt-2"><i data-feather="printer" class="feather-18 mb-1 me-1"></i> Print WOR</a>
@endif
</div>
</div>
</div>
</div>
@endsection
Expand Down
2 changes: 1 addition & 1 deletion resources/views/pages/users/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</tr>
@empty
<tr>
<td colspan="2" class="text-center border-top border-bottom-0">No records yet!</td>
<td colspan="4" class="text-center border-top border-bottom-0">No records yet!</td>
</tr>
@endforelse
</tbody>
Expand Down
Loading

0 comments on commit 9c4a45e

Please sign in to comment.