|
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/ |
<?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 CustomerReportController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index($date_from, $date_to)
{
$breadcrumbs = [
['link' => "dashboard", 'name' => "Dashboard"], ['link' => "report/customer/-/-", 'name' => "Report Customer"]
];
$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 = Request::input('date_from') ? date('Y-m-d', strtotime(Request::input('date_from'))) : date('Y-m-d', strtotime(Carbon::now()->startOfMonth()));
$date_to = Request::input('date_to') ? date('Y-m-d', strtotime(Request::input('date_to'))) : date('Y-m-d', strtotime(Carbon::now()));
$show = false;
}
return view('content.report.customer', compact('tenant', 'tenant_id', 'date_from', 'date_to', 'show'), ['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)
{
//
}
}