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;
|
||||
$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');
|
||||
|
||||
if($stationtype == 1)
|
||||
|
||||
@@ -214,22 +214,6 @@ class RainfallController extends Controller
|
||||
->orderBy('timestamp')
|
||||
->get();
|
||||
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
|
||||
@@ -293,8 +277,6 @@ class RainfallController extends Controller
|
||||
//Return View Graph Page
|
||||
public function graphPage($stationid,$dates)
|
||||
{
|
||||
// $station = DB::table('station')->where('stationid',$stationid)->first();
|
||||
|
||||
return view('layout.graph.rainfall',compact('stationid','dates'));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,28 +10,12 @@ class cctvController extends Controller
|
||||
// Function Display Station CCTV LINK
|
||||
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("
|
||||
SELECT name,district,cctv_link FROM station
|
||||
WHERE cctv_link IS NOT NULL AND waterlevel = 1
|
||||
ORDER BY name ASC
|
||||
");
|
||||
|
||||
|
||||
return view('layout.cctv',compact('stationdata'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,5 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// URL::forceScheme('https');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">No</th>
|
||||
<!-- <th scope="col">User ID</th> -->
|
||||
<th scope="col" id="colemail">Username</th>
|
||||
<th scope="col">@lang('messages.email')</th>
|
||||
<th scope="col" >@lang('messages.position')</th>
|
||||
@@ -72,7 +71,6 @@
|
||||
@foreach ($users as $row)
|
||||
<tr>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<!-- <td>{{$row->id}}</td> -->
|
||||
<td>{{$row->name}}</td>
|
||||
<td id="colemail">{{$row->email}}</td>
|
||||
@php
|
||||
@@ -273,9 +271,6 @@
|
||||
</li>
|
||||
@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())
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{$users->nextPageUrl()}}" aria-label="Next" id="next">
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
<div class="container">
|
||||
<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>
|
||||
|
||||
@@ -46,25 +46,6 @@
|
||||
</ul>
|
||||
|
||||
</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>
|
||||
|
||||
|
||||
@@ -150,12 +150,6 @@
|
||||
<td id="colhourlyrf">{{$row ->hour2_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)
|
||||
@if($allHours)
|
||||
<td>{{ $runningAvg[$i] }}</td>
|
||||
|
||||
Reference in New Issue
Block a user