fix(maintainability): resolve F-15 — remove all commented-out dead code blocks
This commit is contained in:
@@ -20,12 +20,6 @@ class AlertController extends Controller
|
|||||||
$level = $request->level;
|
$level = $request->level;
|
||||||
$stationtype = $request->stationtype;
|
$stationtype = $request->stationtype;
|
||||||
|
|
||||||
// $topic = match($level){
|
|
||||||
// 'Warning' => env('FCM_TOPIC_RAINFALL_WARNING'),
|
|
||||||
// 'Danger' => env('FCM_TOPIC_RAINFALL_DANGER'),
|
|
||||||
// default => env('FCM_TOPIC_RAINFALL_WARNING')
|
|
||||||
// };
|
|
||||||
|
|
||||||
$topic = env('FCM_TOPIC_RAINFALL_WARNING');
|
$topic = env('FCM_TOPIC_RAINFALL_WARNING');
|
||||||
|
|
||||||
if($stationtype == 1)
|
if($stationtype == 1)
|
||||||
|
|||||||
@@ -214,22 +214,6 @@ class RainfallController extends Controller
|
|||||||
->orderBy('timestamp')
|
->orderBy('timestamp')
|
||||||
->get();
|
->get();
|
||||||
return response()->json($graphData);
|
return response()->json($graphData);
|
||||||
|
|
||||||
// $graphData = DB::table('rainfall')
|
|
||||||
// ->select(
|
|
||||||
// DB::raw("DATE(timestamp) as date"),
|
|
||||||
// DB::raw("TO_CHAR(timestamp, 'HH24:MI') AS time_slot"),
|
|
||||||
// 'currentrf'
|
|
||||||
// )
|
|
||||||
// ->where('stationid', $stationid)
|
|
||||||
// ->whereBetween('timestamp', [
|
|
||||||
// now()->subDays(7)->startOfDay(),
|
|
||||||
// now()->endOfDay()
|
|
||||||
// ])
|
|
||||||
// ->whereRaw("EXTRACT(MINUTE FROM timestamp) % 5 = 0") // only multiples of 5 minutes
|
|
||||||
// ->orderBy('timestamp')
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function retrieve data of 6 Hours Rainfall fo Graph Page
|
// Function retrieve data of 6 Hours Rainfall fo Graph Page
|
||||||
@@ -293,8 +277,6 @@ class RainfallController extends Controller
|
|||||||
//Return View Graph Page
|
//Return View Graph Page
|
||||||
public function graphPage($stationid,$dates)
|
public function graphPage($stationid,$dates)
|
||||||
{
|
{
|
||||||
// $station = DB::table('station')->where('stationid',$stationid)->first();
|
|
||||||
|
|
||||||
return view('layout.graph.rainfall',compact('stationid','dates'));
|
return view('layout.graph.rainfall',compact('stationid','dates'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,28 +10,12 @@ class cctvController extends Controller
|
|||||||
// Function Display Station CCTV LINK
|
// Function Display Station CCTV LINK
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
// $stationdata = DB::select("
|
|
||||||
// SELECT s.*, w.*
|
|
||||||
// FROM station s
|
|
||||||
// INNER JOIN waterlevel w
|
|
||||||
// ON s.stationid = w.stationid
|
|
||||||
// INNER JOIN (
|
|
||||||
// SELECT stationid, MAX(datetime) AS latest_datetime
|
|
||||||
// FROM waterlevel
|
|
||||||
// GROUP BY stationid
|
|
||||||
// ) latest ON w.stationid = latest.stationid
|
|
||||||
// AND w.datetime = latest.latest_datetime
|
|
||||||
// WHERE s.cctv_link IS NOT NULL
|
|
||||||
// ORDER BY s.name ASC
|
|
||||||
// ");
|
|
||||||
|
|
||||||
$stationdata = DB::select("
|
$stationdata = DB::select("
|
||||||
SELECT name,district,cctv_link FROM station
|
SELECT name,district,cctv_link FROM station
|
||||||
WHERE cctv_link IS NOT NULL AND waterlevel = 1
|
WHERE cctv_link IS NOT NULL AND waterlevel = 1
|
||||||
ORDER BY name ASC
|
ORDER BY name ASC
|
||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
return view('layout.cctv',compact('stationdata'));
|
return view('layout.cctv',compact('stationdata'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,5 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
// URL::forceScheme('https');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">No</th>
|
<th scope="col">No</th>
|
||||||
<!-- <th scope="col">User ID</th> -->
|
|
||||||
<th scope="col" id="colemail">Username</th>
|
<th scope="col" id="colemail">Username</th>
|
||||||
<th scope="col">@lang('messages.email')</th>
|
<th scope="col">@lang('messages.email')</th>
|
||||||
<th scope="col" >@lang('messages.position')</th>
|
<th scope="col" >@lang('messages.position')</th>
|
||||||
@@ -72,7 +71,6 @@
|
|||||||
@foreach ($users as $row)
|
@foreach ($users as $row)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{$loop->iteration}}</td>
|
<td>{{$loop->iteration}}</td>
|
||||||
<!-- <td>{{$row->id}}</td> -->
|
|
||||||
<td>{{$row->name}}</td>
|
<td>{{$row->name}}</td>
|
||||||
<td id="colemail">{{$row->email}}</td>
|
<td id="colemail">{{$row->email}}</td>
|
||||||
@php
|
@php
|
||||||
@@ -273,9 +271,6 @@
|
|||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
{{-- <li class="page-item"><a class="page-link" href="#">1</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li> --}}
|
|
||||||
@if ($users->hasMorePages())
|
@if ($users->hasMorePages())
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="{{$users->nextPageUrl()}}" aria-label="Next" id="next">
|
<a class="page-link" href="{{$users->nextPageUrl()}}" aria-label="Next" id="next">
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h4 class="mt-5 ">Stations</h4>
|
<h4 class="mt-5 ">Stations</h4>
|
||||||
<!-- <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d127071.91411927756!2d100.77121329673002!3d5.567411678415902!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x31b4d862dcfb67bd%3A0xa2e4a237f2afe25c!2sSungai%20Kupang!5e0!3m2!1sen!2smy!4v1736758450906!5m2!1sen!2smy" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"
|
|
||||||
class="objext-fit-cover rounded"></iframe> -->
|
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,25 +46,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{-- @guest
|
|
||||||
<button class="btn btn-dark " data-bs-toggle="modal" data-bs-target="#modallogin">Log In</button>
|
|
||||||
@else
|
|
||||||
<div class="d-flex align-items-center gap-2">
|
|
||||||
<span class="text-dark fw-semibold">
|
|
||||||
{{ Auth::user()->name }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<form action="{{ route('logout') }}" method="post" class="m-0 ps-2">
|
|
||||||
@csrf
|
|
||||||
<button type="submit" class="btn btn-dark">
|
|
||||||
Logout
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@endguest --}}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -150,12 +150,6 @@
|
|||||||
<td id="colhourlyrf">{{$row ->hour2_value}}</td>
|
<td id="colhourlyrf">{{$row ->hour2_value}}</td>
|
||||||
<td id="colhourlyrf">{{$row ->hour1_value}}</td>
|
<td id="colhourlyrf">{{$row ->hour1_value}}</td>
|
||||||
|
|
||||||
<!-- <td>
|
|
||||||
<a href="{{ route('threshold.graph', ['stationid' => $row->stationid, 'dates' => $row->last_update]) }}"
|
|
||||||
class="btn btn-outline-dark btn-sm">
|
|
||||||
<i class='bx bx-line-chart'></i>
|
|
||||||
</a>
|
|
||||||
</td> -->
|
|
||||||
@foreach($hours as $i => $value)
|
@foreach($hours as $i => $value)
|
||||||
@if($allHours)
|
@if($allHours)
|
||||||
<td>{{ $runningAvg[$i] }}</td>
|
<td>{{ $runningAvg[$i] }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user