push -- izzat

parent 957594b6
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\VwTpStatus;
use Portal\Timesheet\Model\VwPelulus;
use Mail;
use App\Mail\ApprovalNotification;
class Approval extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'approval:cron';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$year = date('Y');
$month = date('n');
$day = date('j');
if($day<16)
{
$phase = 2;
if ($month == 1)
{
$month = 12;
$year -= 1;
}
else
{
$month -=1;
}
}
else
{
$phase = 1;
}
$checktm = Ts_master::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('tm_timesheet_master_sts', 3)
->get();
$checktpproject = VwTpStatus::select('staffid', 'tp_project_type', 'fk_tm_id', 'tp_year', 'tp_month', 'tp_phase', 'tp_timesheet_sts', 'tp_pd')
->where('tp_year', $year)
->where('tp_month', $month)
->where('tp_phase', $phase)
->where('tp_timesheet_sts', 3)
->whereIn('tp_project_type', [1,3])
->with('pelulus')
->with('staffdetails')
->whereHas('tm', function($query) {
$query->where('tm_timesheet_master_sts', 3);
})
->distinct()
->get();
$pelulus = VwPelulus::with('details')->get();
foreach ($pelulus as $key => $value)
{
$projectstafflist = [];
if (count($checktpproject) > 0)
{
$projectstafflist = $checktpproject->where('tp_pd', data_get($value,'pelulus'));
}
if(env('EMAIL_ENV') == 'local')
{
$mailTo = '3fetimesheet@gmail.com';
$data_email = [
'subject' => 'Timesheet: Notification for Timesheet Approval',
'sender_name' => '3fetimesheet@gmail.com',
'cc' => '143hannan@gmail.com',
'name' => data_get($value,'name'),
'phase' => $phase,
'month' => $month,
'year' => $year,
];
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
// $mailTo = '3fetimesheet@gmail.com';
$data_email = [
'subject' => 'Timesheet: Notification for Timesheet Approval',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'phase' => $phase,
'month' => $month,
'year' => $year,
];
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($value,'details.email');
$data_email = [
'subject' => 'Timesheet: Notification for Timesheet Approval',
'sender_name' => '3fetimesheet@gmail.com',
'cc' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'phase' => $phase,
'month' => $month,
'year' => $year,
];
}
if ( count($projectstafflist) > 0 )
{
Mail::to($mailTo)->send(new ApprovalNotification($data_email, $projectstafflist));
// return new ApprovalNotification($data_email, $projectstafflist);
}
}
}
}
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\VwStaff;
use Mail;
use App\Mail\Reminder;
class DemoCron extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'demo:cron';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$today = date('d-m-Y');
$currday = date('j');
$currmonth = date('n');
$curryear = date('Y');
// $currday = 20;
// $currmonth = 1;
// $curryear = 2022;
if ($currday > 15)
{
$checkphase = 1;
$checkyear = $curryear;
$checkmonth = $currmonth;
}
else
{
$checkphase = 2;
if ($currmonth == 1)
{
$checkmonth = 12;
$checkyear = $curryear-1;
}
else
{
$checkmonth = $currmonth-1;
$checkyear = $curryear;
}
}
$timesheets = Ts_master::select('tm_staff_id')
->where('tm_year', $checkyear)
->where('tm_month', $checkmonth)
->where('tm_phase', $checkphase)
->whereIn('tm_timesheet_master_sts', ['2','3','4','5','6'])
->get();
$staffsubmitted = [];
foreach ($timesheets as $key => $value) {
$staffsubmitted[] = $value->tm_staff_id;
}
$users = VwStaff::whereNotIn('staffid', $staffsubmitted)
->where('deptID', '<>', 8)
->where('status', 'ACTIVE')
->with('penyokong')
->get();
if (env('EMAIL_ENV') == 'local')
{
foreach ($users as $key => $value)
{
// dd($value);
$mailTo = '3fetimesheet@gmail.com';
$cc = ['azhanhannan@3fresources.com'];
$data_email = [
'subject' => 'Test Local Timesheet: Reminder for Timesheet Submission',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'cc' => $cc,
'today' => $today,
'phase' => $checkphase,
'month' => $checkmonth,
'year' => $checkyear,
];
Mail::to($mailTo)->cc($data_email['cc'])->send(new Reminder($data_email));
// return new Reminder($data_email);
}
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
foreach ($users as $key => $value)
{
$mailTo = '3fetimesheet@gmail.com';
$cc = ['azhanhannan@3fresources.com'];
$data_email = [
'subject' => 'Test Dev Timesheet: Reminder for Timesheet Submission',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'cc' => $cc,
'today' => $today,
'phase' => $checkphase,
'month' => $checkmonth,
'year' => $checkyear,
];
// Mail::to($mailTo)->cc($data_email['cc'])->send(new Reminder($data_email));
// return new Reminder($data_email);
}
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
foreach ($users as $key => $value)
{
$mailTo = $value->email;
$cc = [data_get($value,'penyokong.email'), 'hasni@3fresources.com'];
$data_email = [
'subject' => 'Timesheet: Reminder for Timesheet Submission',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'cc' => $cc,
'today' => $today,
'phase' => $checkphase,
'month' => $checkmonth,
'year' => $checkyear,
];
Mail::to($mailTo)->cc($data_email['cc'])->send(new Reminder($data_email));
// return new Reminder($data_email);
}
}
}
}
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\VwTpStatus;
use Portal\Timesheet\Model\VwPenyokong;
use Mail;
use App\Mail\VerificationNotification;
class Verification extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'verification:cron';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$year = date('Y');
$month = date('n');
$day = date('j');
if($day<16){
$phase = 2;
if ($month == 1)
{
$month = 12;
$year -= 1;
} else
{
$month -=1;
}
}
else
{
$phase = 1;
}
$checktm = Ts_master::where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->where('tm_timesheet_master_sts', 2)
->get();
$checktpproject = VwTpStatus::select('staffid', 'tp_project_type', 'fk_tm_id', 'tp_year', 'tp_month', 'tp_phase', 'tp_timesheet_sts', 'tp_pm')
->where('tp_year', $year)
->where('tp_month', $month)
->where('tp_phase', $phase)
->where('tp_timesheet_sts', 2)
->where('tp_project_type', 1)
->with('penyokongproject')
->with('staffdetails')
->distinct()
->get();
// dd($checktpproject);
$checktpoverhead = VwTpStatus::where('tp_year', $year)
->where('tp_month', $month)
->where('tp_phase', $phase)
->where('tp_timesheet_sts', 2)
->where('tp_project_type', 3)
->with('staffdetails')
->with('penyokongoverhead')
->get();
$penyokong = VwPenyokong::with('details')->get();
foreach ($penyokong as $key => $value) {
$projectstafflist = [];
if (count($checktpproject->where('tp_pm', data_get($value,'details.u_staffID'))) > 0) {
$projectstafflist = $checktpproject->where('tp_pm', data_get($value,'details.u_staffID'));
}
$overheadstafflist = [];
if (count($checktpoverhead) > 0) {
$overheadstafflist = $checktpoverhead->where('tp_pm', data_get($value, 'penyokong'));
}
if (env('EMAIL_ENV') == 'local') {
$mailTo = '3fetimesheet@gmail.com';
$data_email = [
'subject' => 'Timesheet: Notification for Timesheet Verification',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'cc' => '143hannan@gmail.com',
'phase' => $phase,
'month' => $month,
'year' => $year,
];
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
// $mailTo = '3fetimesheet@gmail.com';
$data_email = [
'subject' => 'Timesheet: Notification for Timesheet Verification',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'phase' => $phase,
'month' => $month,
'year' => $year,
];
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($value,'details.email');
$data_email = [
'subject' => 'Timesheet: Notification for Timesheet Verification',
'sender_name' => '3fetimesheet@gmail.com',
'name' => data_get($value,'name'),
'cc' => '3fetimesheet@gmail.com',
'phase' => $phase,
'month' => $month,
'year' => $year,
];
}
if ( count($projectstafflist) > 0 || count($overheadstafflist) > 0) {
Mail::to($mailTo)->send(new VerificationNotification($data_email, $projectstafflist, $overheadstafflist));
// return new VerificationNotification($data_email, $projectstafflist, $overheadstafflist);
}
}
}
}
...@@ -13,7 +13,9 @@ class Kernel extends ConsoleKernel ...@@ -13,7 +13,9 @@ class Kernel extends ConsoleKernel
* @var array * @var array
*/ */
protected $commands = [ protected $commands = [
// Commands\DemoCron::class,
Commands\Verification::class,
Commands\Approval::class
]; ];
/** /**
...@@ -26,6 +28,22 @@ class Kernel extends ConsoleKernel ...@@ -26,6 +28,22 @@ class Kernel extends ConsoleKernel
{ {
// $schedule->command('inspire') // $schedule->command('inspire')
// ->hourly(); // ->hourly();
$schedule->command('demo:cron')->monthlyOn(5, '09:00');
$schedule->command('demo:cron')->monthlyOn(7, '09:00');
$schedule->command('demo:cron')->monthlyOn(10, '09:00');
$schedule->command('demo:cron')->monthlyOn(20, '09:00');
$schedule->command('demo:cron')->monthlyOn(22, '09:00');
$schedule->command('demo:cron')->monthlyOn(25, '09:00');
$schedule->command('verification:cron')->weeklyOn(1, '9:00');
$schedule->command('verification:cron')->weeklyOn(2, '9:00');
$schedule->command('verification:cron')->weeklyOn(3, '9:00');
$schedule->command('verification:cron')->weeklyOn(4, '9:00');
$schedule->command('verification:cron')->weeklyOn(5, '9:00');
$schedule->command('approval:cron')->weeklyOn(1, '9:00');
$schedule->command('approval:cron')->weeklyOn(3, '9:00');
$schedule->command('approval:cron')->weeklyOn(5, '9:00');
} }
/** /**
......
...@@ -29,5 +29,6 @@ final class Permission extends Enum ...@@ -29,5 +29,6 @@ final class Permission extends Enum
const tsapproval = 'tsapproval'; const tsapproval = 'tsapproval';
const stafftimesheet = 'stafftimesheet'; const stafftimesheet = 'stafftimesheet';
const timesheetnotsubmit = 'timesheetnotsubmit'; const timesheetnotsubmit = 'timesheetnotsubmit';
const usermanagement = 'usermanagement';
} }
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class ApprovalNotification extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $projectstafflist;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $projectstafflist)
{
$this->data_email = $data_email;
$this->projectstafflist = $projectstafflist;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.ApprovalNotification');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class BodRejectProject extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $data_timesheet;
public $data_project;
public $data_overheads;
public $emailcc;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc)
{
$this->data_email = $data_email;
$this->data_timesheet = $data_timesheet;
$this->data_project = $data_project;
$this->data_overheads = $data_overheads;
$this->emailcc = $emailcc;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.BodRejectProject');
}
}
...@@ -13,16 +13,20 @@ class PmRejectProject extends Mailable ...@@ -13,16 +13,20 @@ class PmRejectProject extends Mailable
public $data_email; public $data_email;
public $data_timesheet; public $data_timesheet;
public $data_project;
public $data_overheads;
/** /**
* Create a new message instance. * Create a new message instance.
* *
* @return void * @return void
*/ */
public function __construct($data_email, $data_timesheet) public function __construct($data_email, $data_timesheet, $data_project, $data_overheads)
{ {
$this->data_email = $data_email; $this->data_email = $data_email;
$this->data_timesheet = $data_timesheet; $this->data_timesheet = $data_timesheet;
$this->data_project = $data_project;
$this->data_overheads = $data_overheads;
} }
/** /**
......
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class Reminder extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email)
{
$this->data_email = $data_email;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.Reminder');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class VerificationNotification extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $projectstafflist;
public $overheadstafflist;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $projectstafflist, $overheadstafflist)
{
$this->data_email = $data_email;
$this->projectstafflist = $projectstafflist;
$this->overheadstafflist = $overheadstafflist;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.VerificationNotification');
}
}
...@@ -80,7 +80,8 @@ return [ ...@@ -80,7 +80,8 @@ return [
| |
*/ */
'locale' => 'ms', // 'locale' => 'ms',
'locale' => 'en',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStartEndDateColumnInProject extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('project', function (Blueprint $table) {
$table->date('start_date')->after('p_project_sts')->nullable();
$table->date('end_date')->after('start_date')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('project', function (Blueprint $table) {
$table->dropColumn('start_date');
$table->dropColumn('end_date');
});
}
}
...@@ -341,6 +341,25 @@ ...@@ -341,6 +341,25 @@
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> --> </tfoot> -->
</table> </table>
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach(data_get($profile,'notes') as $key => $value)
@if(data_get($profile,'fk_o_id') == data_get($value, 'fk_o_id'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
</table>
@endif @endif
</div> </div>
......
...@@ -340,6 +340,25 @@ ...@@ -340,6 +340,25 @@
</table> </table>
@endif @endif
@if(count($notes) > 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($notes as $key => $value)
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endforeach
</table>
@endif
</div> </div>
<div class="ui segment"> <div class="ui segment">
......
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
@foreach($profiles as $key => $staff) @foreach($profiles as $key => $staff)
<?php <?php
$td = $checktd->where('tm_staff_id', $staff->staffid); $td = $checktd->where('tm_staff_id', $staff->staffid);
$detail = $details->where('staffid', $staff->staffid); // $detail = $details->where('staffid', $staff->staffid);
$detail = $details->where('fk_tm_id', $staff->tmid);
$checkchargeable = $detail->where('tp_project_type',1)->first(); $checkchargeable = $detail->where('tp_project_type',1)->first();
$checkoverhead = $detail->where('tp_project_type',3)->first(); $checkoverhead = $detail->where('tp_project_type',3)->first();
// dump($staff); // dump($detail);
// dd($staff);
// dump(count($detail->where('tp_timesheet_sts',4))); // dump(count($detail->where('tp_timesheet_sts',4)));
// dump(count($detail)); // dump(count($detail));
// dump(count($checkoverhead)); // dump(count($checkoverhead));
...@@ -285,6 +287,171 @@ ...@@ -285,6 +287,171 @@
</div> </div>
<!-- Staff Timesheet Section End --> <!-- Staff Timesheet Section End -->
<!-- Project Verification Section Start -->
<?php
$others = null;
foreach ($chargeprofile as $key => $value) {
$others = $value;
}
// dd($others);
?>
<div class="ui segment">
<div class="ui blue left ribbon label">
Project Verification
</div>
<br>
<br>
<div class="ui styled fluid accordion">
<?php
$page = 1; $project = $checksts = 0;
$notpms = $chargeprofile->where('dept', '<>',4);
?>
@if($others)
@foreach($notpms as $key => $staff)
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID)->where('tp_timesheet_sts', 3));
?>
@endforeach
<!-- @if($project == $checksts)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">All timesheet has been verified</th>
</tr>
</thead>
</table>
@endif -->
@foreach($notpms as $key => $staff)
<?php
// dd($notpms);
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $approval->u_staffID)->where('tp_timesheet_sts', 3));
?>
@if($project == $checksts)
@else
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 20%" class="text-center">
@if(data_get($staff,'phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - {{ data_get($staff,'year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
// dd($notpms);
$status = $staff->status;
$verified = count(data_get($notpms[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
$allproject = count(data_get($notpms[$key], 'countchargeable'));
?>
@if($status == 1 || $status == null) In Preparation
@elseif($verified == $allproject) <i class="green check icon"></i> Verified by PM
@elseif($status == 2) <i class="red attention icon"></i> Submitted
@elseif($status == 4) <i class="green check icon"></i>Verified by PD
@elseif($status == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif($status == 6) <i class="red attention icon"></i>Rejected by PM
@elseif($status == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($staff,'submission'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Details</button>
</th>
</tr>
</thead>
</table>
</div>
<div class="content" style="padding-top: 0px;">
<form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
{{csrf_field()}}
<input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<input type="hidden" name="page" value="{{$page}}">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%;">Project Code</th>
<th style="width: 15;">Project Name</th>
<th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@php
$details = $chargedetails->where('tp_project_type', 1);
// dd($details);
@endphp
@foreach($details as $key => $detail)
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<tr>
<td style="width: 10%;" class="single line">
@if(data_get($detail,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($detail,'id')}}]" value="{{data_get($detail,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($detail, 'project.p_project_code')}}
</td>
<td style="width: 15;">{{data_get($detail, 'project.p_project_description')}}</td>
<td style="width: 10%;" class="center aligned">{{data_get($detail, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($detail, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($detail, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($detail, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';" type="button">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<button type="submit" class="center aligned ui green icon button">Verify</button>
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.verifyallaction', ['tmid'=>data_get($staff, 'tmid'), 'phase'=>data_get($staff, 'tm_phase'), 'month'=>data_get($staff, 'tm_month'), 'year'=>data_get($staff, 'tm_year'), 'page'=>$page ]) }}';">Verify All</button>
</form>
</div>
@endif
@endforeach
@else
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">No pending verification</th>
</tr>
</thead>
</table>
@endif
</div>
</div>
<!-- Project Verification Section End -->
<!-- Verification Section Start --> <!-- Verification Section Start -->
@if(count($profile) > 0) @if(count($profile) > 0)
<div class="ui segment"> <div class="ui segment">
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<?php <?php
$chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id')); $chargeable = $projects->where('tp_project_type', 1)->where('fk_tm_id', data_get($time,'id'));
$overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id')); $overhead = $projects->where('tp_project_type', 3)->where('fk_tm_id', data_get($time,'id'));
// dd($overhead); // dd($projects);
?> ?>
<div class="content" style="padding-top: 0px;"> <div class="content" style="padding-top: 0px;">
......
...@@ -267,12 +267,10 @@ ...@@ -267,12 +267,10 @@
<?php <?php
$pms = $others = null; $pms = $others = null;
foreach ($profile as $key => $value) { foreach ($profile as $key => $value) {
// dump(data_get($value,'dept'));
if (data_get($value,'dept') == 4) { if (data_get($value,'dept') == 4) {
$pms = $value; $pms = $value;
} else { } else {
$others = $value; $others = $value;
// dd($others);
} }
} }
?> ?>
...@@ -289,6 +287,8 @@ ...@@ -289,6 +287,8 @@
$page = 1; $page = 1;
$project = $checksts = 0; $project = $checksts = 0;
$pmss = $profile->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID); $pmss = $profile->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
$ovpmss = $ovprofiles->where('dept', 4)->where('staff_id', '<>', $verifier->u_staffID);
// dd($ovpmss);
?> ?>
@if($pms) @if($pms)
@foreach($pmss as $key => $staff) @foreach($pmss as $key => $staff)
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
@foreach($pmss as $key => $staff) @foreach($pmss as $key => $staff)
<?php <?php
// dd($staff); // dump($staff);
// dd(data_get($staff,'countchargeable')); // dd(data_get($staff,'countchargeable'));
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)); $project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$projectoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id)); $projectoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id));
...@@ -467,10 +467,10 @@ ...@@ -467,10 +467,10 @@
</td> </td>
<td style="width: 12%;" class="text-center single line"> <td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';" type="button">Verify | Reject</button>
@else @else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> --> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</a> <a class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" type="button" target='_blank'>View</a>
@endif @endif
</td> </td>
...@@ -487,7 +487,10 @@ ...@@ -487,7 +487,10 @@
<th class="center aligned">Notes</th> <th class="center aligned">Notes</th>
</tr> </tr>
</thead> </thead>
@foreach($overheads as $key => $overhead) <?php
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
?>
@foreach($pmsoverheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid')) @if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
@foreach(data_get($overhead,'notes') as $key => $value) @foreach(data_get($overhead,'notes') as $key => $value)
@if(data_get($value,'td_hours')) @if(data_get($value,'td_hours'))
...@@ -518,6 +521,173 @@ ...@@ -518,6 +521,173 @@
</thead> </thead>
</table> --> </table> -->
@endif @endif
@if(count($ovpmss) > 0)
@foreach($ovpmss as $key => $staff)
<?php
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
?>
@endforeach
<!-- @if($project == $checksts)
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="text-center">All timesheet has been verified</th>
</tr>
</thead>
</table>
@endif -->
@foreach($ovpmss as $key => $staff)
<?php
// dump($staff);
// dd(data_get($staff,'countchargeable'));
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id));
$projectoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
$checkstsoverhead = count(data_get($staff,'countoverhead')->where('tp_pm', $verifier->id)->where('tp_timesheet_sts', 3));
?>
@if(($project+$projectoverhead) == ($checksts+$checkstsoverhead))
@else
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 40%;"><i class="dropdown icon"></i>{{ data_get($staff,'sname.fullname') }}</th>
<th style="width: 20%" class="text-center">
@if(data_get($staff,'phase') == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - {{ data_get($staff,'year') }}
</th>
<th style="width: 15%;" class="center aligned">
<?php
// dd($ovpmss);
$status = $staff->status;
$verified = count(data_get($ovpmss[$key], 'countchargeable')->where('tp_timesheet_sts', 3));
$allproject = count(data_get($ovpmss[$key], 'countchargeable'));
?>
@if($status == 1 || $status == null) In Preparation
@elseif($status == 2) <i class="red attention icon"></i> Submitted
@elseif($status == 3) <i class="green check icon"></i> Verified by PM
@elseif($status == 4) <i class="green check icon"></i>Verified by PD
@elseif($status == 5) <i class="red attention icon"></i>Dissaproved by PD
@elseif($status == 6) <i class="red attention icon"></i>Rejected by PM
@elseif($status == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</th>
<th style="width: 13%" class="text-center">Submitted on: {{ date("d/m/Y", strtotime(data_get($staff,'submission'))) }}</th>
<th style="width: 12%" class="text-center">
<button class="center aligned ui blue icon button">View Details</button>
</th>
</tr>
</thead>
</table>
</div>
<div class="content" style="padding-top: 0px;">
<form class="ui form" action="{{ route('timesheet::dashboard.selectverification') }}" method="POST">
{{csrf_field()}}
<input type="hidden" name="tmid" value="{{data_get($staff,'tmid')}}">
<input type="hidden" name="page" value="{{$page}}">
<?php
$overhead = $overheads->where('staffid', $staff->staff_id);
$checkoverhead = $overheads->where('staffid', $staff->staff_id)->first();
?>
@if($checkoverhead)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 25%;">Overhead</th>
<th style="width: 10%;" class="center aligned">Total Hours</th>
<th style="width: 10%;" class="center aligned">Total Days</th>
<th style="width: 30%">Remarks</th>
<th style="width: 13%" class="text-center">Status</th>
<th style="width: 12%;" class="text-center">Action</th>
</tr>
</thead>
@foreach($overheads as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td style="width: 25;">
@if(data_get($tp,'tp_timesheet_sts') == 2)
<div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($tp,'id')}}]" value="{{data_get($tp,'id')}}">
</div>
@else
<div class="ui toggle checkbox">
<input type="checkbox" disabled="disabled">
</div>
@endif
{{data_get($tp, 'tp_project_name')}}
</td>
<td style="width: 10%;" class="center aligned">{{data_get($tp, 'tp_hours')}}</td>
<td style="width: 10%;" class="center aligned">
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
</td>
<td style="width: 30%">{{data_get($tp, 'verifier_remark')}}</td>
<td style="width: 13%" class="text-center">
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2) <i class="red attention icon"></i> Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 4) <i class="green check icon"></i>Verified by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 7) <i class="red attention icon"></i>Rejected by HR
@endif
</td>
<td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';" type="button">Verify | Reject</button>
@else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" type="button" target='_blank'>View</a>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
<?php
$pmsoverheads = $overheads->where('fk_tm_id', data_get($staff,'tmid'));
?>
@foreach($pmsoverheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
@foreach(data_get($overhead,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
<button type="submit" class="center aligned ui green icon button">Verify</button>
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.verifyallaction', ['tmid'=>data_get($staff, 'tmid'), 'phase'=>data_get($staff, 'tm_phase'), 'month'=>data_get($staff, 'tm_month'), 'year'=>data_get($staff, 'tm_year'), 'page'=>$page ]) }}';">Verify All</button>
</form>
</div>
@endif
@endforeach
@endif
</div> </div>
</div> </div>
...@@ -541,7 +711,7 @@ ...@@ -541,7 +711,7 @@
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3)); $checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?> ?>
@endforeach @endforeach
@if($project == $checksts) <!-- @if($project == $checksts)
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
...@@ -549,10 +719,11 @@ ...@@ -549,10 +719,11 @@
</tr> </tr>
</thead> </thead>
</table> </table>
@endif @endif -->
@foreach($notpms as $key => $staff) @foreach($notpms as $key => $staff)
<?php <?php
// dd($notpms);
$project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)); $project = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID));
$checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3)); $checksts = count(data_get($staff,'countchargeable')->where('tp_pm', $verifier->u_staffID)->where('tp_timesheet_sts', 3));
?> ?>
...@@ -642,7 +813,7 @@ ...@@ -642,7 +813,7 @@
</td> </td>
<td style="width: 12%;" class="text-center single line"> <td style="width: 12%;" class="text-center single line">
@if(data_get($detail, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';" type="button">Verify | Reject</button>
@else @else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> --> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a> <a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
...@@ -704,7 +875,7 @@ ...@@ -704,7 +875,7 @@
</td> </td>
<td style="width: 12%;" class="text-center single line"> <td style="width: 12%;" class="text-center single line">
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';" type="button">Verify | Reject</button>
@else @else
<!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> --> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}" target='_blank'>View</a> <a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}" target='_blank'>View</a>
......
...@@ -40,6 +40,15 @@ ...@@ -40,6 +40,15 @@
<a class="ui teal left ribbon label">Timesheet Status</a> <a class="ui teal left ribbon label">Timesheet Status</a>
<br> <br>
<br> <br>
<!-- kak shikin -->
@if(auth()->user()->id == 6)
<button class="tiny center aligned ui purple right compact labeled icon button" onclick="window.location.href='{{ route('timesheet::users.syncNewUsers') }}';">
<i class="angle double right icon"></i>
Sync New User
</button>
<br>
<br>
@endif
@foreach($timesheet as $key => $time) @foreach($timesheet as $key => $time)
<!-- <?php <!-- <?php
// dd($time->tm_timesheet_master_sts); // dd($time->tm_timesheet_master_sts);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
@endif @endif
</td> </td>
<td class="text-center"> <td class="text-center">
<a class="ui purple compact icon button" href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => data_get($timesheet,'tm_phase'), 'month' =>data_get($timesheet,'tm_month')] ) }}" target="_blank"> <a class="ui purple compact icon button" href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => data_get($timesheet,'tm_phase'), 'month' =>data_get($timesheet,'tm_month'), 'year' =>data_get($timesheet,'tm_year')] ) }}" target="_blank">
<i class="eye icon"></i> <i class="eye icon"></i>
</a> </a>
</td> </td>
......
...@@ -193,6 +193,25 @@ ...@@ -193,6 +193,25 @@
</tfoot> --> </tfoot> -->
</table> </table>
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach(data_get($profile,'notes') as $key => $value)
@if(data_get($profile,'fk_o_id') == data_get($value, 'fk_o_id'))
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endif
@endforeach
</table>
<form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form"> <form action="{{ route('timesheet::dashboard.verifyoverhead') }}" method="POST" class="ui form">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}"> <input type="hidden" name="tpid" value="{{ data_get($profile,'id') }}">
......
...@@ -338,6 +338,25 @@ ...@@ -338,6 +338,25 @@
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> --> </tfoot> -->
</table> </table>
@if(count($notes) > 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($notes as $key => $value)
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endforeach
</table>
@endif
@endif @endif
<div class="ui segment"> <div class="ui segment">
......
...@@ -338,6 +338,26 @@ ...@@ -338,6 +338,26 @@
<th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th> <th style="width: 5%">@if($totaloverheadhrs) {{ number_format($totaloverheadhrs/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> --> </tfoot> -->
</table> </table>
@if(count($notes) > 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($notes as $key => $value)
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endforeach
</table>
@endif
@endif @endif
<div class="ui segment"> <div class="ui segment">
...@@ -350,7 +370,7 @@ ...@@ -350,7 +370,7 @@
@endforeach @endforeach
<div class="two fields"> <div class="two fields">
<div class="field"> <div class="field">
<input type="hidden" name="approval" value="{{ data_get($pm,'id') }}"> <input type="hidden" name="verifier" value="{{ data_get($pm,'id') }}">
<label>Verifier</label> <label>Verifier</label>
<input type="text" readonly="readonly" value="{{ data_get($pm,'name') }}"> <input type="text" readonly="readonly" value="{{ data_get($pm,'name') }}">
</div> </div>
......
...@@ -864,7 +864,7 @@ ...@@ -864,7 +864,7 @@
</table> </table>
</div> </div>
@if(data_get($profile,'HOD_NAME')) <!-- @if(data_get($profile,'HOD_NAME'))
<div class="ui segment"> <div class="ui segment">
<table id="printtable7" class="ui celled structured table unstackable"> <table id="printtable7" class="ui celled structured table unstackable">
<thead> <thead>
...@@ -909,7 +909,7 @@ ...@@ -909,7 +909,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
@endif @endif -->
</div> </div>
<br> <br>
......
...@@ -340,6 +340,25 @@ ...@@ -340,6 +340,25 @@
</table> </table>
@endif @endif
@if(count($notes) > 0)
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 10%" class="center aligned">Date</th>
<th style="width: 15%" class="single line"> Overhead Description</th>
<th class="center aligned">Notes</th>
</tr>
</thead>
@foreach($notes as $key => $value)
<tr>
<td style="width: 10%" class="center aligned">{{ date("d-m-Y", strtotime(data_get($value, 'td_date'))) }}</td>
<td style="width: 15%" class="single line">{{data_get($value, 'td_overhead_desc')}}</td>
<td>{{data_get($value, 'td_overhead_note')}}</td>
</tr>
@endforeach
</table>
@endif
</div> </div>
<div class="ui segment"> <div class="ui segment">
......
...@@ -5,16 +5,20 @@ ...@@ -5,16 +5,20 @@
<th colspan="3">Project Report</th> <th colspan="3">Project Report</th>
</tr> </tr>
<tr> <tr>
<th></th>
<th style="width: 10%">Project </th> <th style="width: 10%">Project </th>
<th style="width: 1%">:</th> <th style="width: 1%">:</th>
<th> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th> <th style="width: 20%"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th>
<th style="width: 10%">Start Date </th>
<th style="width: 1%">:</th>
<th style="width: 20%"> {{ date("j M Y", strtotime(data_get($pdetail,'start_date'))) }}</th>
</tr> </tr>
<tr> <tr>
<th></th>
<th style="width: 10%"> Month/Year</th> <th style="width: 10%"> Month/Year</th>
<th style="width: 1%">:</th> <th style="width: 1%">:</th>
<th> {{ date("F", mktime(0, 0, 0, $month, 10)) }} {{$year}}</th> <th style="width: 20%"> {{$month}} {{$year}}</th>
<th style="width: 10%"> End Date</th>
<th style="width: 1%">:</th>
<th style="width: 20%"> {{ date("j M Y", strtotime(data_get($pdetail,'end_date'))) }}</th>
</tr> </tr>
</thead> </thead>
</table> </table>
...@@ -22,16 +26,16 @@ ...@@ -22,16 +26,16 @@
<table class="ui unstackable celled table"> <table class="ui unstackable celled table">
<thead> <thead>
<tr> <tr>
<th style="width: 10%" class="center aligned" rowspan="2">role</th> <th style="width: 10%" class="center aligned" rowspan="2">{{strtoupper('role')}}</th>
<th style="width: 10%" class="center aligned" rowspan="2">allocation</th> <th style="width: 10%" class="center aligned" rowspan="2">{{strtoupper('allocation')}}</th>
<th style="width: 10%" class="center aligned" rowspan="2">total accumulate</th> <th style="width: 10%" class="center aligned" rowspan="2">{{strtoupper('total accumulate')}}</th>
<th style="width: 15%" class="center aligned" rowspan="2">staff name</th> <th style="width: 15%" class="center aligned" rowspan="2">{{strtoupper('staff name')}}</th>
<th style="width: 20%" class="center aligned" colspan="2">Mandays</th> <th style="width: 20%" class="center aligned" colspan="2">{{strtoupper('Mandays')}}</th>
<th style="width: 10%" class="center aligned" rowspan="2">balance</th> <th style="width: 10%" class="center aligned" rowspan="2">{{strtoupper('balance')}}</th>
</tr> </tr>
<tr> <tr>
<th style="width: 15%" class="center aligned">total hours</th> <th style="width: 15%" class="center aligned">{{strtoupper('total hours')}}</th>
<th style="width: 15%" class="center aligned">total days</th> <th style="width: 15%" class="center aligned">{{strtoupper('total days')}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -67,7 +71,7 @@ ...@@ -67,7 +71,7 @@
$currhour = 0; $currhour = 0;
$currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id')); $currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
foreach ($currmonthhours as $key => $hours) { foreach ($currmonthhours as $key => $hours) {
$currhour = data_get($hours,'tp_hours'); $currhour += data_get($hours,'tp_hours');
} }
?> ?>
{{ number_format($currhour, '1', '.', '') }} Hours {{ number_format($currhour, '1', '.', '') }} Hours
......
...@@ -88,15 +88,30 @@ ...@@ -88,15 +88,30 @@
<td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td>
@endif @endif
<?php $totalnc = 0; ?> <?php $totalnc = $ocuti = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<td class="center aligned"> <td class="center aligned">
<?php $monthly_hours = 0; ?> <?php $monthly_hours = 0; ?>
@foreach($ovhours as $key => $hours) @foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid')) @if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid'))
<!-- {{data_get($hours,'hours')}} --> <!-- {{data_get($hours,'hours')}} -->
<?php $monthly_hours += data_get($hours,'hours') ?> <?php
<!-- <?php $totalnc += data_get($hours,'hours'); ?> --> $monthly_hours += data_get($hours,'hours');
if (data_get($hours,'oid') == 6) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 7) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 8) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 10) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 15) {
$ocuti += data_get($hours,'hours');
}else{
}
$totalnc += data_get($hours,'hours');
?>
@endif @endif
@endforeach @endforeach
...@@ -108,7 +123,9 @@ ...@@ -108,7 +123,9 @@
@endforeach @endforeach
<td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td>
<td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td>
<?php $totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?> <?php
$totalnc -= $ocuti;
$totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?>
<td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td>
</tr> </tr>
</tbody> </tbody>
...@@ -141,13 +158,25 @@ ...@@ -141,13 +158,25 @@
<th class="text-center">{{ number_format($tch, '1', '.', '') }}</th> <th class="text-center">{{ number_format($tch, '1', '.', '') }}</th>
<th class="text-center">{{ number_format($tch/8, 1, '.', '') }}</th> <th class="text-center">{{ number_format($tch/8, 1, '.', '') }}</th>
@endif @endif
<?php $totaloverhead = 0; ?> <?php $totaloverhead = 0;$cuti = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<?php <?php
$monthly_ov = 0; $monthly_ov = 0;
$oid = data_get($value,'id'); $oid = data_get($value,'id');
$ov = $ovhours->where('oid', $oid); $ov = $ovhours->where('oid', $oid);
foreach ($ov as $key => $val) { foreach ($ov as $key => $val) {
if (data_get($val,'oid') == 6) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 7) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 8) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 10) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 15) {
$cuti += data_get($val,'hours');
}else{
}
$monthly_ov += data_get($val,'hours'); $monthly_ov += data_get($val,'hours');
} }
?> ?>
......
...@@ -27,7 +27,7 @@ input[type=number] { ...@@ -27,7 +27,7 @@ input[type=number] {
<br> <br>
@if($lastupdated) @if($lastupdated)
<div class="ui right floated center compact aligned basic right button"> <div class="tiny ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
Last Updated : {{ date('d/m/Y', strtotime(data_get($lastupdated,'updated_at'))) }} Last Updated : {{ date('d/m/Y', strtotime(data_get($lastupdated,'updated_at'))) }}
...@@ -36,7 +36,7 @@ input[type=number] { ...@@ -36,7 +36,7 @@ input[type=number] {
</div> </div>
@endif @endif
<div class="ui right floated center compact aligned basic right button"> <div class="tiny ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
@if($phase == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, $month, 10)) }} - {{ $year }} @if($phase == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, $month, 10)) }} - {{ $year }}
...@@ -44,33 +44,200 @@ input[type=number] { ...@@ -44,33 +44,200 @@ input[type=number] {
</div> </div>
</div> </div>
<button class="center aligned ui purple right compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';"> <button class="tiny center aligned ui purple right compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Go to Overhead Form Go to Overhead Form
</button> </button>
<a href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}" class="center aligned ui pink right compact labeled icon button" target="_blank"> <a href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}" class="tiny center aligned ui pink right compact labeled icon button" target="_blank">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
View and Submit Timesheet View and Submit Timesheet
</a> </a>
<br> <br>
<!-- <br> -->
<!-- overhead detail start -->
<table id="printtable4" class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="" rowspan="3" class="center aligned" @if($phase == 2 && ($daymonth-15) == 16) style="width: 21.5%;" @elseif($phase == 2 && ($daymonth-15) == 13) style="width: 17.5%;" @elseif($phase == 2 && ($daymonth-15) == 14) style="width: 19%;" @else style="width: 20%;" @endif>Overhead</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<!-- <th>Days</th> -->
</tr>
</thead>
<tbody>
@if(count($overheadlist) > 0)
@foreach($overheadlist as $key => $projectoverhead)
<?php
$totaloverhead = 0;
?>
<tr>
<!-- <td style="width: 4%;"></td> -->
<td style="width: 20%;">{{ $projectoverhead['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour)
{
$valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase)
->first();
$totaloverhead += data_get($valoverheadhour,'td_hours');
}
?>
@if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth ; $i++)
<?php
$valoverheadhour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($overheadhour)
{
$valoverheadhour = $overheadhour->where('td_date','=',$date)
->where('fk_o_id',$projectoverhead['pid'])
->where('tm_phase',$phase)
->first();
$totaloverhead += data_get($valoverheadhour,'td_hours');
}
?>
@if($valoverheadhour)
<td style="width: 4%;">{{ data_get($valoverheadhour,'td_hours') }}</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totaloverhead)
<td style="width: 5%">{{ number_format($totaloverhead, 1, '.', '') }}</td>
<!-- <td style="width: 5%">{{ number_format($totaloverhead/8, 1, '.', '') }}</td> -->
@else
<td style="width: 5%">0.0</td>
<!-- <td style="width: 5%">0.0</td> -->
@endif
</tr>
@endforeach
@else
<tr>
<td class="text-center" colspan="@if($phase==1){{4+15}} @else {{4+($daymonth-15)}} @endif">No Data Overhead</td>
</tr>
@endif
</tbody>
<tfoot>
<th colspan="">Total (Overhead)</th>
<?php $totaloverheadall = 0; ?>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
$totaloverheadall += $totaloverheadbyday;
}
?>
<th style="width: 4%">{{ number_format($totaloverheadbyday, 1, '.', '') }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totaloverheadbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($overheadhour) {
$valoverheadbyday = $overheadhour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valoverheadbyday as $key => $value) {
$totaloverheadbyday += data_get($value,'td_hours');
}
$totaloverheadall += $totaloverheadbyday;
}
?>
<th style="width: 4%">{{ number_format($totaloverheadbyday, '1', '.', '') }}</th>
@endfor
@endif
<?php
// dd($totaloverheadhrs);
?>
<th style="width: 5%">@if($totaloverheadall) {{ number_format($totaloverheadall, 1, '.', '') }} @else 0.0 @endif</th>
<!-- <th style="width: 5%">@if($totaloverheadall) {{ number_format($totaloverheadall/8, 1, '.', '') }} @else 0.0 @endif</th> -->
</tfoot>
</table>
<!-- overhead detail end -->
<form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<!-- <input type="text" disabled="disabled" name="" value="{{$year}}"> --> <!-- <input type="text" disabled="disabled" name="" value="{{$year}}"> -->
<input type="hidden" name="userId" value="{{$userId}}"> <input type="hidden" name="userId" value="{{$userId}}">
<input type="hidden" name="year" value="{{$year}}"> <input type="hidden" name="year" value="{{$year}}">
<input type="hidden" name="month" value="{{$month}}"> <input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}"> <input type="hidden" name="phase" value="{{$phase}}">
<table class="ui celled structured table unstackable">
{{-- <div class="table-responsive" style="overflow-x: auto; height: 400px; white-space: nowrap;"> --}}
<table id="table-chargeable-form" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<?php <?php
// dd(data_get($check,'tm_timesheet_master_sts')); // dd(data_get($check,'tm_timesheet_master_sts'));
?> ?>
<th colspan="2" rowspan="2" class="center aligned">Chargeable</th> <th colspan="2" rowspan="2" class="center aligned" style="width: 23%;">Chargeable</th>
<!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> --> <!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> -->
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th rowspan="2"> <th rowspan="2" class="center aligned">Total
<!-- @if($projectlist == []) <!-- @if($projectlist == [])
<button type="submit" class="ui disabled fluid center aligned ui blue compact labeled icon button"> <button type="submit" class="ui disabled fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
...@@ -86,7 +253,22 @@ input[type=number] { ...@@ -86,7 +253,22 @@ input[type=number] {
</tr> </tr>
<tr> <tr>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $date) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<th class="center aligned"> <th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
...@@ -97,13 +279,37 @@ input[type=number] { ...@@ -97,13 +279,37 @@ input[type=number] {
</th> </th>
@endif @endif
@endforeach @endforeach
@if($phase == 1) @endif
@for($i = count($lat); $i < 15 ; $i++)
<th class="center aligned">{{$i+1}}</th>
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th> {{-- <th class="center aligned">{{$i+1}}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
...@@ -119,10 +325,11 @@ input[type=number] { ...@@ -119,10 +325,11 @@ input[type=number] {
@endif @endif
</tr> </tr>
<tr> <tr>
<th class="single line">Project Code</th> <th class="">Project Code</th>
<th class="single line">Project Name</th> <th class="">Project Name</th>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $date)
{{-- @foreach($lat as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<th class="center aligned"> <th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }} {{ date('D', strtotime(data_get($date,'DATE')) ) }}
...@@ -132,20 +339,70 @@ input[type=number] { ...@@ -132,20 +339,70 @@ input[type=number] {
{{ date('D', strtotime(data_get($date,'DATE')) ) }} {{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th> </th>
@endif @endif
@endforeach @endforeach --}}
@if($phase == 1) @if($phase == 1)
@for($i = count($lat); $i < 15 ; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th> @for($i = 0; $i < 15 ; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th> {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
@if($phase == 1) @if($phase == 1)
@for($i = 0; $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th> <th class="center aligned">{{ $strdays[$i] }}</th>
@endfor @endfor
...@@ -163,28 +420,30 @@ input[type=number] { ...@@ -163,28 +420,30 @@ input[type=number] {
<?php <?php
$all = 0; $all = 0;
$lasttd = count($projectlist); $lasttd = count($projectlist);
// dd($lat);
?> ?>
@if(count($projectlist) > 0) @if(count($projectlist) > 0)
@foreach($projectlist as $key => $project) @foreach($projectlist as $key => $project)
<?php $total = 0;?> <?php $total = 0;?>
<tr> <tr>
<td class="single line"> <td class="">
{{$project['td_project_code']}} {{$project['td_project_code']}}
</td> </td>
<td class="single line"> <td class="">
{{$project['td_project_name']}} {{$project['td_project_name']}}
</td> </td>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $value) @if($phase == 1)
<?php @for($i = 0; $i < 15 ; $i++)
// dd($value);
$day = date_parse_from_format('Y-m-d', data_get($value,'DATE'))['day']; @php
// dd($day); $filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $day); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour) if($hour)
{ {
...@@ -195,45 +454,35 @@ input[type=number] { ...@@ -195,45 +454,35 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
?> @endphp
@if(data_get($value,'attendance_status') == 1) @if($filteredData->isEmpty())
<td>
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned"> <td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td> </td>
@else @else
<td class="center aligned" style="background-color: #DCDCDC;"> <td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td> </td>
@endif @endif
@endforeach @endforeach
@if($phase == 1) @endif
@for($i = count($lat); $i < 15 ; $i++)
<?php
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour)
{
$valuehour = $hour->where('td_date','=',$date)
->where('td_project',$project['td_project'])
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours');
}
?>
<td>
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
<?php
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -246,11 +495,25 @@ input[type=number] { ...@@ -246,11 +495,25 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
?> @endphp
<td> @if($filteredData->isEmpty())
<td class="center aligned">
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input class="center aligned" type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{$valuehour->td_hours}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
...@@ -316,6 +579,7 @@ input[type=number] { ...@@ -316,6 +579,7 @@ input[type=number] {
@endif @endif
</tbody> </tbody>
</table> </table>
{{-- </div> --}}
<?php <?php
// dd(count($projectlist)); // dd(count($projectlist));
?> ?>
...@@ -356,9 +620,6 @@ input[type=number] { ...@@ -356,9 +620,6 @@ input[type=number] {
</script> </script>
<script> <script>
$().ready(function() {
});
function limiter(input,pid) { function limiter(input,pid) {
...@@ -393,5 +654,3 @@ input[type=number] { ...@@ -393,5 +654,3 @@ input[type=number] {
document.getElementById('total-'+pid).value = currenttotal.toFixed(1); document.getElementById('total-'+pid).value = currenttotal.toFixed(1);
} }
</script> </script>
\ No newline at end of file
@endpush
\ No newline at end of file
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
@if(data_get($draft,'tm_timesheet_master_sts') == 1) Draft @endif @if(data_get($draft,'tm_timesheet_master_sts') == 1) Draft @endif
</td> </td>
<td class="text-center" style="width: 15%;"> <td class="text-center" style="width: 15%;">
<button class="ui purple compact icon button" type="button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => data_get($draft,'tm_phase'), 'month' =>data_get($draft,'tm_month')] ) }}';"> <button class="ui purple compact icon button" type="button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => data_get($draft,'tm_phase'), 'month' =>data_get($draft,'tm_month'), 'year'=>data_get($draft,'tm_year')] ) }}';">
<i class="edit outline icon"></i> <i class="edit outline icon"></i>
</button> </button>
<button class="ui red compact icon button" type="button" onclick="window.location.href='{{ route('timesheet::form.deletedraft', ['tmid'=>data_get($draft,'id')]) }}';"> <button class="ui red compact icon button" type="button" onclick="window.location.href='{{ route('timesheet::form.deletedraft', ['tmid'=>data_get($draft,'id')]) }}';">
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
Save Save
</button> --> </button> -->
<button type="button" class="center aligned ui purple compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month]) }}';"> <button type="button" class="center aligned ui purple compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => $phase, 'month' => $month, 'year'=> $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Back To Overhead Form Back To Overhead Form
</button> </button>
......
...@@ -23,16 +23,16 @@ input[type=number] { ...@@ -23,16 +23,16 @@ input[type=number] {
<div class="ui segment"> <div class="ui segment">
<a class="ui purple left ribbon label"> <a class="ui purple left ribbon label">
<h3> <!-- <h3> -->
Overhead Form Overhead Form
</h3> <!-- </h3> -->
</a> </a>
<br> <br>
<br> <br>
@if($lastupdated) @if($lastupdated)
<div class="ui right floated center compact aligned basic right button"> <div class="tiny ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
Last Updated : {{ date('d/m/Y', strtotime(data_get($lastupdated,'updated_at'))) }} Last Updated : {{ date('d/m/Y', strtotime(data_get($lastupdated,'updated_at'))) }}
...@@ -41,7 +41,7 @@ input[type=number] { ...@@ -41,7 +41,7 @@ input[type=number] {
</div> </div>
@endif @endif
<div class="ui right floated center compact aligned basic right button"> <div class="tiny ui right floated center compact aligned basic right button">
<div class="header item" style="color: #000000;"> <div class="header item" style="color: #000000;">
<strong> <strong>
@if($phase == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, $month, 10)) }} - {{ $year }} @if($phase == 1) 1st Halfmonth @else 2nd Half-month @endif - {{ date("F", mktime(0, 0, 0, $month, 10)) }} - {{ $year }}
...@@ -49,23 +49,197 @@ input[type=number] { ...@@ -49,23 +49,197 @@ input[type=number] {
</div> </div>
</div> </div>
<button class="center aligned ui blue compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';"> <button class="tiny center aligned ui blue compact labeled icon button" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Go to Chargeable Form Go to Chargeable Form
</button> </button>
@if($checkoverhead) @if($checkoverhead)
<button class="center aligned ui yellow compact labeled icon button" id="notes" onclick="window.location.href='{{ route('timesheet::form.notelist', ['year'=> $year, 'month'=> $month, 'phase'=> $phase, 'fk_tm_id'=> $fk_tm_id] ) }} ';"> <button class="tiny center aligned ui yellow compact labeled icon button" id="notes" onclick="window.location.href='{{ route('timesheet::form.notelist', ['year'=> $year, 'month'=> $month, 'phase'=> $phase, 'fk_tm_id'=> $fk_tm_id] ) }} ';">
<i class="plus icon"></i> <i class="plus icon"></i>
Add Task Description Add Task Description
</button> </button>
@else @else
@endif @endif
<a href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}" class="center aligned ui pink compact right labeled icon button" target="_blank"> <a href="{{ route('timesheet::dashboard.timesheetViewer', ['phase' => $phase, 'month' => $month, 'year' => $year]) }}" class="tiny center aligned ui pink compact right labeled icon button" target="_blank">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
View and Submit Timesheet View and Submit Timesheet
</a> </a>
<a href="{{ route('timesheet::form.sync', ['tmid' => $fk_tm_id]) }}" class="tiny center aligned ui gery compact right labeled icon button">
<i class="sync icon"></i>
Sync from Webtas
</a>
<!-- Table Chargeable Start -->
<table id="printtable2" class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2" rowspan="2" class="center aligned" style="width: 27%;">Chargeable</th>
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th colspan="" rowspan="2" class="center aligned">Total</th>
</tr>
<tr>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th style="width: 4%;">{{$i+1}}</th>
@endfor
@endif
</tr>
<tr>
<!-- <th style="width: 4%;"></th> -->
<th style="width: 10%;">Project Code</th>
<th style="width: 13%;">Project Name</th>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<th>{{$strdays[$i]}}</th>
@endfor
@endif
<th>Hours</th>
<!-- <th>Days</th> -->
</tr>
</thead>
<tbody>
@if(count($chargeablelist) > 0)
@foreach($chargeablelist as $key => $projectchargeable)
<?php $totalcharge = 0; ?>
<tr>
<!-- <td style="width: 4%;"></td> -->
<td style="width: 10%;">{{ $projectchargeable['pcode']}}</td>
<td style="width: 13%;">{{ $projectchargeable['pname']}}</td>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{
$valchargehour = $chargehour->where('td_date','=',$date)
->where('td_project',$projectchargeable['pid'])
->where('tm_phase',$phase)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
}
?>
@if($valchargehour)
<td style="width: 4%;">
@if(data_get($valchargehour,'td_hours') == 0)
@else {{ data_get($valchargehour,'td_hours') }}
@endif
</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$valchargehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($chargehour)
{
$valchargehour = $chargehour->where('td_date','=',$date)
->where('td_project',$projectchargeable['pid'])
->where('tm_phase',$phase)
->first();
$totalcharge += data_get($valchargehour,'td_hours');
}
?>
@if($valchargehour)
<td style="width: 4%;">
@if(data_get($valchargehour,'td_hours') == 0)
@else {{ data_get($valchargehour,'td_hours') }}
@endif
</td>
@else
<td style="width: 4%;"></td>
@endif
@endfor
@endif
@if($totalcharge)
<td style="width: 5%">{{ number_format($totalcharge, 1, '.', '') }}</td>
<!-- <td style="width: 5%">{{ number_format($totalcharge/8, 1, '.', '') }}</td> -->
@else
<td style="width: 5%">0</td>
<!-- <td style="width: 5%">0</td> -->
@endif
</tr>
@endforeach
@else
<tr>
<td class="text-center" colspan="@if($phase==1){{5+15}} @else {{5+($daymonth-15)}} @endif">No Data Project</td>
</tr>
@endif
</tbody>
<tfoot>
<th colspan="2">Total</th>
<?php $totalchargeableall = 0; ?>
@if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
<?php
$totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($chargehour) {
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += data_get($value,'td_hours');
}
$totalchargeableall += $totalcbyday;
}
?>
<th>{{ number_format($totalcbyday, '1', '.', '') }}</th>
@endfor
@else
@for($i = 15; $i < $daymonth; $i++)
<?php
$totalcbyday = 0;
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if ($chargehour) {
$valcbyday = $chargehour->where('td_date','=', $date)
->where('tm_phase',$phase);
foreach($valcbyday as $key => $value) {
$totalcbyday += data_get($value,'td_hours');
}
$totalchargeableall += $totalcbyday;
}
?>
<th>{{ number_format($totalcbyday, '1', '.', '') }}</th>
@endfor
@endif
<th style="width: 5%">@if($totalchargeableall){{ number_format($totalchargeableall, 1, '.', '') }}@else 0.0 @endif</th>
<!-- <th style="width: 5%">@if($totalchargeableall){{ number_format($totalchargeableall/8, 1, '.', '') }}@else 0.0 @endif</th> -->
</tfoot>
</table>
<!-- Table Chargeable End -->
<form class="ui form" action="{{ route('timesheet::form.saveoverheadhours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.saveoverheadhours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="userId" value="{{$userId}}"> <input type="hidden" name="userId" value="{{$userId}}">
...@@ -73,14 +247,15 @@ input[type=number] { ...@@ -73,14 +247,15 @@ input[type=number] {
<input type="hidden" name="month" value="{{$month}}"> <input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}"> <input type="hidden" name="phase" value="{{$phase}}">
{{-- <div class="table-responsive" style="overflow-x: auto; height: 400px; white-space: nowrap;"> --}}
<table class="ui celled structured unstackable table" > <table class="ui celled structured unstackable table" >
<thead> <thead>
<tr> <tr>
<th rowspan="3" class="center aligned">Overhead</th> <th rowspan="3" class="center aligned" style="width: 27%;">Overhead</th>
<!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> --> <!-- <th colspan="{{count($lat)}}" class="center aligned">Date</th> -->
<th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th> <th colspan="@if($phase == 1) 15 @else {{$daymonth-15}} @endif" class="center aligned">Date</th>
<th rowspan="2"> <th rowspan="2" class="center aligned" style="width: 10%;">Total
<!-- <button type="submit" class="fluid center aligned ui blue compact labeled icon button"> <!-- <button type="submit" class="fluid center aligned ui blue compact labeled icon button">
<i class="save icon"></i> <i class="save icon"></i>
Save as Draft Save as Draft
...@@ -89,7 +264,7 @@ input[type=number] { ...@@ -89,7 +264,7 @@ input[type=number] {
</tr> </tr>
<tr> <tr>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $date) {{-- @foreach($lat as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<th class="center aligned"> <th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
...@@ -99,14 +274,61 @@ input[type=number] { ...@@ -99,14 +274,61 @@ input[type=number] {
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }} {{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th> </th>
@endif @endif
@endforeach @endforeach --}}
@if($phase == 1) @if($phase == 1)
@for($i = count($lat); $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{$i+1}}</th> @php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{$i+1}}</th> {{-- <th class="center aligned">{{$i+1}}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $i+1 }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date_parse_from_format('Y-m-d', data_get($date,'DATE'))['day'] }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
...@@ -123,7 +345,7 @@ input[type=number] { ...@@ -123,7 +345,7 @@ input[type=number] {
</tr> </tr>
<tr> <tr>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $date) {{-- @foreach($lat as $key => $date)
@if(data_get($date,'attendance_status') == 1) @if(data_get($date,'attendance_status') == 1)
<th class="center aligned"> <th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }} {{ date('D', strtotime(data_get($date,'DATE')) ) }}
...@@ -133,14 +355,61 @@ input[type=number] { ...@@ -133,14 +355,61 @@ input[type=number] {
{{ date('D', strtotime(data_get($date,'DATE')) ) }} {{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th> </th>
@endif @endif
@endforeach @endforeach --}}
@if($phase == 1) @if($phase == 1)
@for($i = count($lat); $i < 15 ; $i++) @for($i = 0; $i < 15 ; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th> @php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<th class="center aligned">{{ $strdays[$i] }}</th> {{-- <th class="center aligned">{{ $strdays[$i] }}</th> --}}
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
@endphp
@if($filteredData->isEmpty())
<th class="center aligned">
{{ $strdays[$i] }}
</th>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<th class="center aligned">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@else
<th class="center aligned" style="background-color: #DCDCDC;">
{{ date('D', strtotime(data_get($date,'DATE')) ) }}
</th>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
...@@ -170,43 +439,19 @@ input[type=number] { ...@@ -170,43 +439,19 @@ input[type=number] {
</td> </td>
@if(count($lat) > 0) @if(count($lat) > 0)
@foreach($lat as $key => $value)
<?php
// dd($value);
$day = date_parse_from_format('Y-m-d', data_get($value,'DATE'))['day'];
// dd($day);
$valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $day); @if($phase == 1)
@for($i = 0; $i < 15 ; $i++)
if($hour) @php
{ $filteredData = $lat->filter(function ($item) use ($i) {
$valuehour = $hour->where('td_date','=',$date) return date('d', strtotime($item['DATE'])) == $i+1;
->where('fk_o_id',$project['td_project']) });
->where('tm_phase',$phase)
->first();
$total += data_get($valuehour,'td_hours');
}
?>
@if(data_get($value,'attendance_status') == 1)
<td style="width: 5%;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@else
<td style="width: 5%; background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$day}}]" name="hour[{{$project['td_project']}}][{{$day}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@endif
@endforeach
@if($phase == 1)
@for($i = count($lat); $i < 15 ; $i++)
<?php
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
if($hour) if($hour)
{ {
...@@ -217,14 +462,34 @@ input[type=number] { ...@@ -217,14 +462,34 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
?> @endphp
<td >
@if($filteredData->isEmpty())
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{ $project['td_project'] }}');">
</td>
@endif
@endforeach
@endif
@endfor @endfor
@else @else
@for($i = 15+count($lat); $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php
@php
$filteredData = $lat->filter(function ($item) use ($i) {
return date('d', strtotime($item['DATE'])) == $i+1;
});
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -237,10 +502,25 @@ input[type=number] { ...@@ -237,10 +502,25 @@ input[type=number] {
$total += data_get($valuehour,'td_hours'); $total += data_get($valuehour,'td_hours');
} }
?> @endphp
<td>
@if($filteredData->isEmpty())
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@else
@foreach($filteredData as $key => $date)
@if(data_get($date,'attendance_status') == 1)
<td class="center aligned">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');"> <input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset" onchange="limiter(this,'{{$project['td_project']}}');">
</td> </td>
@else
<td class="center aligned" style="background-color: #DCDCDC;">
<input type="text" onkeypress="onlynumber(event)" id="hour[{{$project['td_project']}}][{{$i+1}}]" name="hour[{{$project['td_project']}}][{{$i+1}}]" value="@if($valuehour){{data_get($valuehour,'td_hours')}}@else @endif" min="0" max="24" style="padding:2px;margin:unset;background-color: #DCDCDC;" onchange="limiter(this,'{{$project['td_project']}}');">
</td>
@endif
@endforeach
@endif
@endfor @endfor
@endif @endif
@else @else
...@@ -296,6 +576,7 @@ input[type=number] { ...@@ -296,6 +576,7 @@ input[type=number] {
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
{{-- </div> --}}
<?php <?php
// dd(data_get($checkoverhead,'tm_timesheet_master_sts')); // dd(data_get($checkoverhead,'tm_timesheet_master_sts'));
......
...@@ -14,9 +14,15 @@ ...@@ -14,9 +14,15 @@
<label>Month</label> <label>Month</label>
<select name="month" class="ui fluid dropdown" required="required"> <select name="month" class="ui fluid dropdown" required="required">
@if($currmonth == 1 && date('j') < 16)
@foreach ($month as $key => $value)
<option value="{{ $key+1 }}" @if($key+1 == 12) selected="selected" @endif>{{ $value }}</option>
@endforeach
@else
@foreach ($month as $key => $value) @foreach ($month as $key => $value)
<option value="{{ $key+1 }}" @if($key+1 == date('m')) selected="selected" @endif>{{ $value }}</option> <option value="{{ $key+1 }}" @if($key+1 == date('m')) selected="selected" @endif>{{ $value }}</option>
@endforeach @endforeach
@endif
</select> </select>
</div> </div>
...@@ -28,7 +34,17 @@ ...@@ -28,7 +34,17 @@
</select> </select>
</div> </div>
@if($currmonth == 1) {{-- yg year tu dah x boleh pilih 2023? sbb ade lagi pss yg lom submit tahun 2023 -> shikin 18/01/2024 --}}
<div class="three wide field">
<label>Year</label>
<select name="year" class="ui fluid dropdown" required="required">
<option value="{{ $curryear }}">{{ $curryear }}</option>
<option value="{{ $curryear-1 }}">{{ $curryear-1 }}</option>
</select>
</div>
{{-- @if($currmonth == 1 && date('j') < 16)
<div class="three wide field"> <div class="three wide field">
<label>Year</label> <label>Year</label>
<select name="year" class="ui fluid dropdown" required="required"> <select name="year" class="ui fluid dropdown" required="required">
...@@ -41,7 +57,7 @@ ...@@ -41,7 +57,7 @@
<label>Year</label> <label>Year</label>
<input type="text" name="year" class="ui fluid dropdown" value="{{ $curryear }}" readonly="readonly"> <input type="text" name="year" class="ui fluid dropdown" value="{{ $curryear }}" readonly="readonly">
</div> </div>
@endif @endif --}}
</div> </div>
<button class="ui green button" type="submit">Open Form</button> <button class="ui green button" type="submit">Open Form</button>
......
...@@ -41,6 +41,18 @@ ...@@ -41,6 +41,18 @@
</div> </div>
</div> </div>
<div class="two fields">
<div class="eight wide field">
<label>Start Date</label>
<input type="date" name="startdate">
</div>
<div class="eight wide field">
<label>End Date</label>
<input type="date" name="enddate">
</div>
</div>
<input type="hidden" name="status" value="1"> <input type="hidden" name="status" value="1">
<!-- <div class="field"> <!-- <div class="field">
<label>Project Status</label> <label>Project Status</label>
......
...@@ -30,6 +30,19 @@ ...@@ -30,6 +30,19 @@
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="two fields">
<div class="eight wide field">
<label>Start Date</label>
<!-- <input type="hidden" name="startdate" value="{{ data_get($project,'start_date') }}"> -->
<input placeholder="{{ date('d-m-Y', strtotime(data_get($project,'start_date'))) }}" name="startdate" value="{{ data_get($project,'start_date') }}" class="textbox-n" type="text" onfocus="(this.type='date')" onblur="(this.type='text')" id="date" />
</div>
<div class="eight wide field">
<label>End Date</label>
<!-- <input type="hidden" name="enddate" value="{{ data_get($project,'end_date') }}"> -->
<input placeholder="{{ date('d-m-Y', strtotime(data_get($project,'end_date'))) }}" name="enddate" value="{{ data_get($project,'end_date') }}" class="textbox-n" type="text" onfocus="(this.type='date')" onblur="(this.type='text')" id="date" />
</div>
</div>
<div class="field"> <div class="field">
<label>Project Status</label> <label>Project Status</label>
<select name="status" class="ui fluid dropdown"> <select name="status" class="ui fluid dropdown">
......
...@@ -75,13 +75,17 @@ ...@@ -75,13 +75,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($list as $key => $listname) @forelse($list as $key => $listname)
<tr> <tr>
<td class="center aligned" data-label="no">{{ $key+1 }}</td> <td class="center aligned" data-label="no">{{ $key+1 }}</td>
<td data-label="name">{{ data_get($listname,'name') }}</td> <td data-label="name">{{ data_get($listname,'name') }}</td>
<td data-label="department">{{ data_get($listname,'department') }}</td> <td data-label="department">{{ data_get($listname,'department') }}</td>
</tr> </tr>
@endforeach @empty
<tr>
<td class="center aligned" data-label="no" colspan="3">No Data</td>
</tr>
@endforelse
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -72,12 +72,22 @@ ...@@ -72,12 +72,22 @@
<tr> <tr>
<th style="width: 10%">Project </th> <th style="width: 10%">Project </th>
<th style="width: 1%">:</th> <th style="width: 1%">:</th>
<th colspan="2"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th> <th style="width: 20%"> {{data_get($pdetail,'pcode')}} - {{data_get($pdetail,'pname')}}</th>
<th style="width: 10%">Start Date </th>
<th style="width: 1%">:</th>
<th style="width: 20%">
@if(data_get($pdetail,'start_date')) {{ date("j M Y", strtotime(data_get($pdetail,'start_date'))) }} @endif
</th>
</tr> </tr>
<tr> <tr>
<th style="width: 10%"> Month/Year</th> <th style="width: 10%"> Month/Year</th>
<th style="width: 1%">:</th> <th style="width: 1%">:</th>
<th colspan="2"> {{$month}} {{$year}}</th> <th style="width: 20%"> {{$month}} {{$year}}</th>
<th style="width: 10%"> End Date</th>
<th style="width: 1%">:</th>
<th style="width: 20%">
@if(data_get($pdetail,'end_date')) {{ date("j M Y", strtotime(data_get($pdetail,'end_date'))) }} @endif
</th>
</tr> </tr>
</thead> </thead>
</table> </table>
...@@ -147,7 +157,7 @@ ...@@ -147,7 +157,7 @@
$currhour = 0; $currhour = 0;
$currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id')); $currmonthhours = $currentmonthhours->where('staffid', data_get($team,'pt_staff_id'));
foreach ($currmonthhours as $key => $hours) { foreach ($currmonthhours as $key => $hours) {
$currhour = data_get($hours,'tp_hours'); $currhour += data_get($hours,'tp_hours');
} }
// dd($currmonthhours); // dd($currmonthhours);
?> ?>
......
...@@ -145,15 +145,30 @@ ...@@ -145,15 +145,30 @@
<td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalc/8, 1, '.', '') }}</td>
@endif @endif
<?php $totalnc = 0; ?> <?php $totalnc = $ocuti = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<td class="center aligned"> <td class="center aligned">
<?php $monthly_hours = 0; ?> <?php $monthly_hours = 0; ?>
@foreach($ovhours as $key => $hours) @foreach($ovhours as $key => $hours)
@if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid')) @if(data_get($staff,'staffid') == data_get($hours,'staffid') && data_get($value,'id') == data_get($hours,'oid'))
<!-- {{data_get($hours,'hours')}} --> <!-- {{data_get($hours,'hours')}} -->
<?php $monthly_hours += data_get($hours,'hours') ?> <?php
<!-- <?php $totalnc += data_get($hours,'hours'); ?> --> $monthly_hours += data_get($hours,'hours');
if (data_get($hours,'oid') == 6) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 7) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 8) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 10) {
$ocuti += data_get($hours,'hours');
}else if (data_get($hours,'oid') == 15) {
$ocuti += data_get($hours,'hours');
}else{
}
$totalnc += data_get($hours,'hours');
?>
@endif @endif
@endforeach @endforeach
...@@ -165,7 +180,9 @@ ...@@ -165,7 +180,9 @@
@endforeach @endforeach
<td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc, '1', '.', '') }}</td>
<td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td> <td class="center aligned">{{ number_format($totalnc/8, 1, '.', '') }}</td>
<?php $totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?> <?php
$totalnc -= $ocuti;
$totaldays = number_format($totalc/8, 1, '.', '') + number_format($totalnc/8, 1, '.', ''); ?>
<td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td> <td class="center aligned">{{ number_format($totaldays, '1', '.', '') }}</td>
</tr> </tr>
</tbody> </tbody>
...@@ -198,13 +215,25 @@ ...@@ -198,13 +215,25 @@
<th class="text-center">{{ number_format($tch, '1', '.', '') }}</th> <th class="text-center">{{ number_format($tch, '1', '.', '') }}</th>
<th class="text-center">{{ number_format($tch/8, 1, '.', '') }}</th> <th class="text-center">{{ number_format($tch/8, 1, '.', '') }}</th>
@endif @endif
<?php $totaloverhead = 0; ?> <?php $totaloverhead = 0;$cuti = 0; ?>
@foreach($overhead as $key => $value) @foreach($overhead as $key => $value)
<?php <?php
$monthly_ov = 0; $monthly_ov = 0;
$oid = data_get($value,'id'); $oid = data_get($value,'id');
$ov = $ovhours->where('oid', $oid); $ov = $ovhours->where('oid', $oid);
foreach ($ov as $key => $val) { foreach ($ov as $key => $val) {
if (data_get($val,'oid') == 6) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 7) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 8) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 10) {
$cuti += data_get($val,'hours');
}else if (data_get($val,'oid') == 15) {
$cuti += data_get($val,'hours');
}else{
}
$monthly_ov += data_get($val,'hours'); $monthly_ov += data_get($val,'hours');
} }
?> ?>
......
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">List of Users</a>
<br>
<br>
<button class="tiny center aligned ui purple right compact labeled icon button" onclick="window.location.href='{{ route('timesheet::users.syncNewUsers') }}';">
<i class="angle double right icon"></i>
Sync New User
</button>
<br>
<br>
<table id="listUser" class="datatable">
<thead>
<tr>
<th>No</th>
<th>Name</th>
<th>Email</th>
<th>Status</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
@foreach($users as $key => $user)
<?php
// dd($user);
?>
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$user->name}}</td>
<td>{{$user->email}}</td>
<td>{{$user->status}}</td>
<td>{{$user->created_at}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
@push('script')
<script>
$(document).ready(function() {
$('#listUser').DataTable({
"searching": true,
"bSort": false,
"pageLength": 50,
language: {
url: "{{ url('web/d.json') }}" // file yang translate ke bahasa melayu
}
});
});
</script>
@endpush
\ No newline at end of file
...@@ -6,6 +6,7 @@ use Illuminate\Routing\Controller; ...@@ -6,6 +6,7 @@ use Illuminate\Routing\Controller;
use Carbon\Carbon; use Carbon\Carbon;
use DB; use DB;
use Portal\Timesheet\Model\Users; use Portal\Timesheet\Model\Users;
use Portal\Timesheet\Model\NotesAttachement;
use Portal\Timesheet\Model\Ts_master; use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\Ts_detail; use Portal\Timesheet\Model\Ts_detail;
use Portal\Timesheet\Model\Project; use Portal\Timesheet\Model\Project;
...@@ -30,13 +31,13 @@ use App\Mail\StatusAccept; ...@@ -30,13 +31,13 @@ use App\Mail\StatusAccept;
use App\Mail\StatusReject; use App\Mail\StatusReject;
use App\Mail\EditProject; use App\Mail\EditProject;
use App\Mail\PmRejectProject; use App\Mail\PmRejectProject;
use App\Mail\BodRejectProject;
use Mail; use Mail;
use Curl; use Curl;
use Auth; use Auth;
class DashboardController extends Controller class DashboardController extends Controller
{ {
public function index() public function index()
{ {
...@@ -63,7 +64,7 @@ class DashboardController extends Controller ...@@ -63,7 +64,7 @@ class DashboardController extends Controller
$verifier = Users::find(Auth::id()); $verifier = Users::find(Auth::id());
$profile = VwReviewProfile::where('hod_id', $verifier->id) $profile = VwReviewProfile::where('hod_id', $verifier->id)
->whereIn('status', [2,3]) ->whereIn('status', [2,3,5,6])
->with('overheads') ->with('overheads')
->orderby('tm_year', 'desc') ->orderby('tm_year', 'desc')
->orderby('tm_month', 'desc') ->orderby('tm_month', 'desc')
...@@ -71,19 +72,19 @@ class DashboardController extends Controller ...@@ -71,19 +72,19 @@ class DashboardController extends Controller
->get(); ->get();
$staffnotes = Tproject::where('tp_project_type', 3) $staffnotes = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->where('staffid', $verifier->u_staffID) ->where('staffid', $verifier->u_staffID)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->with('notes') ->with('notes')
->get(); ->get();
$details = Tproject::where('tp_project_type', 3) $details = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->where('tp_pm', $verifier->id) ->where('tp_pm', $verifier->id)
->with('notes') ->with('notes')
->get(); ->get();
$checkts = Ts_master::whereIn('tm_timesheet_master_sts', [2,3,6]) $checkts = Ts_master::whereIn('tm_timesheet_master_sts', [2,3,5,6])
->with('attachement') ->with('attachement')
->get(); ->get();
...@@ -92,20 +93,21 @@ class DashboardController extends Controller ...@@ -92,20 +93,21 @@ class DashboardController extends Controller
->u_staffID; ->u_staffID;
$timesheet = Ts_master::where('tm_staff_id', $staffid) $timesheet = Ts_master::where('tm_staff_id', $staffid)
->where('tm_timesheet_master_sts', '<>', 1) ->whereIn('tm_timesheet_master_sts', [2,3,5,6])
->orderby('tm_year') ->orderby('tm_year', 'DESC')
->orderby('tm_month', 'DESC') ->orderby('tm_month', 'DESC')
->orderby('tm_phase', 'DESC') ->orderby('tm_phase', 'DESC')
->get(); ->get();
$projects = Tproject::where('staffid', $staffid) $projects = Tproject::where('staffid', $staffid)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->where('tp_timesheet_sts', '<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->with('project') ->with('project')
->with('overhead') ->with('overhead')
->with('hod') ->with('hod')
->with('bod') ->with('bod')
->get(); ->get();
// dd($projects);
return view('timesheet::dashboard.dashboardhod', compact('profile', 'details', 'checkts', 'verifier', 'timesheet', 'projects', 'staffnotes')); return view('timesheet::dashboard.dashboardhod', compact('profile', 'details', 'checkts', 'verifier', 'timesheet', 'projects', 'staffnotes'));
...@@ -125,6 +127,7 @@ class DashboardController extends Controller ...@@ -125,6 +127,7 @@ class DashboardController extends Controller
->with('team') ->with('team')
->with('tproject') ->with('tproject')
->get(); ->get();
// dd($profiles);
$tmid = []; $tmid = [];
foreach ($profiles as $key => $value) { foreach ($profiles as $key => $value) {
...@@ -154,6 +157,7 @@ class DashboardController extends Controller ...@@ -154,6 +157,7 @@ class DashboardController extends Controller
->orderby('tm_phase', 'desc') ->orderby('tm_phase', 'desc')
->get(); ->get();
// dd($profile); // dd($profile);
$detailsverification = Tproject::where('tp_project_type', 3) $detailsverification = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1) ->where('tp_timesheet_sts','<>', 1)
->where('tp_pm', $verifier->id) ->where('tp_pm', $verifier->id)
...@@ -163,7 +167,25 @@ class DashboardController extends Controller ...@@ -163,7 +167,25 @@ class DashboardController extends Controller
$checkts = Ts_master::whereIn('tm_timesheet_master_sts', [2,3,5,6]) $checkts = Ts_master::whereIn('tm_timesheet_master_sts', [2,3,5,6])
->with('attachement') ->with('attachement')
->get(); ->get();
return view('timesheet::dashboard.dashboardbod', compact('approval', 'profiles', 'detailsverification', 'checktd', 'profile', 'checkts', 'details'));
$chargeprofile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'pmstaffid', 'dept')
->where('pmstaffid', $verifier->u_staffID)
// ->where('status', '<>', 1)
->whereIn('status', [2,3,5,6])
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
->with('countoverhead')
// ->with('department')
->get();
$chargedetails = Tproject::where('tp_pm', $verifier->u_staffID)
// ->where('tp_timesheet_sts', 2)
->with('project')
->with('pm')
->get();
return view('timesheet::dashboard.dashboardbod', compact('approval', 'profiles', 'detailsverification', 'checktd', 'profile', 'chargeprofile', 'chargedetails', 'checkts', 'details'));
} }
if ( $roleid == '8') { if ( $roleid == '8') {
...@@ -183,9 +205,9 @@ class DashboardController extends Controller ...@@ -183,9 +205,9 @@ class DashboardController extends Controller
->get(); ->get();
// dd($profile); // dd($profile);
$staffnotes = Tproject::where('tp_project_type', 3) $staffnotes = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->where('staffid', $verifier->u_staffID) ->where('staffid', $verifier->u_staffID)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->with('notes') ->with('notes')
->get(); ->get();
...@@ -196,7 +218,7 @@ class DashboardController extends Controller ...@@ -196,7 +218,7 @@ class DashboardController extends Controller
->get(); ->get();
//timesheet status //timesheet status
$staffinfo = Staff_info::where('id',Auth::id()) $staffinfo = Staff_info::where('fk_users',Auth::id())
->with('pelulus') ->with('pelulus')
->first(); ->first();
...@@ -204,15 +226,15 @@ class DashboardController extends Controller ...@@ -204,15 +226,15 @@ class DashboardController extends Controller
->u_staffID; ->u_staffID;
$timesheet = Ts_master::where('tm_staff_id', $staffid) $timesheet = Ts_master::where('tm_staff_id', $staffid)
->where('tm_timesheet_master_sts', '<>', 1) ->whereIn('tm_timesheet_master_sts', [2,3,5,6])
->orderby('tm_year') ->orderby('tm_year', 'DESC')
->orderby('tm_month', 'DESC') ->orderby('tm_month', 'DESC')
->orderby('tm_phase', 'DESC') ->orderby('tm_phase', 'DESC')
->get(); ->get();
$projects = Tproject::where('staffid', $staffid) $projects = Tproject::where('staffid', $staffid)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->where('tp_timesheet_sts', '<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->with('project') ->with('project')
->with('overhead') ->with('overhead')
->with('hod') ->with('hod')
...@@ -226,7 +248,7 @@ class DashboardController extends Controller ...@@ -226,7 +248,7 @@ class DashboardController extends Controller
$verifier = Users::find(Auth::id()); $verifier = Users::find(Auth::id());
$profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'roleid', 'pmstaffid', 'dept') $profile = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'pmstaffid', 'dept')
->where('pmstaffid', $verifier->u_staffID) ->where('pmstaffid', $verifier->u_staffID)
// ->where('status', '<>', 1) // ->where('status', '<>', 1)
->whereIn('status', [2,3,5,6]) ->whereIn('status', [2,3,5,6])
...@@ -236,11 +258,31 @@ class DashboardController extends Controller ...@@ -236,11 +258,31 @@ class DashboardController extends Controller
->with('countoverhead') ->with('countoverhead')
// ->with('department') // ->with('department')
->get(); ->get();
// dd($profile);
$staffpms = [];
foreach ($profile as $key => $value) {
if (data_get($value,'dept') == 4) {
$staffpms[] = $value->staff_id;
}
}
$ovprofiles = VwChargeableVerification::select('tmid', 'staff_id', 'year', 'month', 'phase', 'status', 'submission', 'fullname', 'pmstaffid', 'dept')
->where('pmstaffid', $verifier->id)
// ->where('status', '<>', 1)
->whereIn('status', [2,3,5,6])
->whereNotIn('staff_id', $staffpms)
->distinct('staff_id')
->orderby('roleid')
->with('countchargeable')
->with('countoverhead')
->with('sname')
// ->with('department')
->get();
// dd($ovprofiles);
$staffnotes = Tproject::where('tp_project_type', 3) $staffnotes = Tproject::where('tp_project_type', 3)
// ->where('tp_timesheet_sts','<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->where('staffid', $verifier->u_staffID) ->where('staffid', $verifier->u_staffID)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->with('notes') ->with('notes')
->get(); ->get();
// dd($staffnotes); // dd($staffnotes);
...@@ -259,7 +301,7 @@ class DashboardController extends Controller ...@@ -259,7 +301,7 @@ class DashboardController extends Controller
// dd($overheads); // dd($overheads);
//timesheet status //timesheet status
$staffinfo = Staff_info::where('id',Auth::id()) $staffinfo = Staff_info::where('fk_users',Auth::id())
->with('pelulus') ->with('pelulus')
->first(); ->first();
...@@ -267,27 +309,27 @@ class DashboardController extends Controller ...@@ -267,27 +309,27 @@ class DashboardController extends Controller
->u_staffID; ->u_staffID;
$timesheet = Ts_master::where('tm_staff_id', $staffid) $timesheet = Ts_master::where('tm_staff_id', $staffid)
->where('tm_timesheet_master_sts', '<>', 1) ->whereIn('tm_timesheet_master_sts', [2,3,5,6])
->orderby('tm_year') ->orderby('tm_year', 'DESC')
->orderby('tm_month', 'DESC') ->orderby('tm_month', 'DESC')
->orderby('tm_phase', 'DESC') ->orderby('tm_phase', 'DESC')
->get(); ->get();
$projects = Tproject::where('staffid', $staffid) $projects = Tproject::where('staffid', $staffid)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->where('tp_timesheet_sts', '<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->with('project') ->with('project')
->with('overhead') ->with('overhead')
->with('hod') ->with('hod')
->with('bod') ->with('bod')
->get(); ->get();
return view('timesheet::dashboard.dashboardpmhod', compact('profile', 'details', 'verifier', 'overheads', 'staffinfo', 'timesheet', 'projects', 'roleid', 'staffnotes')); return view('timesheet::dashboard.dashboardpmhod', compact('profile', 'details', 'verifier', 'overheads', 'staffinfo', 'timesheet', 'projects', 'roleid', 'staffnotes', 'ovprofiles'));
} }
if (($roleid == ('5'||'6'))) { if (($roleid == ('5'||'6'))) {
$staffinfo = Staff_info::where('id',Auth::id()) $staffinfo = Staff_info::where('fk_users',Auth::id())
->with('pelulus') ->with('pelulus')
->first(); ->first();
// dd($staffinfo); // dd($staffinfo);
...@@ -298,15 +340,15 @@ class DashboardController extends Controller ...@@ -298,15 +340,15 @@ class DashboardController extends Controller
$staffs = Staff_info::where('status', 1)->get(); $staffs = Staff_info::where('status', 1)->get();
// dd($staffs); // dd($staffs);
$timesheet = Ts_master::where('tm_staff_id', $staffid) $timesheet = Ts_master::where('tm_staff_id', $staffid)
->where('tm_timesheet_master_sts', '<>', 1) ->whereIn('tm_timesheet_master_sts', [2,3,4,5,6])
->orderby('tm_year') ->orderby('tm_year', 'DESC')
->orderby('tm_month', 'DESC') ->orderby('tm_month', 'DESC')
->orderby('tm_phase', 'DESC') ->orderby('tm_phase', 'DESC')
->get(); ->get();
$projects = Tproject::where('staffid', $staffid) $projects = Tproject::where('staffid', $staffid)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->where('tp_timesheet_sts', '<>', 1) ->whereIn('tp_timesheet_sts', [2,3,4,5,6])
->with('project') ->with('project')
->with('overhead') ->with('overhead')
->with('hod') ->with('hod')
...@@ -315,9 +357,9 @@ class DashboardController extends Controller ...@@ -315,9 +357,9 @@ class DashboardController extends Controller
// dd($projects); // dd($projects);
$staffnotes = Tproject::where('tp_project_type', 3) $staffnotes = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1) ->whereIn('tp_timesheet_sts', [2,3,4,5,6])
->where('staffid', $staffid) ->where('staffid', $staffid)
->where('tp_year', date('Y')) // ->where('tp_year', date('Y'))
->with('notes') ->with('notes')
->get(); ->get();
// dd($staffnotes); // dd($staffnotes);
...@@ -334,7 +376,7 @@ class DashboardController extends Controller ...@@ -334,7 +376,7 @@ class DashboardController extends Controller
->get(); ->get();
// dd($profile); // dd($profile);
$details = Tproject::where('tp_project_type', 3) $details = Tproject::where('tp_project_type', 3)
->where('tp_timesheet_sts','<>', 1) ->whereIn('tp_timesheet_sts', [2,3,5,6])
->where('tp_pm', $verifier->id) ->where('tp_pm', $verifier->id)
->with('notes') ->with('notes')
->get(); ->get();
...@@ -380,12 +422,12 @@ class DashboardController extends Controller ...@@ -380,12 +422,12 @@ class DashboardController extends Controller
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y'))); $month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
} }
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
$timesheets = Ts_master::where('tm_staff_id', data_get($user,'staff_id')) $timesheets = Ts_master::where('tm_staff_id', data_get($user,'staff_id'))
->where('tm_timesheet_master_sts','<>',1) ->where('tm_timesheet_master_sts','<>',1)
->orderby('tm_year','desc') ->orderby('tm_year','desc')
->orderby('tm_month','desc')
->orderby('tm_phase','desc') ->orderby('tm_phase','desc')
->orderby('tm_year','desc')
->get(); ->get();
return view('timesheet::dashboard.filterViewer', compact('month', 'curryear', 'currmonth', 'timesheets')); return view('timesheet::dashboard.filterViewer', compact('month', 'curryear', 'currmonth', 'timesheets'));
...@@ -623,13 +665,14 @@ class DashboardController extends Controller ...@@ -623,13 +665,14 @@ class DashboardController extends Controller
public function revaction(Request $request) public function revaction(Request $request)
{ {
$page = data_get($request,'page');
// dd($request); // dd($request);
$page = data_get($request,'page');
$hod = Users::find(Auth::id()); $hod = Users::find(Auth::id());
$profile = Tproject::where('id', $request->tpid) $profile = Tproject::where('id', $request->tpid)
->with('team') ->with('team')
->with('hod') ->with('hod')
->with('notes')
->first(); ->first();
// dd($profile); // dd($profile);
...@@ -918,6 +961,7 @@ class DashboardController extends Controller ...@@ -918,6 +961,7 @@ class DashboardController extends Controller
public function verify(Request $request) public function verify(Request $request)
{ {
// dd($request);
if($request->action == 2 && $request->remarks == null) if($request->action == 2 && $request->remarks == null)
{ {
...@@ -1030,17 +1074,32 @@ class DashboardController extends Controller ...@@ -1030,17 +1074,32 @@ class DashboardController extends Controller
$data_email = [ $data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected', 'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com', 'sender_name' => '3fetimesheet@gmail.com',
'pcode' => data_get($profile,'project.p_project_code'),
'projectmanager' => data_get($profile,'pm.fullname'),
'projectdirector' => data_get($profile,'bod.fullname'),
'projectname' => data_get($profile,'tp_project_name'),
'status' => data_get($profile,'tp_timesheet_sts'),
'remarks' => data_get($request,'remarks'), 'remarks' => data_get($request,'remarks'),
'staffname' => data_get($profile,'team.fullname'), 'staffname' => data_get($profile,'team.fullname'),
]; ];
Mail::to($mailTo)->send(new PmRejectProject($data_email, $data_timesheet)); $data_project = [];
// return new PmRejectProject($data_email, $data_timesheet); $data_overheads = [];
$detailprojects = Tproject::where('id', $request->tpid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->get();
// dd($detailprojects);
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
// dd($mailTo);
Mail::to($mailTo)->send(new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads));
// return new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads);
// dd($data_email); // dd($data_email);
...@@ -1075,6 +1134,7 @@ class DashboardController extends Controller ...@@ -1075,6 +1134,7 @@ class DashboardController extends Controller
public function verifyoverhead(Request $request) public function verifyoverhead(Request $request)
{ {
// dd($request);
if($request->action == 2 && $request->remarks == null) if($request->action == 2 && $request->remarks == null)
{ {
// dd('reject & tak komen'); // dd('reject & tak komen');
...@@ -1147,6 +1207,7 @@ class DashboardController extends Controller ...@@ -1147,6 +1207,7 @@ class DashboardController extends Controller
} else { } else {
// dd('haa');
$profile->tp_timesheet_sts = 6; $profile->tp_timesheet_sts = 6;
$profile->tp_verified_by = $request->verifier; $profile->tp_verified_by = $request->verifier;
$profile->tp_verified_at = $today; $profile->tp_verified_at = $today;
...@@ -1172,6 +1233,88 @@ class DashboardController extends Controller ...@@ -1172,6 +1233,88 @@ class DashboardController extends Controller
'hod_rejected_at' => $today, 'hod_rejected_at' => $today,
]); ]);
} }
// email start
$profile = Tproject::where('id', $request->tpid)->with('team')->first();
$tmid = $profile->fk_tm_id;
if (env('EMAIL_ENV') == 'local')
{
$mailTo = '143hannan@gmail.com';
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
$mailTo = '3fetimesheet@gmail.com';
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($profile,'team.email');
}
// dd($request);
$detailmaster = Ts_master::where('id', $tmid)->first();
// dd($detailmaster);
$data_timesheet = [
'year' => data_get($detailmaster,'tm_year'),
'month' => data_get($detailmaster,'tm_month'),
'phase' => data_get($detailmaster,'tm_phase'),
'submissionDate' => data_get($detailmaster,'tm_submission_at'),
];
$data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com',
'remarks' => data_get($request,'remarks'),
'staffname' => data_get($profile,'team.fullname'),
];
$detailprojects = Tproject::where('id', $request->tpid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->where('tp_project_type', 1)
->get();
$detailoverheads = Tproject::where('id', $request->tpid)
->with('team')
->with('hod')
->with('project')
->with('bod')
->where('tp_project_type', 3)
->get();
// dd($detailoverheads);
$data_project = [];
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
$data_overheads = [];
foreach ($detailoverheads as $key => $overhead) {
$data_overheads[$key]['pcode'] = data_get($overhead,'project.p_project_code');
$data_overheads[$key]['projectname'] = data_get($overhead,'tp_project_name');
$data_overheads[$key]['projectdirector'] = data_get($overhead,'bod.fullname');
$data_overheads[$key]['hod'] = data_get($overhead,'hod.fullname');
$data_overheads[$key]['remarks'] = data_get($request,'remarks');
}
Mail::to($mailTo)->send(new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads));
// return new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads);
// dd($data_overheads);
// dd($data_project);
// email end
// if(data_get($request,'page') == 1){ // if(data_get($request,'page') == 1){
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff overhead has been rejected'); return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff overhead has been rejected');
// } // }
...@@ -1327,6 +1470,7 @@ class DashboardController extends Controller ...@@ -1327,6 +1470,7 @@ class DashboardController extends Controller
public function approval(Request $request) public function approval(Request $request)
{ {
// dd($request);
if($request->action == 2 && $request->remarks == null) if($request->action == 2 && $request->remarks == null)
{ {
// dd('reject & tak komen'); // dd('reject & tak komen');
...@@ -1438,6 +1582,121 @@ class DashboardController extends Controller ...@@ -1438,6 +1582,121 @@ class DashboardController extends Controller
]); ]);
} }
// email start
$detailmaster = Ts_master::where('id', data_get($profile,'fk_tm_id'))
->with('staffs')
->first();
$data_timesheet = [
'year' => data_get($detailmaster,'tm_year'),
'month' => data_get($detailmaster,'tm_month'),
'phase' => data_get($detailmaster,'tm_phase'),
'submissionDate' => data_get($detailmaster,'tm_submission_at'),
];
$data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com',
'remarks' => data_get($request,'remarks'),
'staffname' => data_get($detailmaster,'staffs.fullname'),
];
$data_project = [];
if (data_get($request,'tpid')) {
$detailprojects = Tproject::where('id', $request->tpid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->where('tp_project_type', 1)
->get();
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['ccp'] = data_get($project,'pm.email');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
}
// dd($data_project);
$data_overheads = [];
if (data_get($request,'tpid')) {
$detailoverheads = Tproject::where('id', $request->tpid)
->with('team')
->with('hod')
->with('bod')
->where('tp_project_type', 3)
->get();
// dd($detailoverheads);
foreach ($detailoverheads as $key => $overhead) {
$data_overheads[$key]['projectname'] = data_get($overhead,'tp_project_name');
$data_overheads[$key]['projectdirector'] = data_get($overhead,'bod.fullname');
$data_overheads[$key]['hod'] = data_get($overhead,'hod.fullname');
$data_overheads[$key]['cco'] = data_get($overhead,'hod.email');
$data_overheads[$key]['remarks'] = data_get($request,'remarks');
}
}
if (env('EMAIL_ENV') == 'local')
{
$mailTo = '143hannan@gmail.com';
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
$mailTo = '3fetimesheet@gmail.com';
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = '143hannan@gmail.com';
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = '143hannan@gmail.com';
}
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($detailmaster,'staffs.email');
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = $value['ccp'];
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = $value['cco'];
}
}
// dd(data_get($detailmaster,'staffs.email'));
// dd($emailcc);
Mail::to($mailTo)->cc($emailcc)->send(new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc));
// return new BodRejectProject($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc);
// email end
// if(data_get($request,'page') == 1){ // if(data_get($request,'page') == 1){
return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff project has been rejected'); return redirect()->route('timesheet::dashboard.index')->withSuccess('Staff project has been rejected');
// } // }
...@@ -1449,7 +1708,8 @@ class DashboardController extends Controller ...@@ -1449,7 +1708,8 @@ class DashboardController extends Controller
public function timesheetViewer(Request $request) public function timesheetViewer(Request $request)
{ {
// dd($request->month); // dd($request);
$curruser = $user = Staff_info::where('fk_users', Auth::id()) $curruser = $user = Staff_info::where('fk_users', Auth::id())
->first(); ->first();
...@@ -1592,13 +1852,44 @@ class DashboardController extends Controller ...@@ -1592,13 +1852,44 @@ class DashboardController extends Controller
{ {
$roleid = auth()->user()->roles['0']->id; $roleid = auth()->user()->roles['0']->id;
// dd(data_get($user,'penyokongpm.staff_id')); $userinfo = Staff_info::where('fk_users', auth::id())->first();
// $request->year = 2023;
// $request->month = 2;
// $request->phase = 1;
$lastday = cal_days_in_month(CAL_GREGORIAN, $request->month, $request->year);
$tm_date = date($request->year.'-'.$request->month.'-01');
if ($request->phase == 1) {
$tm_date = date($request->year.'-'.$request->month.'-15');
} else {
$tm_date = date($request->year.'-'.$request->month.'-'.$lastday);
}
$date = date($request->year.'-'.$request->month.'-'.$lastday);
$submissiondate = date("Y-n-j");
$checkdatetmdate = strtotime($tm_date);
$checkdatesubmit = strtotime($submissiondate);
if ($checkdatesubmit > $checkdatetmdate) {
} else {
return redirect()->route('timesheet::form.filterChargeable')->withWarning('You have not pass the submission day yet. Please check your month and phase before you submit');
}
if ($userinfo->fk_lkp_department == 7) {
$attachmentexist = NotesAttachement::where('fk_timesheet_master', $request->tid)->first();
if (is_null($attachmentexist)) {
return redirect()->route('timesheet::form.notelist', ['year' => $request->year, 'month'=> $request->month, 'phase'=> $request->phase, 'fk_tm_id'=> $request->tid ])->withSuccess('Kindly upload your weekly planning before submit your timesheet. Thank you.');
}
}
$checknotes = Ts_detail::where('fk_tm_id', $request->tid) $checknotes = Ts_detail::where('fk_tm_id', $request->tid)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
->where('td_project_type', 3) ->where('td_project_type', 3)
->get(); ->get();
// dd($checknotes);
foreach ($checknotes as $key => $value) { foreach ($checknotes as $key => $value) {
if($value->td_overhead_note == null) if($value->td_overhead_note == null)
...@@ -1616,7 +1907,6 @@ class DashboardController extends Controller ...@@ -1616,7 +1907,6 @@ class DashboardController extends Controller
$month = data_get($tm,'tm_month'); $month = data_get($tm,'tm_month');
$year = data_get($tm,'tm_year'); $year = data_get($tm,'tm_year');
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year); $daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
$myDate = $month.'/'.'1'.'/'.$year; $myDate = $month.'/'.'1'.'/'.$year;
...@@ -1692,7 +1982,7 @@ class DashboardController extends Controller ...@@ -1692,7 +1982,7 @@ class DashboardController extends Controller
$intro = 'The timesheet is not complete. Please refer to the date and hours required.<br>'; $intro = 'The timesheet is not complete. Please refer to the date and hours required.<br>';
$text = ''; $text = '';
foreach ($kurang as $key => $value) { foreach ($kurang as $key => $value) {
// dd($value);
$text = $text.'<br>'.strval(data_get($value,'tarikh')).' : not enough '.strval(data_get($value,'hourskurang')).' hours'; $text = $text.'<br>'.strval(data_get($value,'tarikh')).' : not enough '.strval(data_get($value,'hourskurang')).' hours';
} }
$fulltext = $intro.$text; $fulltext = $intro.$text;
...@@ -1755,8 +2045,33 @@ class DashboardController extends Controller ...@@ -1755,8 +2045,33 @@ class DashboardController extends Controller
} }
} // overwrite status project - case -> en fairuz takda
// $checkoverwrite = Tproject::where('tp_project_type', 1)
// ->where('fk_tm_id',$request->tid)
// ->first();
// if($checkoverwrite)
// {
// Ts_master::where('id', $request->tid)
// ->update([
// 'tm_timesheet_master_sts' => 3,
// 'tm_verified_at' => today()->toDateString(),
// ]);
// Ts_detail::where('fk_tm_id', $request->tid)
// ->where('td_project_type', 1)
// ->update([ 'td_timesheet_sts' => 3 ]);
// Tproject::where('fk_tm_id', $request->tid)
// ->where('tp_project_type', 1)
// ->update([
// 'tp_timesheet_sts' => 3,
// 'tp_verified_at' => today()->toDateString(),
// 'verifier_remark' => 'verified',
// ]);
// }
}
if( $roleid == '2' ) if( $roleid == '2' )
{ {
$checkhod = Tproject::where('tp_project_type', 1) $checkhod = Tproject::where('tp_project_type', 1)
...@@ -1930,7 +2245,7 @@ class DashboardController extends Controller ...@@ -1930,7 +2245,7 @@ class DashboardController extends Controller
$page = data_get($request,'page'); $page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
// dd($user); // dd($user);
$bod = Users::find(Auth::id()); $bod = Users::find(Auth::id());
...@@ -2014,6 +2329,7 @@ class DashboardController extends Controller ...@@ -2014,6 +2329,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
...@@ -2042,6 +2358,8 @@ class DashboardController extends Controller ...@@ -2042,6 +2358,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
// dd($overheadlist); // dd($overheadlist);
...@@ -2059,11 +2377,13 @@ class DashboardController extends Controller ...@@ -2059,11 +2377,13 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
->orderby('td_date') ->orderby('td_date')
->get(); ->get();
// dd($notes);
} }
else else
{ {
...@@ -2075,7 +2395,7 @@ class DashboardController extends Controller ...@@ -2075,7 +2395,7 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.selectapprovalpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'bod', 'daymonth')); return view('timesheet::dashboard.selectapprovalpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'bod', 'daymonth', 'notes'));
} }
public function selectapprovalpage(Request $request) public function selectapprovalpage(Request $request)
...@@ -2087,7 +2407,7 @@ class DashboardController extends Controller ...@@ -2087,7 +2407,7 @@ class DashboardController extends Controller
$page = data_get($request,'page'); $page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
// dd($user); // dd($user);
$bod = Users::find(Auth::id()); $bod = Users::find(Auth::id());
...@@ -2234,7 +2554,7 @@ class DashboardController extends Controller ...@@ -2234,7 +2554,7 @@ class DashboardController extends Controller
$page = data_get($request,'page'); $page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
// dd($user); // dd($user);
$bod = Users::find(Auth::id()); $bod = Users::find(Auth::id());
...@@ -2384,7 +2704,8 @@ class DashboardController extends Controller ...@@ -2384,7 +2704,8 @@ class DashboardController extends Controller
public function approvalselected(Request $request) public function approvalselected(Request $request)
{ {
$user = Staff_info::where('id', Auth::id())->first(); // dd($request);
$user = Staff_info::where('fk_users', Auth::id())->first();
$pid = []; $pid = [];
foreach ($request->pid as $key => $value) { foreach ($request->pid as $key => $value) {
...@@ -2426,6 +2747,7 @@ class DashboardController extends Controller ...@@ -2426,6 +2747,7 @@ class DashboardController extends Controller
Ts_master::where('id', $tmid) Ts_master::where('id', $tmid)
->update([ ->update([
'tm_timesheet_master_sts' => 4, 'tm_timesheet_master_sts' => 4,
'tm_approved_at' => today()->toDateString() ,
]); ]);
} }
...@@ -2440,7 +2762,8 @@ class DashboardController extends Controller ...@@ -2440,7 +2762,8 @@ class DashboardController extends Controller
} }
} }
if ($request->action == 2) { if ($request->action == 2)
{
$projects = Tproject::whereIn('id',$pid) $projects = Tproject::whereIn('id',$pid)
->update([ ->update([
'tp_timesheet_sts' => 5, 'tp_timesheet_sts' => 5,
...@@ -2461,6 +2784,126 @@ class DashboardController extends Controller ...@@ -2461,6 +2784,126 @@ class DashboardController extends Controller
]); ]);
} }
// email start
$detailmaster = Ts_master::where('id', $request->tmid)
->with('staffs')
->first();
// dd($detailmaster);
// dd(data_get($request,'cid'));
// $profile = Tproject::whereIn('id', $cid)->with('team')->first();
// dd($profile->team->email);
$data_timesheet = [
'year' => data_get($detailmaster,'tm_year'),
'month' => data_get($detailmaster,'tm_month'),
'phase' => data_get($detailmaster,'tm_phase'),
'submissionDate' => data_get($detailmaster,'tm_submission_at'),
];
$data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com',
'remarks' => data_get($request,'remarks'),
'staffname' => data_get($detailmaster,'staffs.fullname'),
];
// dd($pid);
$data_project = [];
if (data_get($request,'pid')) {
$detailprojects = Tproject::whereIn('id', $pid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->where('tp_project_type', 1)
->get();
// dd($detailprojects);
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['ccp'] = data_get($project,'pm.email');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
}
// dd($data_project);
$data_overheads = [];
if (data_get($request,'pid')) {
$detailoverheads = Tproject::whereIn('id', $pid)
->with('team')
->with('hod')
->with('bod')
->where('tp_project_type', 3)
->get();
foreach ($detailoverheads as $key => $overhead) {
$data_overheads[$key]['projectname'] = data_get($overhead,'tp_project_name');
$data_overheads[$key]['projectdirector'] = data_get($overhead,'bod.fullname');
$data_overheads[$key]['hod'] = data_get($overhead,'hod.fullname');
$data_overheads[$key]['cco'] = data_get($overhead,'hod.email');
$data_overheads[$key]['remarks'] = data_get($request,'remarks');
}
}
// dd($data_overheads);
if (env('EMAIL_ENV') == 'local')
{
$mailTo = '143hannan@gmail.com';
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = '143hannan@gmail.com';
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
$mailTo = '3fetimesheet@gmail.com';
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($detailmaster,'staffs.email');
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = $value['ccp'];
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = $value['cco'];
}
}
// dd($emailcc);
Mail::to($mailTo)->cc($emailcc)->send(new BodRejectProject($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc));
// return new BodRejectProject($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc);
// email end
if (count($pid) == 1) if (count($pid) == 1)
{ {
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected');
...@@ -2468,7 +2911,7 @@ class DashboardController extends Controller ...@@ -2468,7 +2911,7 @@ class DashboardController extends Controller
} }
else else
{ {
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project?s has been rejected'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been rejected');
} }
} }
} }
...@@ -2476,7 +2919,7 @@ class DashboardController extends Controller ...@@ -2476,7 +2919,7 @@ class DashboardController extends Controller
public function approveallaction(Request $request) public function approveallaction(Request $request)
{ {
// dd($request); // dd($request);
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
$chargeableproject = Tproject::where('tp_project_type', 1) $chargeableproject = Tproject::where('tp_project_type', 1)
->where('fk_tm_id', $request->tmid) ->where('fk_tm_id', $request->tmid)
...@@ -2586,6 +3029,7 @@ class DashboardController extends Controller ...@@ -2586,6 +3029,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
...@@ -2614,6 +3058,8 @@ class DashboardController extends Controller ...@@ -2614,6 +3058,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
} }
...@@ -2630,6 +3076,7 @@ class DashboardController extends Controller ...@@ -2630,6 +3076,7 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
...@@ -2646,13 +3093,13 @@ class DashboardController extends Controller ...@@ -2646,13 +3093,13 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.approveallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'bod')); return view('timesheet::dashboard.approveallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'bod', 'notes'));
} }
public function approvalall(Request $request) public function approvalall(Request $request)
{ {
// dd($request); // dd($request);
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
if (data_get($request,'action') == 2 && data_get($request,'remarks') == null) { if (data_get($request,'action') == 2 && data_get($request,'remarks') == null) {
// dd('sini'); // dd('sini');
...@@ -2730,6 +3177,7 @@ class DashboardController extends Controller ...@@ -2730,6 +3177,7 @@ class DashboardController extends Controller
Ts_master::where('id', data_get($request,'tmid')) Ts_master::where('id', data_get($request,'tmid'))
->update([ ->update([
'tm_timesheet_master_sts' => 4, 'tm_timesheet_master_sts' => 4,
'tm_approved_at' => today()->toDateString(),
]); ]);
} }
return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been approved successfully'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been approved successfully');
...@@ -2784,6 +3232,124 @@ class DashboardController extends Controller ...@@ -2784,6 +3232,124 @@ class DashboardController extends Controller
'tm_timesheet_master_sts' => 5, 'tm_timesheet_master_sts' => 5,
]); ]);
} }
// email start
$detailmaster = Ts_master::where('id', $request->tmid)
->with('staffs')
->first();
// dd($request->tmid);
// dd(data_get($request,'cid'));
// $profile = Tproject::whereIn('id', $cid)->with('team')->first();
// dd($profile->team->email);
$data_timesheet = [
'year' => data_get($detailmaster,'tm_year'),
'month' => data_get($detailmaster,'tm_month'),
'phase' => data_get($detailmaster,'tm_phase'),
'submissionDate' => data_get($detailmaster,'tm_submission_at'),
];
$data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com',
'remarks' => data_get($request,'remarks'),
'staffname' => data_get($detailmaster,'staffs.fullname'),
];
$data_project = [];
if (data_get($request,'cid')) {
$detailprojects = Tproject::whereIn('id', $cid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->where('tp_project_type', 1)
->get();
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['ccp'] = data_get($project,'pm.email');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
}
// dd($data_project);
$data_overheads = [];
if (data_get($request,'oid')) {
$detailoverheads = Tproject::whereIn('id', $oid)
->with('team')
->with('hod')
->with('bod')
->where('tp_project_type', 3)
->get();
// dd($detailoverheads);
foreach ($detailoverheads as $key => $overhead) {
$data_overheads[$key]['projectname'] = data_get($overhead,'tp_project_name');
$data_overheads[$key]['projectdirector'] = data_get($overhead,'bod.fullname');
$data_overheads[$key]['hod'] = data_get($overhead,'hod.fullname');
$data_overheads[$key]['cco'] = data_get($overhead,'hod.email');
$data_overheads[$key]['remarks'] = data_get($request,'remarks');
}
}
if (env('EMAIL_ENV') == 'local')
{
$mailTo = '143hannan@gmail.com';
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = '143hannan@gmail.com';
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
$mailTo = '3fetimesheet@gmail.com';
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = '3fetimesheet@gmail.com';
}
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($detailmaster,'staffs.email');
$emailcc = [];
foreach ($data_project as $key => $value) {
$emailcc[] = $value['ccp'];
}
foreach ($data_overheads as $key => $value) {
$emailcc[] = $value['cco'];
}
}
// dd(data_get($detailmaster,'staffs.email'));
Mail::to($mailTo)->cc($emailcc)->send(new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc));
// return new BodRejectProject($data_email, $data_timesheet, $data_project, $data_overheads, $emailcc);
// email end
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected successfully'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected successfully');
} }
} }
...@@ -2807,7 +3373,7 @@ class DashboardController extends Controller ...@@ -2807,7 +3373,7 @@ class DashboardController extends Controller
$page = data_get($request,'page'); $page = data_get($request,'page');
// dd($page); // dd($page);
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
...@@ -2891,7 +3457,7 @@ class DashboardController extends Controller ...@@ -2891,7 +3457,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
// dd('sini ke?'); // dd('sini ke?');
...@@ -2919,6 +3485,8 @@ class DashboardController extends Controller ...@@ -2919,6 +3485,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
// dd($overheadlist); // dd($overheadlist);
...@@ -2936,6 +3504,7 @@ class DashboardController extends Controller ...@@ -2936,6 +3504,7 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
...@@ -2952,12 +3521,15 @@ class DashboardController extends Controller ...@@ -2952,12 +3521,15 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.selectverificationpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'pm', 'daymonth')); // dd($notes);
return view('timesheet::dashboard.selectverificationpage', compact('tm' ,'phase', 'month', 'year', 'staff', 'strMonth', 'profile', 'strdays', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'chargeablelist', 'chargehour', 'totalchargehrs', 'page', 'pm', 'daymonth', 'notes'));
} }
public function verificationselected(Request $request) public function verificationselected(Request $request)
{ {
$user = Staff_info::where('id', Auth::id())->first(); // dd($request);
$user = Staff_info::where('fk_users', Auth::id())->first();
$pid = []; $pid = [];
foreach ($request->pid as $key => $value) { foreach ($request->pid as $key => $value) {
...@@ -2999,6 +3571,7 @@ class DashboardController extends Controller ...@@ -2999,6 +3571,7 @@ class DashboardController extends Controller
Ts_master::where('id', $tmid) Ts_master::where('id', $tmid)
->update([ ->update([
'tm_timesheet_master_sts' => 3, 'tm_timesheet_master_sts' => 3,
'tm_verified_at' => today()->toDateString(),
]); ]);
} }
...@@ -3013,7 +3586,8 @@ class DashboardController extends Controller ...@@ -3013,7 +3586,8 @@ class DashboardController extends Controller
} }
} }
if ($request->action == 2) { if ($request->action == 2)
{
$projects = Tproject::whereIn('id',$pid) $projects = Tproject::whereIn('id',$pid)
->update([ ->update([
'tp_timesheet_sts' => 6, 'tp_timesheet_sts' => 6,
...@@ -3034,6 +3608,85 @@ class DashboardController extends Controller ...@@ -3034,6 +3608,85 @@ class DashboardController extends Controller
]); ]);
} }
// email start
$profile = Tproject::whereIn('id', $pid)->with('team')->first();
// dd($profile->team->email);
if (env('EMAIL_ENV') == 'local')
{
$mailTo = '143hannan@gmail.com';
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
$mailTo = '3fetimesheet@gmail.com';
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($profile,'team.email');
}
$detailmaster = Ts_master::where('id', $request->tmid)->first();
// dd($detailmaster);
$data_timesheet = [
'year' => data_get($detailmaster,'tm_year'),
'month' => data_get($detailmaster,'tm_month'),
'phase' => data_get($detailmaster,'tm_phase'),
'submissionDate' => data_get($detailmaster,'tm_submission_at'),
];
$data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com',
'remarks' => data_get($request,'remarks'),
'staffname' => data_get($profile,'team.fullname'),
];
$detailprojects = Tproject::whereIn('id', $pid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->where('tp_project_type', 1)
->get();
$detailoverheads = Tproject::whereIn('id', $pid)
->with('hod')
->with('project')
->with('bod')
->where('tp_project_type', 3)
->get();
$data_project = [];
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
// dd($data_project);
$data_overheads = [];
foreach ($detailoverheads as $key => $overhead) {
$data_overheads[$key]['projectname'] = data_get($overhead,'tp_project_name');
$data_overheads[$key]['projectdirector'] = data_get($overhead,'bod.fullname');
$data_overheads[$key]['hod'] = data_get($overhead,'hod.fullname');
$data_overheads[$key]['remarks'] = data_get($request,'remarks');
}
// dd($mailTo);
Mail::to($mailTo)->send(new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads));
// return new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads);
// dd($data_project);
// email end
if (count($pid) == 1) if (count($pid) == 1)
{ {
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected');
...@@ -3054,7 +3707,7 @@ class DashboardController extends Controller ...@@ -3054,7 +3707,7 @@ class DashboardController extends Controller
$page = data_get($request,'page'); $page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
// dd($user); // dd($user);
$pm = Users::find(Auth::id()); $pm = Users::find(Auth::id());
...@@ -3201,7 +3854,7 @@ class DashboardController extends Controller ...@@ -3201,7 +3854,7 @@ class DashboardController extends Controller
$page = data_get($request,'page'); $page = data_get($request,'page');
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
// dd($user); // dd($user);
$bod = Users::find(Auth::id()); $bod = Users::find(Auth::id());
...@@ -3351,7 +4004,7 @@ class DashboardController extends Controller ...@@ -3351,7 +4004,7 @@ class DashboardController extends Controller
public function verifyallaction(Request $request) public function verifyallaction(Request $request)
{ {
$user = Staff_info::where('id', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
$chargeableproject = Tproject::where('tp_project_type', 1) $chargeableproject = Tproject::where('tp_project_type', 1)
->where('fk_tm_id', $request->tmid) ->where('fk_tm_id', $request->tmid)
...@@ -3468,6 +4121,7 @@ class DashboardController extends Controller ...@@ -3468,6 +4121,7 @@ class DashboardController extends Controller
$tempOverhead[0] = ""; $tempOverhead[0] = "";
$tempOverheadid[0] = 0; $tempOverheadid[0] = 0;
$overheadid = [];
if(isset($overheadhour[0])) if(isset($overheadhour[0]))
{ {
...@@ -3496,6 +4150,8 @@ class DashboardController extends Controller ...@@ -3496,6 +4150,8 @@ class DashboardController extends Controller
'pid' => $value->fk_o_id, 'pid' => $value->fk_o_id,
'pname' => $value->tp_project_name, 'pname' => $value->tp_project_name,
]; ];
$overheadid[] = $value->fk_o_id;
} }
} }
} }
...@@ -3512,6 +4168,7 @@ class DashboardController extends Controller ...@@ -3512,6 +4168,7 @@ class DashboardController extends Controller
->where('tm_month', $month) ->where('tm_month', $month)
->where('tm_phase', $phase) ->where('tm_phase', $phase)
->where('fk_tm_id', $check->id) ->where('fk_tm_id', $check->id)
->whereIn('fk_o_id', $overheadid)
->where('tm_staff_id', $tm->tm_staff_id) ->where('tm_staff_id', $tm->tm_staff_id)
->where('td_project_type', $overhead) ->where('td_project_type', $overhead)
->whereNotNull('td_hours') ->whereNotNull('td_hours')
...@@ -3528,13 +4185,14 @@ class DashboardController extends Controller ...@@ -3528,13 +4185,14 @@ class DashboardController extends Controller
$check = null; $check = null;
} }
return view('timesheet::dashboard.verifyallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'verifier')); return view('timesheet::dashboard.verifyallaction', compact('tm', 'user', 'staff', 'year', 'month', 'phase', 'strMonth', 'chargeablelist', 'daymonth', 'strdays', 'chargehour', 'totalchargehrs', 'overheadlist', 'overheadhour', 'totaloverheadhrs', 'page', 'chargeableproject', 'overheadproject', 'verifier', 'notes'));
} }
public function verificationall(Request $request) public function verificationall(Request $request)
{ {
// dd($request); // dd($request);
$user = Staff_info::where('id', Auth::id())->first(); // dd(today()->toDateString());
$user = Staff_info::where('fk_users', Auth::id())->first();
if (data_get($request,'action') == 2 && data_get($request,'remarks') == null) { if (data_get($request,'action') == 2 && data_get($request,'remarks') == null) {
// dd('sini'); // dd('sini');
...@@ -3553,6 +4211,8 @@ class DashboardController extends Controller ...@@ -3553,6 +4211,8 @@ class DashboardController extends Controller
} }
} }
// dd($cid);
if (data_get($request,'oid')) { if (data_get($request,'oid')) {
$oid = []; $oid = [];
$opid = []; $opid = [];
...@@ -3604,14 +4264,12 @@ class DashboardController extends Controller ...@@ -3604,14 +4264,12 @@ class DashboardController extends Controller
$allprojects = Tproject::where('fk_tm_id', data_get($request,'tmid')) $allprojects = Tproject::where('fk_tm_id', data_get($request,'tmid'))
->get(); ->get();
// dump(count($verifiedprojects));
// dd(count($allprojects));
if(count($verifiedprojects) == count($allprojects)) if(count($verifiedprojects) == count($allprojects))
{ {
Ts_master::where('id', data_get($request,'tmid')) Ts_master::where('id', data_get($request,'tmid'))
->update([ ->update([
'tm_timesheet_master_sts' => 3, 'tm_timesheet_master_sts' => 3,
'tm_verified_at' => today()->toDateString(),
]); ]);
} }
return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been approved successfully'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The projects has been approved successfully');
...@@ -3666,6 +4324,96 @@ class DashboardController extends Controller ...@@ -3666,6 +4324,96 @@ class DashboardController extends Controller
'tm_timesheet_master_sts' => 6, 'tm_timesheet_master_sts' => 6,
]); ]);
} }
// email start
$detailmaster = Ts_master::where('id', $request->tmid)
->with('staffs')
->first();
// dd(data_get($request,'cid'));
// $profile = Tproject::whereIn('id', $cid)->with('team')->first();
// dd($profile->team->email);
if (env('EMAIL_ENV') == 'local')
{
$mailTo = '143hannan@gmail.com';
}
elseif (env('EMAIL_ENV') == 'DEVELOPMENT')
{
$mailTo = '3fetimesheet@gmail.com';
}
elseif (env('EMAIL_ENV') == 'PRODUCTION')
{
$mailTo = data_get($detailmaster,'staffs.email');
}
$data_timesheet = [
'year' => data_get($detailmaster,'tm_year'),
'month' => data_get($detailmaster,'tm_month'),
'phase' => data_get($detailmaster,'tm_phase'),
'submissionDate' => data_get($detailmaster,'tm_submission_at'),
];
$data_email = [
'subject' => 'Timesheet Project: Timesheet Project has been rejected',
'sender_name' => '3fetimesheet@gmail.com',
'remarks' => data_get($request,'remarks'),
'staffname' => data_get($detailmaster,'staffs.fullname'),
];
$data_project = [];
if (data_get($request,'cid')) {
$detailprojects = Tproject::whereIn('id', $cid)
->with('team')
->with('pm')
->with('project')
->with('bod')
->get();
foreach ($detailprojects as $key => $project) {
$data_project[$key]['pcode'] = data_get($project,'project.p_project_code');
$data_project[$key]['projectname'] = data_get($project,'tp_project_name');
$data_project[$key]['projectdirector'] = data_get($project,'bod.fullname');
$data_project[$key]['projectmanager'] = data_get($project,'pm.fullname');
$data_project[$key]['remarks'] = data_get($request,'remarks');
}
}
$data_overheads = [];
if (data_get($request,'oid')) {
$detailoverheads = Tproject::whereIn('id', $oid)
->with('team')
->with('hod')
->with('project')
->with('bod')
->where('tp_project_type', 3)
->get();
// dd($detailoverheads);
foreach ($detailoverheads as $key => $overhead) {
$data_overheads[$key]['pcode'] = data_get($overhead,'project.p_project_code');
$data_overheads[$key]['projectname'] = data_get($overhead,'tp_project_name');
$data_overheads[$key]['projectdirector'] = data_get($overhead,'bod.fullname');
$data_overheads[$key]['hod'] = data_get($overhead,'hod.fullname');
$data_overheads[$key]['remarks'] = data_get($request,'remarks');
}
}
// dd($data_project);
Mail::to($mailTo)->send(new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads));
// return new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads);
// dd($data_project);
// email end
return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected successfully'); return redirect()->route('timesheet::dashboard.index')->withSuccess('The project has been rejected successfully');
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -57,8 +57,9 @@ class ReportController extends Controller ...@@ -57,8 +57,9 @@ class ReportController extends Controller
$year = Ts_master::select('tm_year') $year = Ts_master::select('tm_year')
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->get(); ->get();
// dd($year);
return view('timesheet::report.ringkasanLaporan', compact('dept', 'month', 'year')); return view('timesheet::report.ringkasanLaporan', compact('dept', 'month', 'year'));
} }
...@@ -72,7 +73,7 @@ class ReportController extends Controller ...@@ -72,7 +73,7 @@ class ReportController extends Controller
$yearlist = Ts_master::select('tm_year') $yearlist = Ts_master::select('tm_year')
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->get(); ->get();
$monthlist = []; $monthlist = [];
...@@ -364,7 +365,7 @@ class ReportController extends Controller ...@@ -364,7 +365,7 @@ class ReportController extends Controller
} }
$year = Ts_master::select('tm_year') $year = Ts_master::select('tm_year')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->get(); ->get();
...@@ -378,7 +379,7 @@ class ReportController extends Controller ...@@ -378,7 +379,7 @@ class ReportController extends Controller
->except([8]); ->except([8]);
$yearlist = Ts_master::select('tm_year') $yearlist = Ts_master::select('tm_year')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->get(); ->get();
...@@ -446,11 +447,11 @@ class ReportController extends Controller ...@@ -446,11 +447,11 @@ class ReportController extends Controller
} }
$year = Ts_master::select('tm_year') $year = Ts_master::select('tm_year')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->get(); ->get();
// dd($year);
return view('timesheet::report.filterOvertime', compact('month', 'year', 'dept')); return view('timesheet::report.filterOvertime', compact('month', 'year', 'dept'));
} }
...@@ -466,7 +467,7 @@ class ReportController extends Controller ...@@ -466,7 +467,7 @@ class ReportController extends Controller
} }
$yearlist = Ts_master::select('tm_year') $yearlist = Ts_master::select('tm_year')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->get(); ->get();
...@@ -501,8 +502,18 @@ class ReportController extends Controller ...@@ -501,8 +502,18 @@ class ReportController extends Controller
public function filterNotSubmit() public function filterNotSubmit()
{ {
$user = Staff_info::where('fk_users', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
$roleid = auth()->user()->roles['0']->id;
// dd($roleid);
if ($roleid == 6) {
$dept = Department::all()->except([8]);
// dd($dept);
}else{
$dept = Department::where('id', data_get($user,'fk_lkp_department'))->get(); $dept = Department::where('id', data_get($user,'fk_lkp_department'))->get();
}
// $dept = Department::where('id', data_get($user,'fk_lkp_department'))->get();
// dd($dept); // dd($dept);
// $dept = Department::all() // $dept = Department::all()
// ->except([8]); // ->except([8]);
...@@ -514,7 +525,7 @@ class ReportController extends Controller ...@@ -514,7 +525,7 @@ class ReportController extends Controller
} }
$year = Ts_master::select('tm_year') $year = Ts_master::select('tm_year')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->get(); ->get();
...@@ -527,7 +538,15 @@ class ReportController extends Controller ...@@ -527,7 +538,15 @@ class ReportController extends Controller
$keyword = data_get($request,'keyword'); $keyword = data_get($request,'keyword');
$user = Staff_info::where('fk_users', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
$roleid = auth()->user()->roles['0']->id;
// dd($roleid);
if ($roleid == 6) {
$dept = Department::all()->except([8]);
// dd($dept);
}else{
$dept = Department::where('id', data_get($user,'fk_lkp_department'))->get(); $dept = Department::where('id', data_get($user,'fk_lkp_department'))->get();
}
// $dept = Department::all() // $dept = Department::all()
// ->except([8]); // ->except([8]);
...@@ -539,7 +558,7 @@ class ReportController extends Controller ...@@ -539,7 +558,7 @@ class ReportController extends Controller
} }
$year = Ts_master::select('tm_year') $year = Ts_master::select('tm_year')
->where('tm_timesheet_master_sts', 4) // ->where('tm_timesheet_master_sts', 4)
->distinct('tm_year') ->distinct('tm_year')
->orderby('tm_year','DESC') ->orderby('tm_year','DESC')
->get(); ->get();
......
<?php
namespace Portal\Timesheet\Http\Controllers;
use Illuminate\Routing\Controller;
use Carbon\Carbon;
use DB;
use Portal\Timesheet\Model\Users;
use Portal\Timesheet\Model\Ts_master;
use Portal\Timesheet\Model\Ts_detail;
use Portal\Timesheet\Model\Project;
use Portal\Timesheet\Model\Department;
use Portal\Timesheet\Model\Pteam;
use Portal\Timesheet\Model\Staff_info;
use Portal\Timesheet\Model\Overhead;
use Portal\Timesheet\Model\Role;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use File;
use Redirect;
use App\Mail\StatusAccept;
use App\Mail\StatusReject;
use Mail;
use Curl;
use Auth;
use App\User as AppUsers;
use Portal\Timesheet\Model\Urole as Aclrole;
use Portal\Timesheet\Model\Staff_info as StaffInfo;
use Illuminate\Support\Facades\Artisan;
class UsersController extends Controller
{
public function senaraiUsers()
{
$users = Users::all();
return view('timesheet::users.list', compact('users'));
}
public function syncNewUsers()
{
// Run command manual
// $output = shell_exec('php /www/html/timesheet3f/artisan migrate:user-cron 2>&1');
// // Log the output for debugging
// \Log::info("migrate:user-cron output: " . $output);
$migrateuser = DB::connection('mysql')->table('migrate_user')->where('id',1)->first();
// dump($migrateuser);
$user = DB::connection('mysql2')
->table('users')
->join('staff_info','staff_info.fk_users','=','users.id')
->where('users.id','>',$migrateuser->userid)
->select('users.id','users.email','users.fullname','users.staff_id','staff_info.fk_lkp_country','staff_info.fk_lkp_state','staff_info.ic_no','staff_info.email')
->get();
// dd($user);
if($user){
foreach ($user as $key => $value){
$new = new AppUsers;
$new->name = strtoupper($value->fullname);
$new->email = $value->email;
$new->status = 'ACTIVE';
$new->timezone = 'UTC';
$new->meta = NULL;
$new->email_verified_at = NULL;
$new->password = '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm'; //secret
$new->password_last_set = NULL;
$new->u_staffID = $value->staff_id;
$new->save();
$role = new Aclrole;
$role->user_id = $new->id;
$role->role_id = 5;
$role->save();
$saveinfo = new StaffInfo;
$saveinfo->fk_lkp_country = $value->fk_lkp_country;
$saveinfo->fk_lkp_state = $value->fk_lkp_state;
$saveinfo->fk_users = $new->id;
$saveinfo->ic_no = $value->ic_no;
$saveinfo->email = $value->email;
$saveinfo->staff_id = $value->staff_id;
$saveinfo->fullname = strtoupper($value->fullname);
$saveinfo->status = 1;
$saveinfo->save();
//update migrate user
$updmigrate = DB::connection('mysql')->table('migrate_user')->where('id',1)
->update(['userid' => $value->id]);
// $updmigrate->userid = $value->id;
// $updmigrate->save();
}//endforeach
} //end if user
return redirect('users/list')->withSuccess('Senarai staff telah dikemaskini');
}
}
...@@ -33,7 +33,10 @@ class VwChargeableVerification extends Model ...@@ -33,7 +33,10 @@ class VwChargeableVerification extends Model
return $this->hasMany('Portal\Timesheet\Model\Tproject','fk_tm_id','tmid')->where('tp_project_type', 3); return $this->hasMany('Portal\Timesheet\Model\Tproject','fk_tm_id','tmid')->where('tp_project_type', 3);
} }
public function sname()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','staff_id');
}
// public function department() // public function department()
// { // {
......
<?php
namespace Portal\Timesheet\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class VwPelulus extends Model
{
use Notifiable;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'vw_pelulus';
public function details()
{
return $this->hasOne('Portal\Timesheet\Model\Users','id','pelulus');
}
// public function penyokong()
// {
// return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','penyokong');
// }
/**
* undocumented function
*
* @return void
* @author
**/
public function info()
{
}
}
<?php
namespace Portal\Timesheet\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class VwPenyokong extends Model
{
use Notifiable;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'vw_penyokong';
public function details()
{
return $this->hasOne('Portal\Timesheet\Model\Users','id','penyokong');
}
/**
* undocumented function
*
* @return void
* @author
**/
public function info()
{
}
}
...@@ -16,6 +16,11 @@ class VwStaff extends Model ...@@ -16,6 +16,11 @@ class VwStaff extends Model
*/ */
protected $table = 'vw_staff'; protected $table = 'vw_staff';
public function penyokong()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','id','penyokong');
}
/** /**
* undocumented function * undocumented function
* *
......
<?php
namespace Portal\Timesheet\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Portal\Timesheet\Model\Ts_master;
class VwTpStatus extends Model
{
use Notifiable;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'vw_tp_status';
public function staffdetails()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','staffid');
}
public function penyokongproject()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','tp_pm');
}
public function penyokongoverhead()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','fk_users','tp_pm');
}
public function pelulus()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','fk_users','tp_pd');
}
public function tm()
{
return $this->hasOne(Ts_master::class, 'id', 'fk_tm_id');
}
/**
* undocumented function
*
* @return void
* @author
**/
public function info()
{
}
}
...@@ -34,4 +34,9 @@ class Ts_master extends Model ...@@ -34,4 +34,9 @@ class Ts_master extends Model
return $this->belongsTo('Portal\Timesheet\Model\Staff_info','staff_id','tm_staff_id'); return $this->belongsTo('Portal\Timesheet\Model\Staff_info','staff_id','tm_staff_id');
} }
public function staffs()
{
return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','tm_staff_id');
}
} }
...@@ -181,6 +181,13 @@ class ServiceProvider extends BaseServiceProvider ...@@ -181,6 +181,13 @@ class ServiceProvider extends BaseServiceProvider
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
// dd(auth());
$pengurusanSistem = $this->app['laravolt.menu']->add(__('System Management'))->data('icon', 'align justify');
$pengurusanSistem->add(__('List of Users'), route('timesheet::users.senaraiUsers'))
->data('icon', 'users icon')
->active('usermanagement/*')
->data('permission', Permission::usermanagement);
// $calendar->add(__('Chargeable'), route('timesheet::dashboard.kalendarCharge')) // $calendar->add(__('Chargeable'), route('timesheet::dashboard.kalendarCharge'))
// ->data('icon', 'calendar alternate outline') // ->data('icon', 'calendar alternate outline')
// ->active('kalendarCharge/*') // ->active('kalendarCharge/*')
......
{
"emptyTable": "Tiada data",
"info": "Paparan dari _START_ hingga _END_ dari _TOTAL_ rekod",
"infoEmpty": "Paparan 0 hingga 0 dari 0 rekod",
"infoFiltered": "(Ditapis dari jumlah _MAX_ rekod)",
"infoThousands": ",",
"lengthMenu": "Papar _MENU_ rekod",
"loadingRecords": "Diproses...",
"processing": "Sedang diproses...",
"search": "Carian:",
"zeroRecords": "Tiada padanan rekod yang dijumpai.",
"paginate": {
"first": "Pertama",
"previous": "Sebelum",
"next": "Seterusnya",
"last": "Akhir"
},
"aria": {
"sortAscending": ": diaktifkan kepada susunan lajur menaik",
"sortDescending": ": diaktifkan kepada susunan lajur menurun"
},
"autoFill": {
"cancel": "batal",
"fill": "Isi semua sel dengan <i>%d<\/i>",
"fillHorizontal": "Isi sel secara mendatar",
"fillVertical": "Isi sel secara menegak"
},
"buttons": {
"collection": "Koleksi <span class=\"ui-button-icon-primary ui-icon ui-icon-triangle-1-s\"><\/span>",
"copy": "Salin",
"print": "Cetak",
"colvis": "Kolum Pilihan"
},
"thousands": ",",
"_comment":{
"select": {
"cells": {
"1": "1 sel terpilih",
"_": "%d sel terpilih"
},
"columns": {
"1": "1 kolum terpilih",
"_": "%d kolum terpilih"
},
"rows": {
"1": "1 baris terpilih",
"_": "%d baris terpilih"
}
}
},
"editor": {
"close": "Tutup"
}
}
...@@ -30,7 +30,7 @@ Project details : <br> ...@@ -30,7 +30,7 @@ Project details : <br>
</table> </table>
<br> <br>
New project @if(count($data_staffs) > 1)members @else member @endif : <br> Project @if(count($data_staffs) > 1)members @else member @endif : <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project"> <table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
<thead> <thead>
<tr> <tr>
......
...@@ -17,6 +17,8 @@ The previous project details : <br> ...@@ -17,6 +17,8 @@ The previous project details : <br>
<th style="border: black 1px solid;">Project Manager</th> <th style="border: black 1px solid;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th> <th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid; width: 10%;">Status</th> <th style="border: black 1px solid; width: 10%;">Status</th>
<th style="border: black 1px solid; width: 10%;">Start Date</th>
<th style="border: black 1px solid; width: 10%;">End Date</th>
<th style="border: black 1px solid;">Updated by</th> <th style="border: black 1px solid;">Updated by</th>
</tr> </tr>
</thead> </thead>
...@@ -27,6 +29,8 @@ The previous project details : <br> ...@@ -27,6 +29,8 @@ The previous project details : <br>
<td style="border: black 1px solid;"> {!! ucwords(strtolower($old_data['projectmanager'])) !!} </td> <td style="border: black 1px solid;"> {!! ucwords(strtolower($old_data['projectmanager'])) !!} </td>
<td style="border: black 1px solid;"> {!! ucwords(strtolower($old_data['projectdirector'])) !!} </td> <td style="border: black 1px solid;"> {!! ucwords(strtolower($old_data['projectdirector'])) !!} </td>
<td style="border: black 1px solid; width: 10%;"> @if( $old_data['status'] == 1) Active @else Inactive @endif </td> <td style="border: black 1px solid; width: 10%;"> @if( $old_data['status'] == 1) Active @else Inactive @endif </td>
<td style="border: black 1px solid;"> {!! date('j M Y', strtotime($old_data['startdate'])) !!} </td>
<td style="border: black 1px solid;"> {!! date('j M Y', strtotime($old_data['enddate'])) !!} </td>
<td style="border: black 1px solid;"> {!! ucwords(strtolower($old_data['editor'])) !!} </td> <td style="border: black 1px solid;"> {!! ucwords(strtolower($old_data['editor'])) !!} </td>
</tr> </tr>
</tbody> </tbody>
...@@ -42,6 +46,8 @@ The new project details : <br> ...@@ -42,6 +46,8 @@ The new project details : <br>
<th style="border: black 1px solid;">Project Manager</th> <th style="border: black 1px solid;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th> <th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid; width: 10%;">Status</th> <th style="border: black 1px solid; width: 10%;">Status</th>
<th style="border: black 1px solid; width: 10%;">Start Date</th>
<th style="border: black 1px solid; width: 10%;">End Date</th>
<th style="border: black 1px solid;">Updated by</th> <th style="border: black 1px solid;">Updated by</th>
</tr> </tr>
</thead> </thead>
...@@ -52,6 +58,8 @@ The new project details : <br> ...@@ -52,6 +58,8 @@ The new project details : <br>
<td style="border: black 1px solid;"> {!! ucwords(strtolower($data_email['projectmanager'])) !!} </td> <td style="border: black 1px solid;"> {!! ucwords(strtolower($data_email['projectmanager'])) !!} </td>
<td style="border: black 1px solid;"> {!! ucwords(strtolower($data_email['projectdirector'])) !!} </td> <td style="border: black 1px solid;"> {!! ucwords(strtolower($data_email['projectdirector'])) !!} </td>
<td style="border: black 1px solid; width: 10%;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td> <td style="border: black 1px solid; width: 10%;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
<td style="border: black 1px solid;"> {!! date('j M Y', strtotime($data_email['startdate'])) !!} </td>
<td style="border: black 1px solid;"> {!! date('j M Y', strtotime($data_email['enddate'])) !!} </td>
<td style="border: black 1px solid;"> {!! ucwords(strtolower($data_email['editor'])) !!} </td> <td style="border: black 1px solid;"> {!! ucwords(strtolower($data_email['editor'])) !!} </td>
</tr> </tr>
</tbody> </tbody>
......
@component('mail::message')
# Timesheet Approval
Assalamualaikum w.b.t Mr/Mrs.
{!! ucwords(strtolower($data_email['name'])) !!},
We greatly appreciate your help to approve several timesheets as stated below.
@if(count($projectstafflist)>0)
Timesheet approval :
<br>
@foreach($projectstafflist as $key => $staff)
- {{ ucwords(strtolower(data_get($staff,'staffdetails.fullname'))) }}.
<br>
@endforeach
@endif
Your cooperation is highly appreciated.
Thank you.
@component('mail::button', ['url' => 'https://timesheet.3fresources.com/home'])
Etimesheet
@endcomponent
---
<br>
<i>This is an auto generated message, please do not reply.</i>
@endcomponent
@component('mail::message')
@if(count($data_overheads) > 0 && count($data_project) == 0)
# Your overhead has been rejected!
@elseif(count($data_overheads) == 0 && count($data_project) > 0)
# Your project has been rejected!
@else
# Your projects & overhead has been rejected!
@endif
Assalamualaikum w.b.t Dato' /Datin /En /Pn / Cik
{!! ucwords(strtolower($data_email['staffname'])) !!}
We would like to inform you as your
@if(count($data_overheads) > 0 && count($data_project) == 0)
overhead has been rejected.
@elseif(count($data_overheads) == 0 && count($data_project) > 0)
timesheet @if(count($data_project) == 1) project has @else projects have @endif been rejected.
@else
projects & overhead has been rejected.
@endif
The details of timesheet submission is as below: <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Phase</th>
<th style="border: black 1px solid;">Month</th>
<th style="border: black 1px solid;">Year</th>
<th style="border: black 1px solid;">Submission Date</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;">@if($data_timesheet['phase'] == 1) 1st Halfmonth @else 2nd Halfmonth @endif</td>
<td style="border: black 1px solid;">{!! date("F", mktime(0, 0, 0, $data_timesheet['month'], 10)) !!}</td>
<td style="border: black 1px solid;">{!! ucwords(strtolower($data_timesheet['year'])) !!}</td>
<td style="border: black 1px solid;">{!! date("d F Y", strtotime($data_timesheet['submissionDate'])) !!}</td>
</tr>
</tbody>
</table>
<br>
@if(count($data_project) > 0)
The details of the project rejection is as below: <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Project Code</th>
<th style="border: black 1px solid;">Project Name</th>
<th style="border: black 1px solid;">Rejected By</th>
<th style="border: black 1px solid;">Remarks</th>
</tr>
</thead>
<tbody>
@foreach($data_project as $key => $project)
<tr>
<td style="border: black 1px solid;">{!! $project['pcode'] !!} </td>
<td style="border: black 1px solid;">{!! $project['projectname'] !!}</td>
@if($key==0)
<td style="border: black 1px solid;" rowspan="{{count($data_project)}}">{!! ucwords(strtolower($project['projectdirector'])) !!}</td>
<td style="border: black 1px solid;" rowspan="{{count($data_project)}}">{!! ucwords(strtolower($project['remarks'])) !!}</td>
@endif
</tr>
@endforeach
</tbody>
</table>
<br>
@endif
@if(count($data_overheads) > 0)
The details of the rejected overhead is as below: <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Overhead</th>
<th style="border: black 1px solid;">Rejected By</th>
<th style="border: black 1px solid;">Remarks</th>
</tr>
</thead>
<tbody>
@foreach($data_overheads as $key => $overhead)
<tr>
<td style="border: black 1px solid;">{!! $overhead['projectname'] !!}</td>
@if($key==0)
<td style="border: black 1px solid;" rowspan="{{count($data_overheads)}}">{!! ucwords(strtolower($overhead['projectdirector'])) !!}</td>
<td style="border: black 1px solid;" rowspan="{{count($data_overheads)}}">{!! ucwords(strtolower($overhead['remarks'])) !!}</td>
@endif
</tr>
@endforeach
</tbody>
</table>
<br>
@endif
Thank you. <br>
<!-- <br> -->
---
<br>
<i>This is an auto generated message, please do not reply.</i>
<!-- Thanks,<br> -->
<!-- {{ config('app.name') }} -->
@endcomponent
\ No newline at end of file
@component('mail::message') @component('mail::message')
@if(count($data_overheads) > 0 && count($data_project) == 0)
# Your overhead has been rejected!
@elseif(count($data_overheads) == 0 && count($data_project) > 0)
# Your project has been rejected! # Your project has been rejected!
@else
# Your projects & overhead has been rejected!
@endif
Assalamualaikum w.b.t Dato' /Datin /En /Pn / Cik Assalamualaikum w.b.t Dato' /Datin /En /Pn / Cik
{!! ucwords(strtolower($data_email['staffname'])) !!} {!! ucwords(strtolower($data_email['staffname'])) !!}
We would like to inform you as one of your timesheet project namely, {!! $data_email['projectname'] !!}, has been rejected. We would like to inform you as your
@if(count($data_overheads) > 0 && count($data_project) == 0)
overhead has been rejected.
@elseif(count($data_overheads) == 0 && count($data_project) > 0)
timesheet @if(count($data_project) == 1) project has @else projects have @endif been rejected.
@else
projects & overhead has been rejected.
@endif
The details of timesheet submission is as below: <br> The details of timesheet submission is as below: <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project"> <table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
...@@ -27,6 +44,9 @@ The details of timesheet submission is as below: <br> ...@@ -27,6 +44,9 @@ The details of timesheet submission is as below: <br>
</tbody> </tbody>
</table> </table>
<br> <br>
@if(count($data_project) > 0)
The details of the project rejection is as below: <br> The details of the project rejection is as below: <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project"> <table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
<thead> <thead>
...@@ -38,17 +58,49 @@ The details of the project rejection is as below: <br> ...@@ -38,17 +58,49 @@ The details of the project rejection is as below: <br>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($data_project as $key => $project)
<tr> <tr>
<td style="border: black 1px solid;">{!! $data_email['pcode'] !!} </td> <td style="border: black 1px solid;">{!! $project['pcode'] !!} </td>
<td style="border: black 1px solid;">{!! ucwords(strtolower($data_email['projectname'])) !!}</td> <td style="border: black 1px solid;">{!! $project['projectname'] !!}</td>
<td style="border: black 1px solid;">{!! ucwords(strtolower($data_email['projectmanager'])) !!}</td> @if($key==0)
<td style="border: black 1px solid;">{!! ucwords(strtolower($data_email['remarks'])) !!}</td> <td style="border: black 1px solid;" rowspan="{{count($data_project)}}">{!! ucwords(strtolower($project['projectmanager'])) !!}</td>
<td style="border: black 1px solid;" rowspan="{{count($data_project)}}">{!! ucwords(strtolower($project['remarks'])) !!}</td>
@endif
</tr> </tr>
@endforeach
</tbody> </tbody>
</table> </table>
<br> <br>
Thank you. <br> @endif
@if(count($data_overheads) > 0)
The details of the rejected overhead is as below: <br>
<table style="border: black 1px solid; font-size: 16px; text-align: center; width: 150%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Overhead</th>
<th style="border: black 1px solid;">Rejected By</th>
<th style="border: black 1px solid;">Remarks</th>
</tr>
</thead>
<tbody>
@foreach($data_overheads as $key => $overhead)
<tr>
<td style="border: black 1px solid;">{!! $overhead['projectname'] !!}</td>
@if($key==0)
<td style="border: black 1px solid;" rowspan="{{count($data_overheads)}}">{!! ucwords(strtolower($overhead['hod'])) !!}</td>
<td style="border: black 1px solid;" rowspan="{{count($data_overheads)}}">{!! ucwords(strtolower($overhead['remarks'])) !!}</td>
@endif
</tr>
@endforeach
</tbody>
</table>
<br>
@endif
Thank you. <br>
<!-- <br> --> <!-- <br> -->
--- ---
<br> <br>
......
@component('mail::message')
# Reminder for Timesheet Submission!
Assalamualaikum w.b.t Mr/Mrs.
{!! ucwords(strtolower($data_email['name'])) !!},
We would like to inform you as of today, {!! date('j F Y', strtotime($data_email['today'])) !!} , we have not receive your timesheet for @if($data_email['phase'] == 1) 1st Halfmonth @else 2nd Halfmonth @endif {!! date('F', mktime(0, 0, 0, $data_email['month'], 10)).' '.$data_email['year'] !!}.
Kindly submit your timesheet as soon as possible.
Thank you. <br>
<!-- <br> -->
---
<br>
<i>This is an auto generated message, please do not reply.</i>
<!-- Thanks,<br> -->
<!-- {{ config('app.name') }} -->
@endcomponent
\ No newline at end of file
@component('mail::message')
# Timesheet Verification
Assalamualaikum w.b.t Mr/Mrs.
{!! ucwords(strtolower($data_email['name'])) !!},
We greatly appreciate your help to verify several timesheet as stated below.
@if(count($projectstafflist)>0)
Project verification :
<br>
@foreach($projectstafflist as $key => $staff)
- {{ ucwords(strtolower(data_get($staff,'staffdetails.fullname'))) }}.
<br>
@endforeach
@endif
@if(count($overheadstafflist)>0)
Overhead verification :
<br>
@foreach($overheadstafflist as $key => $staff)
- {{ ucwords(strtolower(data_get($staff,'staffdetails.fullname'))) }}.
<br>
@endforeach
@endif
Your cooperation is highly appreciated.
Thank you.
@component('mail::button', ['url' => 'https://timesheet.3fresources.com/home'])
Etimesheet
@endcomponent
---
<br>
<i>This is an auto generated message, please do not reply.</i>
@endcomponent
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<i class="mail icon"></i> <i class="mail icon"></i>
</div> </div>
<div class="ui field left icon input fluid"> <div class="ui field left icon input fluid">
<input type="password" name="password" placeholder="Password"> <!-- <input type="password" name="password" placeholder="Password"> -->
<!-- <input type="password" name="password" placeholder="@lang('auth::auth.password')"> --> <input type="password" name="password" placeholder="@lang('auth::auth.password')">
<i class="lock icon"></i> <i class="lock icon"></i>
</div> </div>
@if(config('laravolt.auth.captcha')) @if(config('laravolt.auth.captcha'))
...@@ -26,19 +26,19 @@ ...@@ -26,19 +26,19 @@
</div> </div>
@endif @endif
<div class="ui field"> <div class="ui field">
<button type="submit" class="ui fluid button primary">Login</button> <!-- <button type="submit" class="ui fluid button primary">Login</button> -->
<!-- <button type="submit" class="ui fluid button primary">@lang('auth::auth.login')</button> --> <button type="submit" class="ui fluid button primary">@lang('auth::auth.login')</button>
</div> </div>
<div class="ui equal width grid field"> <div class="ui equal width grid field">
<div class="column left aligned"> <div class="column left aligned">
<div class="ui checkbox"> <div class="ui checkbox">
<input type="checkbox" name="remember" {{ request()->old('remember')?'checked':'' }}> <input type="checkbox" name="remember" {{ request()->old('remember')?'checked':'' }}>
<label>Remember me</label> <!-- <label>Remember me</label> -->
<!-- <label>@lang('auth::auth.remember')</label> --> <label>@lang('auth::auth.remember')</label>
</div> </div>
</div> </div>
<div class="column right aligned"> <div class="column right aligned">
<a href="{{route('auth::forgot')}}">Forgot password</a> <a href="{{route('auth::forgot')}}">@lang('auth::auth.forgot_password')</a>
</div> </div>
</div> </div>
......
...@@ -62,13 +62,13 @@ ...@@ -62,13 +62,13 @@
} }
.langdisp .langdisp
{ {
background-color: unset !important; background-color: unset !important;
border-radius: unset !important; border-radius: unset !important;
margin: unset !important; margin: unset !important;
padding: unset !important; padding: unset !important;
} }
} }
</style> </style>
...@@ -77,6 +77,11 @@ ...@@ -77,6 +77,11 @@
<script type="text/javascript" src="{{ asset('js/jquery-3.1.1.min.js') }}"></script> <script type="text/javascript" src="{{ asset('js/jquery-3.1.1.min.js') }}"></script>
<script type="text/javascript" src="{{ mix('js/all.js', 'laravolt') }}"></script> <script type="text/javascript" src="{{ mix('js/all.js', 'laravolt') }}"></script>
<!-- ✅ Load DataTables (AFTER all.js) -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="{{ asset('calendar/lib/main.js') }}"></script> <script type="text/javascript" src="{{ asset('calendar/lib/main.js') }}"></script>
<script type="text/javascript" src="{{ asset('calendar/lib/locales-all.js') }}"></script> <script type="text/javascript" src="{{ asset('calendar/lib/locales-all.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment