Commit eefd2d43 by Azhan Hannan

email function

parent ad6d9497
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class AddProjectTeam extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $data_staffs;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $data_staffs)
{
$this->data_email = $data_email;
$this->data_staffs = $data_staffs;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('emails.AddProjectTeam');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class EditMandays extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $data_mandays;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $data_mandays)
{
$this->data_email = $data_email;
$this->data_mandays = $data_mandays;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.EditMandays');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class EditProject 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('emails.EditProject');
}
}
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class EditProjectTeam extends Mailable
{
use Queueable, SerializesModels;
public $data_email;
public $old_data;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data_email, $old_data)
{
$this->data_email = $data_email;
$this->old_data = $old_data;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject($this->data_email['subject'])
->from($this->data_email['sender_name'])
->markdown('mail.content.EditProjectTeam');
}
}
...@@ -21,10 +21,15 @@ use Portal\Timesheet\Model\Pmandays; ...@@ -21,10 +21,15 @@ use Portal\Timesheet\Model\Pmandays;
use Portal\Timesheet\Model\VwMandays; use Portal\Timesheet\Model\VwMandays;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Input;
// use Illuminate\Support\Facades\Mail;
use File; use File;
use Redirect; use Redirect;
use App\Mail\StatusAccept; use App\Mail\StatusAccept;
use App\Mail\StatusReject; use App\Mail\StatusReject;
use App\Mail\EditProject;
use App\Mail\AddProjectTeam;
use App\Mail\EditProjectTeam;
use App\Mail\EditMandays;
use Mail; use Mail;
use Curl; use Curl;
use Auth; use Auth;
...@@ -237,20 +242,18 @@ class MaintenanceController extends Controller ...@@ -237,20 +242,18 @@ class MaintenanceController extends Controller
public function editproject(Request $request) public function editproject(Request $request)
{ {
// dump(DateTime()); // dd($request);
// dd(now()->toDateTimeString());
$user = Staff_info::where('fk_users', Auth::id())->first(); $user = Staff_info::where('fk_users', Auth::id())->first();
// dd(data_get($user,'email'));
$project = Project::where('id', $request->pid)->first(); $project = Project::where('id', $request->pid)->first();
// dd($project);
$project->id = $request->pid; $project->id = $request->pid;
$project->p_project_task_team = $request->projectmanager; $project->p_project_task_team = $request->projectmanager;
$project->p_project_sts = $request->status; $project->p_project_sts = $request->status;
$project->updated_by = data_get($user,'email'); $project->updated_by = data_get($user,'email');
$project->save(); $project->save();
$sname = Staff_info::select('fullname') $sname = Staff_info::select('fullname')
->where('staff_id', $request->projectmanager) ->where('staff_id', $request->projectmanager)
->first(); ->first();
...@@ -260,10 +263,6 @@ class MaintenanceController extends Controller ...@@ -260,10 +263,6 @@ class MaintenanceController extends Controller
'tp_pm'=> data_get($request,'projectmanager'), 'tp_pm'=> data_get($request,'projectmanager'),
]); ]);
// $timesheetproject = Tproject::where('td_project', data_get($request,'pid'))
// ->get();
// dd($timesheetproject);
$pteam = Pteam::where('fk_project_id', $request->pid) $pteam = Pteam::where('fk_project_id', $request->pid)
->where('role_id', 1) ->where('role_id', 1)
->first(); ->first();
...@@ -272,6 +271,42 @@ class MaintenanceController extends Controller ...@@ -272,6 +271,42 @@ class MaintenanceController extends Controller
$pteam->pt_team = $sname->fullname; $pteam->pt_team = $sname->fullname;
$pteam->save(); $pteam->save();
// email start
$project = Project::where('id', $request->pid)
->with('projectManager')
->with('projectDirector')
->first();
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($project,'projectDirector.email');
}
$data_email = [
'subject' => 'Timesheet Project: Changes in Project details',
'sender_name' => '3fetimesheet@gmail.com',
'pcode' => data_get($project,'p_project_code'),
'projectmanager' => data_get($project,'projectManager.fullname'),
'projectdirector' => data_get($project,'projectDirector.fullname'),
'projectname' => data_get($project,'p_project_description'),
'username' => data_get($user,'fullname'),
'status' => data_get($project,'p_project_sts'),
];
Mail::to($mailTo)->send(new EditProject($data_email));
// return new EditProject($data_email);
// email end
return redirect()->route('timesheet::maintenance.senaraiProject')->withSuccess('Project updated!'); return redirect()->route('timesheet::maintenance.senaraiProject')->withSuccess('Project updated!');
} }
...@@ -365,6 +400,49 @@ class MaintenanceController extends Controller ...@@ -365,6 +400,49 @@ class MaintenanceController extends Controller
]); ]);
} }
$project = Project::where('id', $id)
->with('projectManager')
->with('projectDirector')
->first();
$mandays = Pmandays::where('fk_project', $request->id)
->with('role')
->get();
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($project,'projectDirector.email');
}
$data_mandays = [];
foreach ($mandays as $key => $value) {
$data_mandays[$key]['role'] = data_get($value,'role.role');
$data_mandays[$key]['days'] = data_get($value,'pm_days');
$data_mandays[$key]['hours'] = data_get($value,'pm_hours');
}
// dd($data_mandays);
$data_email = [
'subject' => 'Timesheet Project: Changes in Project Mandays',
'sender_name' => '3fetimesheet@gmail.com',
'pcode' => data_get($project,'p_project_code'),
'projectmanager' => data_get($project,'projectManager.fullname'),
'projectdirector' => data_get($project,'projectDirector.fullname'),
'projectname' => data_get($project,'p_project_description'),
'status' => data_get($project,'p_project_sts'),
];
Mail::to($mailTo)->send(new EditMandays($data_email, $data_mandays));
// return new EditMandays($data_email, $data_mandays);
return redirect()->route('timesheet::maintenance.mandays', compact('id'))->with('success', 'Mandays updated successfully!');; return redirect()->route('timesheet::maintenance.mandays', compact('id'))->with('success', 'Mandays updated successfully!');;
} }
...@@ -403,8 +481,6 @@ class MaintenanceController extends Controller ...@@ -403,8 +481,6 @@ class MaintenanceController extends Controller
public function penambahanProjectTeam(Request $request) public function penambahanProjectTeam(Request $request)
{ {
// dd($request);
$pid = $request->id; $pid = $request->id;
$project = Project::where('id', $request->id) $project = Project::where('id', $request->id)
->first(); //find($request->id); ->first(); //find($request->id);
...@@ -432,14 +508,14 @@ class MaintenanceController extends Controller ...@@ -432,14 +508,14 @@ class MaintenanceController extends Controller
public function addprojectteam(Request $request) public function addprojectteam(Request $request)
{ {
// dd($request); // dd(env('MAIL_SERVER'));
$chargeable = 1; $chargeable = 1;
$userId = users::find(Auth::id()) $userId = users::find(Auth::id())
->u_staffID; ->u_staffID;
$expstaff = explode(',', $request->staffId); $expstaff = explode(',', $request->staffId);
$staffs = [];
if ($request->staffId == null || $request->role == null) { if ($request->staffId == null || $request->role == null) {
return redirect()->route('timesheet::maintenance.penambahanProjectTeam', ['id'=>$request->pid])->withErrors('The details are not complete. Kindly fill the detail before add new team.'); return redirect()->route('timesheet::maintenance.penambahanProjectTeam', ['id'=>$request->pid])->withErrors('The details are not complete. Kindly fill the detail before add new team.');
...@@ -449,8 +525,8 @@ class MaintenanceController extends Controller ...@@ -449,8 +525,8 @@ class MaintenanceController extends Controller
{ {
$staff = Staff_info::where('fk_users', $value) $staff = Staff_info::where('fk_users', $value)
->first(); ->first();
$staffs[] = $staff->staff_id;
// dd($request);
$pt = new Pteam; $pt = new Pteam;
$pt->fk_project_id = $request->pid; $pt->fk_project_id = $request->pid;
...@@ -477,8 +553,59 @@ class MaintenanceController extends Controller ...@@ -477,8 +553,59 @@ class MaintenanceController extends Controller
$md->updated_by = $request->userId; $md->updated_by = $request->userId;
$md->save(); $md->save();
} }
}
// dd($staffs);
// email start
$user = Staff_info::where('fk_users', Auth::id())->first();
$project = Project::where('id', $request->pid)
->with('projectManager')
->with('projectDirector')
->first();
$pteam = Pteam::where('fk_project_id', $request->pid)
->whereIn('pt_staff_id', $staffs)
->with('toRole')
->get();
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($project,'projectDirector.email');
}
// dd($mailTo);
$data_staffs = [];
foreach ($pteam as $key => $team) {
$data_staffs[] = [
'no' => $key,
'name' => data_get($team,'pt_team'),
'role' => data_get($team,'toRole.role'),
'status' => data_get($team,'pt_project_task_sts'),
];
} }
$data_email = [
'subject' => 'Timesheet Project: New Project Team Added',
'sender_name' => '3fetimesheet@gmail.com',
'pcode' => data_get($project,'p_project_code'),
'projectmanager' => data_get($project,'projectManager.fullname'),
'projectdirector' => data_get($project,'projectDirector.fullname'),
'projectname' => data_get($project,'p_project_description'),
'username' => data_get($user,'fullname'),
'status' => data_get($project,'p_project_sts'),
];
Mail::to($mailTo)->send(new AddProjectTeam($data_email, $data_staffs));
} }
return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $request->pid]) return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $request->pid])
...@@ -530,7 +657,15 @@ class MaintenanceController extends Controller ...@@ -530,7 +657,15 @@ class MaintenanceController extends Controller
$data = Staff_info::where('id', $request->staffId) $data = Staff_info::where('id', $request->staffId)
->first(); ->first();
$team = Pteam::where('id', $request->id)->first(); $team = Pteam::where('id', $request->id)
->with('toRole')
->first();
$old_data = [
'oldname' => data_get($team,'pt_team'),
'oldrole' => data_get($team,'toRole.role'),
'oldstatus' => data_get($team,'pt_project_task_sts'),
];
$role = $team->role_id; $role = $team->role_id;
...@@ -541,7 +676,6 @@ class MaintenanceController extends Controller ...@@ -541,7 +676,6 @@ class MaintenanceController extends Controller
$team->updated_by = $userId; $team->updated_by = $userId;
$team->save(); $team->save();
$checkpteam = Pteam::where('fk_project_id', $pid) $checkpteam = Pteam::where('fk_project_id', $pid)
->where('role_id', $role) ->where('role_id', $role)
->first(); ->first();
...@@ -553,11 +687,43 @@ class MaintenanceController extends Controller ...@@ -553,11 +687,43 @@ class MaintenanceController extends Controller
->where('pm_roles', $role) ->where('pm_roles', $role)
->first(); ->first();
$checkmandays->delete(); $checkmandays->delete();
// dd($checkmandays);
// dd('null, delete pmandays');
} }
$team = Pteam::where('id', $request->id)
->with('toProject')
->with('toRole')
->first();
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($project,'projectDirector.email');
}
$data_email = [
'subject' => 'Timesheet Project: Changes in project team details',
'sender_name' => '3fetimesheet@gmail.com',
'pcode' => data_get($team,'toProject.p_project_code'),
'projectname' => data_get($team,'toProject.p_project_description'),
'projectmanager' => data_get($team,'toProject.projectManager.fullname'),
'projectdirector' => data_get($team,'toProject.projectDirector.fullname'),
'status' => data_get($team,'toProject.p_project_sts'),
'teamname' => data_get($team,'pt_team'),
'role' => data_get($team,'toRole.role'),
'teamstatus' => data_get($team,'pt_project_task_sts'),
];
// dd($mailTo);
Mail::to($mailTo)->send(new EditProjectTeam($data_email, $old_data));
// return new EditProjectTeam($data_email, $old_data);
return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $pid]) return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $pid])
->with('success', 'Project Team Updated Successfully');; ->with('success', 'Project Team Updated Successfully');;
...@@ -644,9 +810,6 @@ class MaintenanceController extends Controller ...@@ -644,9 +810,6 @@ class MaintenanceController extends Controller
public function senaraiOverhead() public function senaraiOverhead()
{ {
$overhead = Overhead::all(); $overhead = Overhead::all();
// dd($overhead);
// $overhead = Overhead::where('o_overhead_sts', 1)
// ->get();
$overheads = []; $overheads = [];
...@@ -807,4 +970,90 @@ class MaintenanceController extends Controller ...@@ -807,4 +970,90 @@ class MaintenanceController extends Controller
return redirect()->route('timesheet::maintenance.senaraiOverhead')->withSuccess('Overhead has been deleted'); return redirect()->route('timesheet::maintenance.senaraiOverhead')->withSuccess('Overhead has been deleted');
} }
public function mailEditProject()
{
$user = Staff_info::where('fk_users', Auth::id())->first();
$project = Project::where('id', 1)
->with('projectManager')
->with('projectDirector')
->first();
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($project,'projectDirector.email');
}
$data_email = [
'subject' => 'Timesheet Project: Changes in Project details',
'sender_name' => '3fetimesheet@gmail.com',
'pcode' => data_get($project,'p_project_code'),
'projectmanager' => data_get($project,'projectManager.fullname'),
'projectdirector' => data_get($project,'projectDirector.fullname'),
'projectname' => data_get($project,'p_project_description'),
'username' => data_get($user,'fullname'),
'status' => data_get($project,'p_project_sts'),
];
Mail::to($mailTo)->send(new EditProject($data_email));
return new EditProject($data_email);
// return redirect()->route('timesheet::dashboard.index')->withSuccess('Project has been edited');
}
public function mailAddProjectTeam()
{
$user = Staff_info::where('fk_users', Auth::id())->first();
$project = Project::where('id', 1)
->with('projectManager')
->with('projectDirector')
->first();
$pteam = Pteam::where('fk_project_id', 1)
// ->where('role_id', 12)
->with('toRole')
->get();
// dd($pteam);
// $mailTo = data_get($project,'projectDirector.email');
$mailTo = '143hannan@gmail.com';
$data_staffs = [];
foreach ($pteam as $key => $team) {
$data_staffs[] = [
'no' => $key,
'name' => data_get($team,'pt_team'),
'role' => data_get($team,'toRole.role'),
'status' => data_get($team,'pt_project_task_sts'),
];
}
// dd($data_staffs);
$data_email = [
'subject' => 'Timesheet Project: New Project Team Added',
'sender_name' => '3fetimesheet@gmail.com',
// 'isi' => 'This is an auto generated message, please do not reply.',
'pcode' => data_get($project,'p_project_code'),
'projectmanager' => data_get($project,'projectManager.fullname'),
'projectdirector' => data_get($project,'projectDirector.fullname'),
'projectname' => data_get($project,'p_project_description'),
'username' => data_get($user,'fullname'),
'status' => data_get($project,'p_project_sts'),
];
// Mail::to($mailTo)->send(new AddProjectTeam($data_email, $data_staffs));
return new AddProjectTeam($data_email, $data_staffs);
}
} }
\ No newline at end of file
...@@ -27,6 +27,7 @@ class Pteam extends Model ...@@ -27,6 +27,7 @@ class Pteam extends Model
{ {
return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id') return $this->hasOne('Portal\Timesheet\Model\Project','id','fk_project_id')
->where('p_project_sts', 1) ->where('p_project_sts', 1)
->with('projectDirector')
->withTrashed(); ->withTrashed();
} }
......
@component('mail::message')
# Meet our newly appointed project team!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you on as we have appointed @if(count($data_staffs) > 1)new team members @else a new team member @endif to join our {!! $data_email['projectname'] !!} project.
Project details : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" 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;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;">{!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;">{!! $data_email['projectname'] !!}</td>
<td style="border: black 1px solid;">{!! $data_email['projectmanager'] !!}</td>
<td style="border: black 1px solid;">{!! $data_email['projectdirector'] !!}</td>
<td style="border: black 1px solid;">@if( $data_email['status'] == 1) Active @else Inactive @endif</td>
</tr>
</tbody>
</table>
<br>
New project @if(count($data_staffs) > 1)members @else member @endif : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">No</th>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
@foreach($data_staffs as $key => $staff)
<tr>
<td style="border: black 1px solid; width: 10%;">{!! $key+1 !!} </td>
<td style="border: black 1px solid; width: 40%;">{!! $staff['name'] !!} </td>
<td style="border: black 1px solid; width: 40%;">{!! $staff['role'] !!}</td>
<td style="border: black 1px solid; width: 10%;">@if( $staff['status'] == 1) Active @else Inactive @endif</td>
</tr>
@endforeach
</tbody>
</table>
<br>
We wish for a better performance for this project as we appointed new team members.
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')
# Project details has been edited!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you as there are changes in our project details.
The new project details as below : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" 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;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectmanager'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectdirector'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
We wish for a better performance for this project as the changes and alteration has been made for the betterment of the company.
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')
# Introduction
The body of your message.
Thanks,<br>
{{ config('app.name') }}
@endcomponent
@component('mail::message')
# Project mandays details has been updated!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you as there are updates in our project mandays details.
The project details as below : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" 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;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectmanager'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectdirector'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
The project mandays update are as below:
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Days</th>
<th style="border: black 1px solid;">Hours</th>
</tr>
</thead>
<tbody>
<?php $totaldays = $totalhours = 0; ?>
@foreach($data_mandays as $key => $data)
<tr>
<td style="border: black 1px solid;"> {!! $data['role'] !!} </td>
<td style="border: black 1px solid;"> {!! $data['days'] !!} </td>
<td style="border: black 1px solid;"> {!! $data['hours'] !!} </td>
</tr>
<?php $totaldays += $data['days']; ?>
<?php $totalhours += $data['hours']; ?>
@endforeach
<tr>
<td style="border: black 1px solid;">Total</td>
<td style="border: black 1px solid;">{{ number_format($totaldays, '1', '.', '') }}</td>
<td style="border: black 1px solid;">{{ number_format($totalhours, '1', '.', '') }}</td>
</tr>
</tbody>
</table>
<br>
We wish for a better performance for this project as the changes and alteration has been made for the betterment of the company.
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')
# Project team details has been edited!
Assalamualaikum w.b.t Mr/Mrs.
{!! $data_email['projectdirector'] !!}
We would like to inform you as there are changes in our project team details.
The project details as below : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" 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;">Project Manager</th>
<th style="border: black 1px solid;">Project Director</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['pcode'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectmanager'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['projectdirector'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['status'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
The project team details has been change from : <br>
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $old_data['oldname'] !!} </td>
<td style="border: black 1px solid;"> {!! $old_data['oldrole'] !!} </td>
<td style="border: black 1px solid;"> @if( $old_data['oldstatus'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
To:
<table style="border: black 1px solid; font-size: 10px; text-align: center; width: 100%;" id="project">
<thead>
<tr>
<th style="border: black 1px solid;">Name</th>
<th style="border: black 1px solid;">Role</th>
<th style="border: black 1px solid;">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: black 1px solid;"> {!! $data_email['teamname'] !!} </td>
<td style="border: black 1px solid;"> {!! $data_email['role'] !!} </td>
<td style="border: black 1px solid;"> @if( $data_email['teamstatus'] == 1) Active @else Inactive @endif </td>
</tr>
</tbody>
</table>
<br>
We wish for a better performance for this project as the changes and alteration has been made for the betterment of the company.
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
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