Commit dcd3e5d7 by hannan

file management and overhead description form checking

parent 1b125b1e
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOverheadDescriptionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('overhead_description', function (Blueprint $table) {
$table->increments('id');
$table->integer('fk_overhead_id')->unsigned()->nullable();
$table->date('date')->nullable();
$table->string('description',100)->nullable();
$table->timestamps();
$table->integer('updated_by')->nullable();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('overhead_description');
}
}
@extends('ui::layouts.app')
@section('content')
@endsection
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui red ribbon label">Level</a>
<br>
<br>
<div class="ui styled accordion">
<div class="active title">
<i class="dropdown icon"></i>
Level 1
</div>
<div class="active content">
Welcome to level 1
<div class="accordion">
<div class="active title">
<i class="dropdown icon"></i>
Level 1A
</div>
<div class="active content">
<p>Level 1A Contents</p>
<div class="accordion">
<div class="title">
<i class="dropdown icon"></i>
Level 1A-A
</div>
<div class="content">
Level 1A-A Contents
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 1A-B
</div>
<div class="content">
Level 1A-B Contents
</div>
</div>
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 1B
</div>
<div class="content">
Level 1B Contents
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 1C
</div>
<div class="content">
Level 1C Contents
</div>
</div>
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 2
</div>
<div class="content">
<p>Welcome to level 2</p>
<div class="accordion">
<div class="active title">
<i class="dropdown icon"></i>
Level 2A
</div>
<div class="active content">
<p>Level 2A Contents</p>
<div class="accordion">
<div class="title">
<i class="dropdown icon"></i>
Level 2A-A
</div>
<div class="content">
Level 2A-A Contents
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 2A-B
</div>
<div class="content">
Level 2A-B Contents
</div>
</div>
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 2B
</div>
<div class="content">
Level 2B Contents
</div>
<div class="title">
<i class="dropdown icon"></i>
Level 2C
</div>
<div class="content">
Level 2C Contents
</div>
</div>
</div>
</div>
</div>
<div class="ui segment">
<a class="ui blue ribbon label">Sign Up</a>
<div class="ui fluid form">
<div class="two fields">
<div class="field">
<label>First Name</label>
<input placeholder="First Name" type="text">
</div>
<div class="field">
<label>Last Name</label>
<input placeholder="Last Name" type="text">
</div>
</div>
<div class="ui accordion field">
<div class="title active">
<i class="icon dropdown"></i>
Optional Details
</div>
<div class="content field active">
<label class="transition visible">Maiden Name</label>
<input placeholder="Maiden Name" type="text" class="transition visible" style="display: inline-block !important;">
</div>
</div>
<div class="ui secondary submit button">Sign Up</div>
</div>
</div>
@endsection
@push('script')
<script type="text/javascript">
$(document).ready(function(){
$('.ui.accordion').accordion();
});
</script>
@endpush
\ No newline at end of file
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">Perkhidmatan</a>
<br>
<table class="ui celled padded table">
<thead>
<tr><th class="single line">Evidence Rating</th>
<th>Effect</th>
<th>Efficacy</th>
<th>Consensus</th>
<th>Comments</th>
</tr></thead>
<tbody>
<tr>
<td>
<h2 class="ui center aligned header">A</h2>
</td>
<td class="single line">
Power Output
</td>
<td>
<div class="ui star rating disabled" data-rating="3" data-max-rating="3"><i class="icon active"></i><i class="icon active"></i><i class="icon active"></i></div>
</td>
<td class="right aligned">
80% <br>
<a href="#">18 studies</a>
</td>
<td>Creatine supplementation is the reference compound for increasing muscular creatine levels; there is variability in this increase, however, with some nonresponders.</td>
</tr>
<tr>
<td>
<h2 class="ui center aligned header">A</h2>
</td>
<td class="single line">
Weight
</td>
<td>
<div class="ui star rating" data-rating="3" data-max-rating="3"></div>
</td>
<td class="right aligned">
100% <br>
<a href="#">65 studies</a>
</td>
<td>Creatine is the reference compound for power improvement, with numbers from one meta-analysis to assess potency</td>
</tr>
</tbody>
<tfoot>
<tr><th colspan="5">
<div class="ui right floated pagination menu">
<a class="icon item">
<i class="left chevron icon"></i>
</a>
<a class="item">1</a>
<a class="item">2</a>
<a class="item">3</a>
<a class="item">4</a>
<a class="icon item">
<i class="right chevron icon"></i>
</a>
</div>
</th>
</tr></tfoot>
</table>
<table class="ui celled padded table">
<thead>
<tr><th class="single line">Evidence Rating</th>
<th>Effect</th>
<th>Efficacy</th>
<th>Consensus</th>
<th>Comments</th>
</tr></thead>
<tbody>
<tr>
<td>
<h2 class="ui center aligned header">A</h2>
</td>
<td class="single line">
Power Output
</td>
<td>
<div class="ui star rating" data-rating="3" data-max-rating="3"></div>
</td>
<td class="right aligned">
80% <br>
<a href="#">18 studies</a>
</td>
<td>Creatine supplementation is the reference compound for increasing muscular creatine levels; there is variability in this increase, however, with some nonresponders.</td>
</tr>
<tr>
<td>
<h2 class="ui center aligned header">A</h2>
</td>
<td class="single line">
Weight
</td>
<td>
<!-- <div class="ui star rating" data-rating="3" data-max-rating="3">
<i class="icon active"></i> -->
<div class="ui star rating" data-rating="3"></div>
</div>
</td>
<td class="right aligned">
100% <br>
<a href="#">65 studies</a>
</td>
<td>Creatine is the reference compound for power improvement, with numbers from one meta-analysis to assess potency</td>
</tr>
</tbody>
<tfoot>
<tr><th colspan="5">
<div class="ui right floated pagination menu">
<a class="icon item">
<i class="left chevron icon"></i>
</a>
<a class="item">1</a>
<a class="item">2</a>
<a class="item">3</a>
<a class="item">4</a>
<a class="icon item">
<i class="right chevron icon"></i>
</a>
</div>
</th>
</tr></tfoot>
</table>
</div>
<div class="ui segment">
<a class="ui red left ribbon label">User</a>
<table class="ui compact celled definition table">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Registration Date</th>
<th>E-mail address</th>
<th>Premium Plan</th>
</tr>
</thead>
<tbody>
<tr>
<td class="collapsing">
<div class="ui fitted slider checkbox">
<input type="checkbox"> <label></label>
</div>
</td>
<td>John Lilki</td>
<td>September 14, 2013</td>
<td>jhlilk22@yahoo.com</td>
<td>No</td>
</tr>
<tr>
<td class="collapsing">
<div class="ui fitted slider checkbox">
<input type="checkbox"> <label></label>
</div>
</td>
<td>Jamie Harington</td>
<td>January 11, 2014</td>
<td>jamieharingonton@yahoo.com</td>
<td>Yes</td>
</tr>
<tr>
<td class="collapsing">
<div class="ui fitted slider checkbox">
<input type="checkbox"> <label></label>
</div>
</td>
<td>Jill Lewis</td>
<td>May 11, 2014</td>
<td>jilsewris22@yahoo.com</td>
<td>Yes</td>
</tr>
</tbody>
<tfoot class="full-width">
<tr>
<th></th>
<th colspan="4">
<div class="ui right floated small primary labeled icon button">
<i class="user icon"></i> Add User
</div>
<div class="ui small button">
Approve
</div>
<div class="ui small disabled button">
Approve All
</div>
</th>
</tr>
</tfoot>
</table>
</div>
<div class="ui segment">
<a class="ui blue left ribbon label">Kehadiran</a>
<br>
<h3 class="ui block header">
Block Header
</h3>
<div class="ui disabled header">
Absentees (disabled header)
</div>
<h2 class="ui center aligned icon header">
<i class="circular users icon"></i>
Friends
</h2>
<center>
<div class="ui horizontal list">
<div class="item">
<img class="ui mini circular image" src="https://semantic-ui.com/images/avatar2/small/molly.png">
<div class="content">
<div class="ui sub header">Molly</div>
Coordinator
</div>
</div>
<div class="item">
<img class="ui mini circular image" src="https://semantic-ui.com/images/avatar2/small/elyse.png">
<div class="content">
<div class="ui sub header">Elyse</div>
Developer
</div>
</div>
<div class="item">
<img class="ui mini circular image" src="https://semantic-ui.com/images/avatar2/small/eve.png" class="ui mini circular image">
<div class="content">
<div class="ui sub header">Eve</div>
Project Manager
</div>
</div>
</div>
</center>
<br>
<select name="skills" multiple="" class="ui fluid dropdown">
<option value="">Skills</option>
<option value="angular">Angular</option>
<option value="css">CSS</option>
<option value="ember">Ember</option>
<option value="html">HTML</option>
<option value="javascript">Javascript</option>
<option value="meteor">Meteor</option>
<option value="node">NodeJS</option>
</select>
<br>
</div>
@endsection
...@@ -39,7 +39,7 @@ input[type=number] { ...@@ -39,7 +39,7 @@ input[type=number] {
</div> </div>
</form> </form>
<br> <br>
<form class="ui form" action="{{ route('timesheet::dashboard.savechargeablehours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.savechargeablehours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<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}}">
...@@ -146,12 +146,12 @@ input[type=number] { ...@@ -146,12 +146,12 @@ input[type=number] {
</form> </form>
<br> <br>
@if($phase == 1) @if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::dashboard.chargeableForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Phase 2 Phase 2
</button> </button>
@else @else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::dashboard.chargeableForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.chargeableForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Phase 1 Phase 1
</button> </button>
......
...@@ -21,7 +21,7 @@ input[type=number] { ...@@ -21,7 +21,7 @@ input[type=number] {
Add Non-Chargeable Task Add Non-Chargeable Task
</div> </div>
<div class="content"> <div class="content">
<form class="ui form" action="{{ route('timesheet::dashboard.addnonchargeabletask' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.addnonchargeabletask' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<div class="field"> <div class="field">
<label>Select Task</label> <label>Select Task</label>
...@@ -82,17 +82,17 @@ input[type=number] { ...@@ -82,17 +82,17 @@ input[type=number] {
Task Task
</button> </button>
@if($phase == 1) @if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::dashboard.nonChargeableForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Phase 2 Phase 2
</button> </button>
@else @else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::dashboard.nonChargeableForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.nonChargeableForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Phase 1 Phase 1
</button> </button>
@endif @endif
<form class="ui form" action="{{ route('timesheet::dashboard.savenonchargeablehours' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::form.savenonchargeablehours' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<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}}">
......
...@@ -16,6 +16,42 @@ input[type=number] { ...@@ -16,6 +16,42 @@ input[type=number] {
} }
</style> </style>
<div class="ui tiny modal description">
<div class="header">
Overhead Description
</div>
<div class="content">
<form class="ui form" action="{{ route('timesheet::form.addOverheadDescription' )}}" method="POST">
{{csrf_field()}}
<input type="hidden" name="userId" value="{{$userId}}">
<input type="hidden" name="year" value="{{$year}}">
<input type="hidden" name="month" value="{{$month}}">
<input type="hidden" name="phase" value="{{$phase}}">
<div class="two fields">
<div class="six wide field">
<label>Task</label>
<select class="ui search dropdown" name="task" required="required">
<option value="">Task</option>
@foreach($project as $key =>$value)
<option value="{{$value->o_overhead_desc}}">{{$value->o_overhead_desc}}</option>
@endforeach
</select>
</div>
<div class="five wide field">
<label>Date</label>
<input type="date" name="date" required>
</div>
</div>
<div class="field">
<label>Description</label>
<textarea rows="3" name="description" required></textarea>
</div>
<button class="ui close button">Cancel</button>
<button class="ui blue button" type="submit">Submit</button>
</form>
</div>
</div>
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Overhead Form</a> <a class="ui blue left ribbon label">Overhead Form</a>
<br> <br>
...@@ -39,7 +75,13 @@ input[type=number] { ...@@ -39,7 +75,13 @@ input[type=number] {
</div> </div>
</form> </form>
<br> <br>
<form class="ui form" action="{{ route('timesheet::dashboard.saveoverheadhours' )}}" method="POST">
<button class="center aligned ui green compact labeled icon button" id="description">
<i class="plus icon"></i>
Description
</button>
<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}}">
<input type="hidden" name="year" value="{{$year}}"> <input type="hidden" name="year" value="{{$year}}">
...@@ -106,11 +148,10 @@ input[type=number] { ...@@ -106,11 +148,10 @@ input[type=number] {
</td> </td>
@endfor @endfor
@else @else
@for($i = 15; $i < $daymonth; $i++) @for($i = 15; $i < $daymonth; $i++)
<?php <?php
$valuehour = ''; $valuehour = '';
$date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1); $date = $year.'-'.sprintf('%02d', $month).'-'.sprintf('%02d', $i+1);
...@@ -127,10 +168,11 @@ input[type=number] { ...@@ -127,10 +168,11 @@ input[type=number] {
<td > <td >
<input 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 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>
@endfor @endfor
@endif @endif
<td> <td>
<input type="text" name="desc" value="icon"> <div >
</div>
</td> </td>
<td> <td>
<input type="text" onkeypress="onlynumber(event)" name="total-{{$project['td_project']}}" id="total-{{$project['td_project']}}" style="padding-right: 4px;padding-left: 4px;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="" value={{$total}}> <input type="text" onkeypress="onlynumber(event)" name="total-{{$project['td_project']}}" id="total-{{$project['td_project']}}" style="padding-right: 4px;padding-left: 4px;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="" value={{$total}}>
...@@ -142,12 +184,12 @@ input[type=number] { ...@@ -142,12 +184,12 @@ input[type=number] {
</form> </form>
<br> <br>
@if($phase == 1) @if($phase == 1)
<button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::dashboard.overheadForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact right labeled icon button" id="phase2" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 2], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double right icon"></i> <i class="angle double right icon"></i>
Phase 2 Phase 2
</button> </button>
@else @else
<button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::dashboard.overheadForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';"> <button class="center aligned ui green compact labeled icon button" id="phase1" onclick="window.location.href='{{ route('timesheet::form.overheadForm', ['phase' => 1], ['month' => $month], ['year' => $year]) }}';">
<i class="angle double left icon"></i> <i class="angle double left icon"></i>
Phase 1 Phase 1
</button> </button>
...@@ -160,6 +202,22 @@ input[type=number] { ...@@ -160,6 +202,22 @@ input[type=number] {
@push('script') @push('script')
<script> <script>
$(function(){
$("#description").click(function()
{
$(".description").modal('show');
});
$(".description").modal(
{
closable: true
});
$(".description").modal('attach events', '.close.button');
});
</script>
<script>
function onlynumber(evt) function onlynumber(evt)
{ {
var theEvent = evt || window.event; var theEvent = evt || window.event;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Add New Role</a> <a class="ui blue left ribbon label">Add New Role</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.updaterole' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.updaterole' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="id" value="{{$role->id}}"> <input type="hidden" name="id" value="{{$role->id}}">
<div class="field"> <div class="field">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Edit Project Team</a> <a class="ui blue left ribbon label">Edit Project Team</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.updateprojectteam')}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.updateprojectteam')}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="id" value="{{$team->id}} "> <input type="hidden" name="id" value="{{$team->id}} ">
<input type="hidden" name="pid" value="{{$team->fk_project_id}} "> <input type="hidden" name="pid" value="{{$team->fk_project_id}} ">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</select> </select>
</div> </div>
<button class="ui blue button" type="submit">Update</button> <button class="ui blue button" type="submit">Update</button>
<button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::dashboard.senaraiProjectTeam', ['id'=> $pid] ) }} ';">Back</button> <button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProjectTeam', ['id'=> $pid] ) }} ';">Back</button>
</form> </form>
</div> </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Add New Overhead Lookup</a> <a class="ui blue left ribbon label">Add New Overhead Lookup</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.addoverheadlookup' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.addoverheadlookup' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<div class="field"> <div class="field">
<label>Overhead Lookup</label> <label>Overhead Lookup</label>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Add New Role</a> <a class="ui blue left ribbon label">Add New Role</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.addrole' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.addrole' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<div class="field"> <div class="field">
<label>Role Description</label> <label>Role Description</label>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Add New Project</a> <a class="ui blue left ribbon label">Add New Project</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.addnewproject' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.addnewproject' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<div class="field"> <div class="field">
<label>Project Code</label> <label>Project Code</label>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</select> </select>
</div> </div>
<button class="ui blue button" type="submit">Submit</button> <button class="ui blue button" type="submit">Submit</button>
<button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::dashboard.senaraiProject') }} ';">Back</button> <button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProject') }} ';">Back</button>
</form> </form>
</div> </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment loading-screen"> <div class="ui segment loading-screen">
<a class="ui blue left ribbon label">Add New Project Team</a> <a class="ui blue left ribbon label">Add New Project Team</a>
<br><br> <br><br>
<form class="ui form" action="{{ route('timesheet::dashboard.addprojectteam' )}}" method="POST"> <form class="ui form" action="{{ route('timesheet::maintenance.addprojectteam' )}}" method="POST">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="pid" value="{{$pid}}"> <input type="hidden" name="pid" value="{{$pid}}">
<input type="hidden" name="pcode" value="{{ $project->p_project_code }}"> <input type="hidden" name="pcode" value="{{ $project->p_project_code }}">
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</select> </select>
</div> </div>
<button class="ui blue button" type="submit">Save</button> <button class="ui blue button" type="submit">Save</button>
<button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::dashboard.senaraiProjectTeam', ['id'=> $pid] ) }} ';">Back</button> <button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProjectTeam', ['id'=> $pid] ) }} ';">Back</button>
</form> </form>
</div> </div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
@section('content') @section('content')
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Overhead</a> <a class="ui blue left ribbon label">Senarai Overhead</a>
<a href="{{ route('timesheet::dashboard.penambahanOverhead')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Penambahan Lookup Overhead <a href="{{ route('timesheet::maintenance.penambahanOverhead')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Penambahan Lookup Overhead
</a> </a>
<br> <br>
<table class="ui celled padded table"> <table class="ui celled padded table">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Peranan</a> <a class="ui blue left ribbon label">Senarai Peranan</a>
<a href="{{ route('timesheet::dashboard.penambahanPeranan')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Role <a href="{{ route('timesheet::maintenance.penambahanPeranan')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Role
</a> </a>
<br> <br>
<table class="ui celled padded table"> <table class="ui celled padded table">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<td>{{$key+1}} </td> <td>{{$key+1}} </td>
<td>{{$role['role']}} </td> <td>{{$role['role']}} </td>
<td>{{$role['status']}} </td> <td>{{$role['status']}} </td>
<td><a href="{{ route('timesheet::dashboard.editPeranan', ['id' => $role['id']]) }}">Edit</a></td> <td><a href="{{ route('timesheet::maintenance.editPeranan', ['id' => $role['id']]) }}">Edit</a></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Project</a> <a class="ui blue left ribbon label">Senarai Project</a>
<a href="{{ route('timesheet::dashboard.penambahanProject')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project <a href="{{ route('timesheet::maintenance.penambahanProject')}} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project
</a> </a>
<br> <br>
<table class="ui celled padded table"> <table class="ui celled padded table">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<td>{{ data_get($project,'projectname') }} </td> <td>{{ data_get($project,'projectname') }} </td>
<td>{{ data_get($project,'projectmanager') }} </td> <td>{{ data_get($project,'projectmanager') }} </td>
<td>{{ data_get($project,'status') }} </td> <td>{{ data_get($project,'status') }} </td>
<td><a href="{{ route('timesheet::dashboard.senaraiProjectTeam', ['id' => $project['id']]) }}">Project Team</a></td> <td><a href="{{ route('timesheet::maintenance.senaraiProjectTeam', ['id' => $project['id']]) }}">Project Team</a></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="ui segment"> <div class="ui segment">
<a class="ui blue left ribbon label">Senarai Project Team</a> <a class="ui blue left ribbon label">Senarai Project Team</a>
<a href="{{ route('timesheet::dashboard.penambahanProjectTeam', ['id' => $pid]) }} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project Team <a href="{{ route('timesheet::maintenance.penambahanProjectTeam', ['id' => $pid]) }} " class="ui right floated small primary labeled icon button"><i class="plus icon"></i>Add New Project Team
</a> </a>
<br> <br>
<table class="ui celled padded table"> <table class="ui celled padded table">
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<td>{{$project['projectteam']}} </td> <td>{{$project['projectteam']}} </td>
<td>{{ data_get($project, 'role') }}</td> <td>{{ data_get($project, 'role') }}</td>
<td>{{$project['status']}} </td> <td>{{$project['status']}} </td>
<td><a href="{{ route('timesheet::dashboard.editprojectteam', ['id' => $project['id']])}} ">Edit</a></td> <td><a href="{{ route('timesheet::maintenance.editprojectteam', ['id' => $project['id']])}} ">Edit</a></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
......
...@@ -13,50 +13,51 @@ Route::group( ...@@ -13,50 +13,51 @@ Route::group(
Route::get('home',['uses' => 'DashboardController@index', 'as' => 'dashboard.index']); Route::get('home',['uses' => 'DashboardController@index', 'as' => 'dashboard.index']);
//maintenance //maintenance
Route::get('senaraiProject',['uses' => 'DashboardController@senaraiProject', 'as' => 'dashboard.senaraiProject']); Route::get('senaraiProject',['uses' => 'MaintenanceController@senaraiProject', 'as' => 'maintenance.senaraiProject']);
Route::get('penambahanProject',['uses' => 'DashboardController@penambahanProject', 'as' => 'dashboard.penambahanProject']); Route::get('penambahanProject',['uses' => 'MaintenanceController@penambahanProject', 'as' => 'maintenance.penambahanProject']);
Route::get('senaraiProjectTeam',['uses' => 'DashboardController@senaraiProjectTeam', 'as' => 'dashboard.senaraiProjectTeam']); Route::post('addnewproject',['uses' => 'MaintenanceController@addnewproject', 'as' => 'maintenance.addnewproject']);
Route::get('penambahanProjectTeam',['uses' => 'DashboardController@penambahanProjectTeam', 'as' => 'dashboard.penambahanProjectTeam']);
Route::post('addnewproject',['uses' => 'DashboardController@addnewproject', 'as' => 'dashboard.addnewproject']);
Route::post('addprojectteam',['uses' => 'DashboardController@addprojectteam', 'as' => 'dashboard.addprojectteam']);
Route::get('editprojectteam',['uses' => 'DashboardController@editprojectteam', 'as' => 'dashboard.editprojectteam']);
Route::post('updateprojectteam',['uses' => 'DashboardController@updateprojectteam', 'as' => 'dashboard.updateprojectteam']);
Route::get('senaraiOverhead',['uses' => 'DashboardController@senaraiOverhead', 'as' => 'dashboard.senaraiOverhead']);
Route::get('penambahanOverhead',['uses' => 'DashboardController@penambahanOverhead', 'as' => 'dashboard.penambahanOverhead']);
Route::post('addoverheadlookup',['uses' => 'DashboardController@addoverheadlookup', 'as' => 'dashboard.addoverheadlookup']);
Route::get('senaraiPeranan',['uses' => 'DashboardController@senaraiPeranan', 'as' => 'dashboard.senaraiPeranan']);
Route::get('penambahanPeranan',['uses' => 'DashboardController@penambahanPeranan', 'as' => 'dashboard.penambahanPeranan']);
Route::post('addrole',['uses' => 'DashboardController@addrole', 'as' => 'dashboard.addrole']);
Route::get('editPeranan',['uses' => 'DashboardController@editPeranan', 'as' => 'dashboard.editPeranan']);
Route::post('updaterole',['uses' => 'DashboardController@updaterole', 'as' => 'dashboard.updaterole']);
// nonChargeableForm Route::get('senaraiProjectTeam',['uses' => 'MaintenanceController@senaraiProjectTeam', 'as' => 'maintenance.senaraiProjectTeam']);
Route::post('addnonchargeabletask',['uses' => 'DashboardController@addnonchargeabletask', 'as' => 'dashboard.addnonchargeabletask']); Route::get('penambahanProjectTeam',['uses' => 'MaintenanceController@penambahanProjectTeam', 'as' => 'maintenance.penambahanProjectTeam']);
Route::post('addprojectteam',['uses' => 'MaintenanceController@addprojectteam', 'as' => 'maintenance.addprojectteam']);
Route::get('editprojectteam',['uses' => 'MaintenanceController@editprojectteam', 'as' => 'maintenance.editprojectteam']);
Route::post('updateprojectteam',['uses' => 'MaintenanceController@updateprojectteam', 'as' => 'maintenance.updateprojectteam']);
Route::get('senaraiOverhead',['uses' => 'MaintenanceController@senaraiOverhead', 'as' => 'maintenance.senaraiOverhead']);
Route::get('penambahanOverhead',['uses' => 'MaintenanceController@penambahanOverhead', 'as' => 'maintenance.penambahanOverhead']);
Route::post('addoverheadlookup',['uses' => 'MaintenanceController@addoverheadlookup', 'as' => 'maintenance.addoverheadlookup']);
Route::get('senaraiPeranan',['uses' => 'MaintenanceController@senaraiPeranan', 'as' => 'maintenance.senaraiPeranan']);
Route::get('penambahanPeranan',['uses' => 'MaintenanceController@penambahanPeranan', 'as' => 'maintenance.penambahanPeranan']);
Route::post('addrole',['uses' => 'MaintenanceController@addrole', 'as' => 'maintenance.addrole']);
Route::get('editPeranan',['uses' => 'MaintenanceController@editPeranan', 'as' => 'maintenance.editPeranan']);
Route::post('updaterole',['uses' => 'MaintenanceController@updaterole', 'as' => 'maintenance.updaterole']);
// route to form // route to form
Route::get('chargeableForm',['uses' => 'DashboardController@chargeableForm', 'as' => 'dashboard.chargeableForm']); Route::get('chargeableForm',['uses' => 'FormController@chargeableForm', 'as' => 'form.chargeableForm']);
Route::get('nonChargeableForm',['uses' => 'DashboardController@nonChargeableForm', 'as' => 'dashboard.nonChargeableForm']); Route::get('nonChargeableForm',['uses' => 'FormController@nonChargeableForm', 'as' => 'form.nonChargeableForm']);
Route::get('overheadForm',['uses' => 'DashboardController@overheadForm', 'as' => 'dashboard.overheadForm']); Route::get('overheadForm',['uses' => 'FormController@overheadForm', 'as' => 'form.overheadForm']);
Route::post('savechargeablehours',['uses' => 'FormController@savechargeablehours', 'as' => 'form.savechargeablehours']);
Route::post('savenonchargeablehours',['uses' => 'FormController@savenonchargeablehours', 'as' => 'form.savenonchargeablehours']);
Route::post('saveoverheadhours',['uses' => 'FormController@saveoverheadhours', 'as' => 'form.saveoverheadhours']);
Route::post('addOverheadDescription',['uses' => 'FormController@addOverheadDescription', 'as' => 'form.addOverheadDescription']);
// nonChargeableForm
Route::post('addnonchargeabletask',['uses' => 'FormController@addnonchargeabletask', 'as' => 'form.addnonchargeabletask']);
//calendar //calendar
Route::get('kalendarCharge',['uses' => 'DashboardController@kalendarCharge', 'as' => 'dashboard.kalendarCharge']); Route::get('kalendarCharge',['uses' => 'CalendarController@kalendarCharge', 'as' => 'kalendar.kalendarCharge']);
Route::get('kalendarNonCharge',['uses' => 'DashboardController@kalendarNonCharge', 'as' => 'dashboard.kalendarNonCharge']); Route::get('kalendarNonCharge',['uses' => 'CalendarController@kalendarNonCharge', 'as' => 'kalendar.kalendarNonCharge']);
Route::get('kalendar',['uses' => 'DashboardController@kalendar', 'as' => 'dashboard.kalendar']); Route::get('kalendar',['uses' => 'CalendarController@kalendar', 'as' => 'kalendar.kalendar']);
//timesheet
Route::get('timesheet_approval',['uses' => 'DashboardController@timesheetApproval', 'as' => 'dashboard.timesheetApproval']); Route::get('timesheet_approval',['uses' => 'DashboardController@timesheetApproval', 'as' => 'dashboard.timesheetApproval']);
Route::get('timesheet_report',['uses' => 'DashboardController@timesheetReport', 'as' => 'dashboard.timesheetReport']); Route::get('timesheet_report',['uses' => 'DashboardController@timesheetReport', 'as' => 'dashboard.timesheetReport']);
Route::get('timesheet_review',['uses' => 'DashboardController@timesheetReview', 'as' => 'dashboard.timesheetReview']); Route::get('timesheet_review',['uses' => 'DashboardController@timesheetReview', 'as' => 'dashboard.timesheetReview']);
Route::get('timesheet_viewer',['uses' => 'DashboardController@timesheetViewer', 'as' => 'dashboard.timesheetViewer']); Route::get('timesheet_viewer',['uses' => 'DashboardController@timesheetViewer', 'as' => 'dashboard.timesheetViewer']);
Route::post('savechargeablehours',['uses' => 'DashboardController@savechargeablehours', 'as' => 'dashboard.savechargeablehours']);
Route::post('savenonchargeablehours',['uses' => 'DashboardController@savenonchargeablehours', 'as' => 'dashboard.savenonchargeablehours']);
Route::post('saveoverheadhours',['uses' => 'DashboardController@saveoverheadhours', 'as' => 'dashboard.saveoverheadhours']);
Route::get('pengurusan',['uses' => 'DashboardController@pengurusan', 'as' => 'dashboard.pengurusan']);
Route::get('perkhidmatan',['uses' => 'DashboardController@perkhidmatan', 'as' => 'dashboard.perkhidmatan']);
//php_sqlsrv_80_ts_x86.dll //php_sqlsrv_80_ts_x86.dll
Route::get('ajax/stafflist/{dept}',['uses' => 'DashboardController@loadstaff', 'as' => 'dashboard.loadstaff']); Route::get('ajax/stafflist/{dept}',['uses' => 'MaintenanceController@loadstaff', 'as' => 'maintenance.loadstaff']);
} }
); );
......
<?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;
class CalendarController extends Controller
{
public function kalendarCharge()
{
return view('timesheet::kalendar.kalendarCharge');
}
public function kalendarNonCharge()
{
return view('timesheet::kalendar.kalendarNonCharge');
}
public function kalendar()
{
return view('timesheet::kalendar.kalendar');
}
}
\ No newline at end of file
...@@ -68,1097 +68,6 @@ class DashboardController extends Controller ...@@ -68,1097 +68,6 @@ class DashboardController extends Controller
return view('timesheet::dashboard.approval'); return view('timesheet::dashboard.approval');
} }
}
public function pengurusan()
{
return view('timesheet::dashboard.pengurusan');
}
public function senaraiProject()
{
$chargeable = 1;
$project = Project::where('p_project_type', $chargeable)
->get();
$projectlist = [];
// nanti project code query dari table project:
if(count($project) > 0) {
foreach ($project as $key => $value){
$pm = Pteam::where('fk_project_id', $value->id)
->where('role_id', 1)
->where('pt_project_task_sts', 1)
->first();
// dd($pm->pt_team);
$projectlist[] = [
'id' => $value->id,
'projectcode' => $value->p_project_code,
'projectname' => $value->p_project_description,
'projectmanager' => $pm->pt_team,
'status' => $value->p_project_sts,
];
}
}
else
{
$projectlist = [];
}
return view('timesheet::dashboard.senaraiProject',compact('projectlist'));
}
public function penambahanProject()
{
$pms = 4;
$pm = DB::table('staff_info')
// ->where('fk_lkp_department', $pms)
->where('flag_pm', 1)
->where('status', 1)
// ->join('users', 'u_staffID', '=', 'staff_id')
->get();
// dd($pm);
return view('timesheet::dashboard.penambahanProject', compact('pm'));
}
public function addnewproject(Request $request)
{
$chargeable = 1;
$nonchargeable = 2;
$userId = users::find(Auth::id())
->u_staffID;
if ($request->projectcode == null || $request->projectname == null || $request->projectmanager == null) {
return redirect()->route('timesheet::dashboard.penambahanProject')
->withErrors('The information is not complete. Please re-enter!');
} else {
// dd($request);
$project = new Project;
$project->p_project_code = $request->projectcode;
$project->p_project_description = $request->projectname;
$project->p_project_type = $chargeable;
$project->p_project_task_team = $request->projectmanager;
$project->p_project_sts = $request->status;
$project->updated_by = $userId;
$project->save();
$noncharge = new Project;
$noncharge->p_project_description = $request->projectname;
$noncharge->p_project_type = $nonchargeable;
$noncharge->p_project_sts = $request->status;
$noncharge->updated_by = $userId;
$noncharge->save();
$projectId = Project::select('id')
->where('p_project_code', $request->projectcode)
->value('id');
$sname = Staff_info::select('fullname')
->where('staff_id', $request->projectmanager)
->value('fullname');
// dd($projectId);
$team = new Pteam;
$team->role_id = 1;
$team->pt_project_description = $request->projectname;
$team->fk_project_id = $projectId;
$team->pt_staff_id = $request->projectmanager;
$team->pt_team = $sname;
$team->pt_project_type = $chargeable;
$team->pt_project_task_sts = 1;
$team->updated_by = $userId;
$team->save();
}
return redirect()->route('timesheet::dashboard.senaraiProject')
->with('success', 'New Project Added');
}
public function senaraiProjectTeam(Request $request)
{
$chargeable = 1;
$pid = $request->id;
$project = Pteam::where('fk_project_id',$request->id)
->where('pt_project_type', $chargeable)
// ->where('pt_project_task_sts', 1)
->orderBy('pt_project_task_sts', 'DESC')
->orderBy('role_id')
->get();
$projectlist = [];
// dd($projectlistct);
// nanti project code query dari table project:
foreach ($project as $key => $value) {
// dd($value->toRole->role);
$projectlist[] = [
'id' => $value->id,
'projectcode' => $value->toProject->p_project_code,
'projectname' => $value->pt_project_description,
'projectteam' => $value->pt_team,
'role' => $value->toRole->role,
'status' => $value->pt_project_task_sts,
'pid' => $value->fk_project_id,
];
}
return view('timesheet::dashboard.senaraiProjectTeam', compact('projectlist', 'project', 'pid'));
}
public function penambahanProjectTeam(Request $request)
{
$pid = $request->id;
$project = Project::where('id', $request->id)
->first(); //find($request->id);
$departments = Department::all()
->except([7]);
// ->except($departments->code,['']);
foreach ($departments as $key => $value)
{
$staffs = Staff_info::where('fk_lkp_department', $value->id)
->get();
// dd($value->id);
}
$roles = Role::where('status', 1)
->get();
// dd($roles->role);
return view('timesheet::dashboard.penambahanProjectTeam', compact('project', 'departments', 'staffs', 'pid', 'roles'));
}
public function addprojectteam(Request $request)
{
$chargeable = 1;
$userId = users::find(Auth::id())
->u_staffID;
$expstaff = explode(',', $request->staffId);
if ($request->staffId == null || $request->role == null) {
dd($request);
return redirect()->route('timesheet::dashboard.penambahanProjectTeam', ['pcode'=>$request->pcode, 'pname'=>$request->pname, $request->id]);
} else {
foreach ($expstaff as $key => $value)
{
$staff = Staff_info::where('fk_users', $value)
->first();
// dd($request);
$pt = new Pteam;
$pt->fk_project_id = $request->pid;
$pt->pt_project_description = $request->pname;
$pt->pt_team = $staff->fullname;
$pt->pt_staff_id = $staff->staff_id;
// $pt->pt_staff_id = $value;
$pt->pt_project_task_sts = $request->status;
$pt->role_id = $request->role;
$pt->updated_by = $userId;
$pt->pt_project_type = $chargeable;
$pt->save();
}
}
return redirect()->route('timesheet::dashboard.senaraiProject')
->with('success', 'Project Team Added Successfully');
}
public function editprojectteam(Request $request)
{
$team = Pteam::where('id', $request->id)
->first();
$teamRole = Role::where('id', $team->role_id)
->first();
// dd($team);
$role = Role::all();
// dd($role);
$pid = $team->fk_project_id;
return view('timesheet::dashboard.editprojectteam', compact('team', 'pid', 'role', 'teamRole'));
}
public function updateprojectteam(Request $request)
{
$pid = $request->pid;
$userId = users::find(Auth::id())
->u_staffID;
// dd($request);
$team = Pteam::where('id', $request->id)->first();
$team->pt_project_task_sts = $request->status;
$team->role_id = $request->role;
$team->updated_by = $userId;
// letak query utk update role
// $team->pt_role = $request->role;
$team->update();
// $project = Pteam::where('fk_project_id',$request->pid)
// ->get();
// $projectlist = [];
// foreach ($project as $key => $value) {
// $projectlist[] = [
// 'id' => $value->id,
// 'projectcode' => $value->toProject->p_project_code,
// 'projectname' => $value->pt_project_description,
// 'projectteam' => $value->pt_team,
// 'status' => $value->pt_project_task_sts,
// ];
// }
return redirect()->route('timesheet::dashboard.senaraiProjectTeam', ['id' => $pid])
->with('success', 'Project Team Edited Successfully');;
}
public function senaraiPeranan()
{
$peranan = Role::all();
$roles = [];
foreach ($peranan as $key => $value) {
$roles[] = [
'id' => $value->id,
'role' => $value->role,
'status' => $value->status
];
}
return view('timesheet::dashboard.senaraiPeranan', compact('roles'));
}
public function penambahanPeranan()
{
return view('timesheet::dashboard.penambahanPeranan');
}
public function addrole(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$data = new Role;
$data->role = $request->role;
$data->status = $request->status;
$data->updated_by = $userId;
$data->save();
return redirect()->route('timesheet::dashboard.senaraiPeranan')
->with('success', 'Role Added Successfully');
}
public function editPeranan(Request $request)
{
$role = Role::where('id', $request->id)
->first();
if ($role->status == 1) {
$status = 'Active';
} else {
$status = 'Inactive';
}
return view('timesheet::dashboard.editPeranan', compact('role', 'status'));
}
public function updaterole(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$data = Role::where('id', $request->id)
->first();
$data->role = $request->role;
$data->status = $request->status;
$data->updated_by = $userId;
$data->update();
return redirect()->route('timesheet::dashboard.senaraiPeranan')
->with('success', 'Role Updated Successfully');
}
public function perkhidmatan()
{
return view('timesheet::dashboard.perkhidmatan');
}
public function chargeableForm(Request $request)
{
$chargeable = 1;
$userId = users::find(Auth::id())
->u_staffID;
$project = Pteam::where('pt_staff_id',$userId)
->where('pt_project_type', $chargeable)
->get();
$projectlist = [];
// nanti project code query dari table project:
foreach ($project as $key => $value) {
$projectlist[] = [
'td_project' => $value->fk_project_id,
'td_project_code' => $value->toProject->p_project_code,
'td_project_name' => $value->toProject->p_project_description,
];
}
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y');
$day = date('j');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
//kalau ada, dia gi ke edit
if($check)
{
$hour = Ts_detail::where('fk_tm_id',$check->id)
// ->with('project:p_project_code')
->get();
// dd($hour);
}
//klu xde g create.php
else
{
$hour = null;
}
return view('timesheet::dashboard.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour'));
}
public function nonChargeableForm(Request $request)
{
$nonchargeable = 2;
$userId = users::find(Auth::id())
->u_staffID;
$nonchargeables = Project::where('p_project_type', $nonchargeable)
->get();
$project = Pteam::where('pt_staff_id',$userId)
->where('pt_project_type', $nonchargeable)
->get();
$projectlist = [];
// nanti project code query dari table project:
foreach ($project as $key => $value) {
$projectlist[] = [
'td_project' => $value->fk_project_id,
'td_project_name' => $value->toProject->p_project_description,
];
}
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y');
$day = date('j');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
//kalau ada, dia gi ke edit
if($check)
{
$hour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $nonchargeable)
// ->with('project:p_project_code')
->get();
// dd($hour);
}
//klu xde g create.php
else
{
$hour = null;
}
return view('timesheet::dashboard.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour','nonchargeables'));
}
public function addnonchargeabletask(Request $request)
{
$nonchargeable = 2;
$user = Users::select('name','u_staffID')
->where('id',Auth::id())
->first();
if ($request->chargeableProject != null && $request->nonChargeableProject == null) {
// dd('select only');
$project = Project::where('id', $request->chargeableProject)
->first();
$data = new Pteam;
$data->fk_project_id = $request->chargeableProject;
$data->pt_project_description = $project->p_project_description;
$data->pt_team = $user->name;
$data->pt_staff_id = $user->u_staffID;
$data->pt_project_task_sts = $request->status;
$data->updated_by = $user->u_staffID;
$data->pt_project_type = $nonchargeable;
$data->save();
}else if ($request->chargeableProject != null && $request->nonChargeableProject != null) {
// dd('select and input');
$project = Project::where('id', $request->chargeableProject)
->first();
$select = new Pteam;
$select->fk_project_id = $request->chargeableProject;
$select->pt_project_description = $project->p_project_description;
$select->pt_team = $user->name;
$select->pt_staff_id = $user->u_staffID;
$select->pt_project_task_sts = $request->status;
$select->updated_by = $user->u_staffID;
$select->pt_project_type = $nonchargeable;
$select->save();
$task = new Project;
$task->p_project_description = $request->nonChargeableProject;
$task->pt_project_type = $nonchargeable;
$task->p_project_sts = $request->status;
$task->updated_by = $user->u_staffID;
$task->save();
$taskId = Project::select('id')
->where('p_project_description', $request->nonChargeableProject)
->first();
// dd($taskId->id);
$pt = new Pteam;
$pt->pt_project_description = $request->nonChargeableProject;
$pt->fk_project_id = $taskId->id;
$pt->pt_team = $user->name;
$pt->pt_staff_id = $user->u_staffID;
$pt->pt_project_task_sts = $request->status;
$pt->updated_by = $user->u_staffID;
$pt->pt_project_type = $nonchargeable;
$pt->save();
}else if ($request->chargeableProject == null && $request->nonChargeableProject != null) {
// dd('input ja');
$task = new Project;
$task->p_project_description = $request->nonChargeableProject;
$task->p_project_type = $nonchargeable;
$task->p_project_sts = $request->status;
$task->updated_by = $user->u_staffID;
$task->save();
$taskId = Project::select('id')
->where('p_project_description', $request->nonChargeableProject)
->first();
// dd($taskId->id);
$pt = new Pteam;
$pt->pt_project_description = $request->nonChargeableProject;
$pt->fk_project_id = $taskId->id;
$pt->pt_team = $user->name;
$pt->pt_staff_id = $user->u_staffID;
$pt->pt_project_task_sts = $request->status;
$pt->updated_by = $user->u_staffID;
$pt->pt_project_type = $nonchargeable;
$pt->save();
} else {
return redirect()->route('timesheet::dashboard.nonChargeableForm')->withErrors('You did not select any task or enter any input!');
}
return redirect()->route('timesheet::dashboard.nonChargeableForm')->withSuccess('Successfully Added New Task');
}
public function overheadForm(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$project = Overhead::where('o_overhead_sts',1)
->get();
$projectlist = [];
// nanti project code query dari table project:
foreach ($project as $key => $value) {
$projectlist[] = [
'td_project' => $value->id,
'td_project_name' => $value->o_overhead_desc,
];
}
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y');
$day = date('j');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
//kalau ada, dia gi ke edit
if($check)
{
$hour = Ts_detail::where('fk_tm_id',$check->id)
// ->with('project:p_project_code')
->get();
// dd($hour);
}
//klu xde g create.php
else
{
$hour = null;
}
return view('timesheet::dashboard.overheadForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour'));
}
public function kalendarCharge()
{
return view('timesheet::dashboard.kalendarCharge');
}
public function kalendarNonCharge()
{
return view('timesheet::dashboard.kalendarNonCharge');
}
public function kalendar()
{
return view('timesheet::dashboard.kalendar');
}
public function savechargeablehours(Request $request)
{
// chargeable, project type 1.
$chargeable = 1;
$userId = users::find(Auth::id())
->u_staffID;
// check table master. untuk total chargeable hours.
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if($check)
{
}
// kalau takda, save() baru.
else
{
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
// $check ->tm_chargeable_hrs = ;
$check->save();
}
$tmasterid = $check->id;
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail = $request->hour;
foreach ($detail as $key => $value)
{
foreach ($value as $keyday => $day)
{
$projectid = $key;
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('td_project', $projectid)
->where('td_project_type', $chargeable)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
$valuehour = $day;
if($valuehour == null)
{
$valuehour = 0;
}
if($checkTimesheetDetail)
{
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
} //kalau takde, isi semua.
else
{
//isi semua
$tmdetail = new Ts_detail;
$tmdetail->td_date = $date;
$tmdetail->td_project = $projectid;
$tmdetail->fk_tm_id = $tmasterid;
$tmdetail->tm_staff_id = $userId;
$tmdetail->tm_month = $check->tm_month;
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $chargeable;
$project = Project::where('id', $projectid)
->first();
$tmdetail->td_project_name = $project->p_project_description;
$tmdetail->td_hours = $valuehour;
$tmdetail->updated_by = $userId;
$tmdetail->save();
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $chargeable)
->where('tm_phase', $request->phase)
->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_chargeable_hrs = $sumdetailhour;
$checktotalhours->tm_chargeable_days = $sumdetailhour/8.0;
$checktotalhours->update();
// return redirect::to('mobile/profile');
return redirect()->route('timesheet::dashboard.chargeableForm', ['phase' => $request->phase, 'month' =>$request->month,'year',$request->year])->with('success', 'Timesheet Updated');
}
public function savenonchargeablehours(Request $request)
{
// chargeable, project type 1.
$nonchargeable = 2;
$userId = users::find(Auth::id())
->u_staffID;
// dd($request->phase);
// check table master. untuk total chargeable hours.
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
// dd($check);
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if($check)
{
// dd('tmaster dah ada');
}
// kalau takda, save() baru.
else
{
// dd('null, gi sini');
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
$check->save();
}
$tmasterid = $check->id;
// dd($tmasterid);
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail = $request->hour;
foreach ($detail as $key => $value)
{
foreach ($value as $keyday => $day)
{
$projectid = $key;
// dd($projectid);
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('td_project', $projectid)
->where('td_project_type', $nonchargeable)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
$valuehour = $day;
if($valuehour == null)
{
$valuehour = 0;
}
if($checkTimesheetDetail)
{
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
} //kalau takde, isi semua.
else
{
//isi semua
$tmdetail = new Ts_detail;
$tmdetail->td_date = $date;
$tmdetail->td_project = $projectid;
$tmdetail->fk_tm_id = $tmasterid;
$tmdetail->tm_staff_id = $userId;
$tmdetail->tm_month = $check->tm_month;
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $nonchargeable;
$project = Project::where('id', $projectid)
->first();
$tmdetail->td_project_name = $project->p_project_description;
$tmdetail->td_hours = $valuehour;
$tmdetail->updated_by = $userId;
$tmdetail->save();
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $nonchargeable)
->where('tm_phase', $request->phase)
->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_nonchargeable_hrs = $sumdetailhour;
$checktotalhours->tm_nonchargeable_days = $sumdetailhour/8.0;
$checktotalhours->update();
// return redirect::to('mobile/profile');
return redirect()->route('timesheet::dashboard.nonChargeableForm', ['phase' => $request->phase, 'month' =>$request->month,'year',$request->year])->with('success', 'Timesheet Updated');
}
public function saveoverheadhours(Request $request)
{
// overhead, project type 3.
$overhead = 3;
$userId = users::find(Auth::id())
->u_staffID;
// check table master. untuk total chargeable hours.
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if($check)
{
}
// kalau takda, save() baru.
else
{
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
// $check ->tm_chargeable_hrs = ;
$check->save();
}
$tmasterid = $check->id;
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail = $request->hour;
foreach ($detail as $key => $value)
{
foreach ($value as $keyday => $day)
{
$projectid = $key;
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('fk_o_id', $projectid)
// ->where('td_project_type', $project_type)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
$valuehour = $day;
if($valuehour == null)
{
$valuehour = 0;
}
if($checkTimesheetDetail)
{
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
} //kalau takde, isi semua.
else
{
//isi semua
$tmdetail = new Ts_detail;
$tmdetail->td_date = $date;
$tmdetail->fk_o_id = $projectid;
$tmdetail->fk_tm_id = $tmasterid;
$tmdetail->tm_staff_id = $userId;
$tmdetail->tm_month = $check->tm_month;
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $overhead;
$tmdetail->updated_by = $userId;
$project = Overhead::where('id', $projectid)
->first();
$tmdetail->td_overhead_desc = $project->o_overhead_desc;
$tmdetail->td_hours = $valuehour;
$tmdetail->save();
//error kat sini -> done : typo nama column td_overhead_description
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $overhead)
->where('tm_phase', $request->phase)
->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_overhead_hrs = $sumdetailhour;
$checktotalhours->tm_overhead_days = $sumdetailhour/8.0;
$checktotalhours->update();
// return redirect::to('mobile/profile');
return redirect()->route('timesheet::dashboard.overheadForm', ['phase' => $request->phase, 'month' =>$request->month,'year',$request->year])->with('success', 'Timesheet Updated');
}
public function senaraiOverhead()
{
$overhead = Overhead::all();
$overheads = [];
foreach ($overhead as $key => $value) {
$overheads[] = [
'id' => $value->id,
'lkp_overhead' => $value->o_overhead_desc,
'status' => $value->o_overhead_sts,
];
}
return view('timesheet::dashboard.senaraiOverhead', compact('overheads'));
}
public function penambahanOverhead()
{
return view('timesheet::dashboard.penambahanOverhead');
}
public function addoverheadlookup(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$data = new Overhead;
$data->o_overhead_desc = $request->overheadlookup;
$data->o_overhead_sts = $request->status;
$data->updated_by = $userId;
$data->save();
return redirect()->route('timesheet::dashboard.senaraiOverhead')
->with('success', 'Role Updated');
} }
public function timesheetApproval() public function timesheetApproval()
...@@ -1182,14 +91,5 @@ class DashboardController extends Controller ...@@ -1182,14 +91,5 @@ class DashboardController extends Controller
} }
public function loadstaff($dept)
{
$staffs = Staff_info::where('fk_lkp_department',$dept)
->where('status', 1)
->get();
return view('timesheet::ajax.senaraistaff', compact('staffs'));
}
}
}
\ No newline at end of file
<?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;
class FormController extends Controller
{
public function chargeableForm(Request $request)
{
$chargeable = 1;
$userId = users::find(Auth::id())
->u_staffID;
// dd($userId);
$project = Pteam::where('pt_staff_id',$userId)
->where('pt_project_type', $chargeable)
->get();
$projectlist = [];
// nanti project code query dari table project:
foreach ($project as $key => $value) {
$projectlist[] = [
'td_project' => $value->fk_project_id,
'td_project_code' => $value->toProject->p_project_code,
'td_project_name' => $value->toProject->p_project_description,
];
}
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y');
$day = date('j');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
//kalau ada, dia gi ke edit
if($check)
{
$hour = Ts_detail::where('fk_tm_id',$check->id)
// ->with('project:p_project_code')
->get();
// dd($hour);
}
//klu xde g create.php
else
{
$hour = null;
}
return view('timesheet::form.chargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour'));
}
public function savechargeablehours(Request $request)
{
// chargeable, project type 1.
$chargeable = 1;
$userId = users::find(Auth::id())
->u_staffID;
// check table master. untuk total chargeable hours.
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if($check)
{
}
// kalau takda, save() baru.
else
{
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
// $check ->tm_chargeable_hrs = ;
$check->save();
}
$tmasterid = $check->id;
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail = $request->hour;
foreach ($detail as $key => $value)
{
foreach ($value as $keyday => $day)
{
$projectid = $key;
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('td_project', $projectid)
->where('td_project_type', $chargeable)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
$valuehour = $day;
if($valuehour == null)
{
$valuehour = 0;
}
if($checkTimesheetDetail)
{
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
} //kalau takde, isi semua.
else
{
//isi semua
$tmdetail = new Ts_detail;
$tmdetail->td_date = $date;
$tmdetail->td_project = $projectid;
$tmdetail->fk_tm_id = $tmasterid;
$tmdetail->tm_staff_id = $userId;
$tmdetail->tm_month = $check->tm_month;
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $chargeable;
$project = Project::where('id', $projectid)
->first();
$tmdetail->td_project_name = $project->p_project_description;
$tmdetail->td_hours = $valuehour;
$tmdetail->updated_by = $userId;
$tmdetail->save();
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $chargeable)
->where('tm_phase', $request->phase)
->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_chargeable_hrs = $sumdetailhour;
$checktotalhours->tm_chargeable_days = $sumdetailhour/8.0;
$checktotalhours->update();
// return redirect::to('mobile/profile');
return redirect()->route('timesheet::form.chargeableForm', ['phase' => $request->phase, 'month' =>$request->month,'year',$request->year])->with('success', 'Timesheet Updated');
}
public function nonChargeableForm(Request $request)
{
$nonchargeable = 2;
$userId = users::find(Auth::id())
->u_staffID;
$nonchargeables = Project::where('p_project_type', $nonchargeable)
->get();
$project = Pteam::where('pt_staff_id',$userId)
->where('pt_project_type', $nonchargeable)
->get();
$projectlist = [];
// nanti project code query dari table project:
foreach ($project as $key => $value) {
$projectlist[] = [
'td_project' => $value->fk_project_id,
'td_project_name' => $value->toProject->p_project_description,
];
}
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y');
$day = date('j');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
//kalau ada, dia gi ke edit
if($check)
{
$hour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $nonchargeable)
// ->with('project:p_project_code')
->get();
// dd($hour);
}
//klu xde g create.php
else
{
$hour = null;
}
return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour','nonchargeables'));
}
public function addnonchargeabletask(Request $request)
{
$nonchargeable = 2;
$user = Users::select('name','u_staffID')
->where('id',Auth::id())
->first();
if ($request->chargeableProject != null && $request->nonChargeableProject == null) {
// dd('select only');
$project = Project::where('id', $request->chargeableProject)
->first();
$data = new Pteam;
$data->fk_project_id = $request->chargeableProject;
$data->pt_project_description = $project->p_project_description;
$data->pt_team = $user->name;
$data->pt_staff_id = $user->u_staffID;
$data->pt_project_task_sts = $request->status;
$data->updated_by = $user->u_staffID;
$data->pt_project_type = $nonchargeable;
$data->save();
}else if ($request->chargeableProject != null && $request->nonChargeableProject != null) {
// dd('select and input');
$project = Project::where('id', $request->chargeableProject)
->first();
$select = new Pteam;
$select->fk_project_id = $request->chargeableProject;
$select->pt_project_description = $project->p_project_description;
$select->pt_team = $user->name;
$select->pt_staff_id = $user->u_staffID;
$select->pt_project_task_sts = $request->status;
$select->updated_by = $user->u_staffID;
$select->pt_project_type = $nonchargeable;
$select->save();
$task = new Project;
$task->p_project_description = $request->nonChargeableProject;
$task->pt_project_type = $nonchargeable;
$task->p_project_sts = $request->status;
$task->updated_by = $user->u_staffID;
$task->save();
$taskId = Project::select('id')
->where('p_project_description', $request->nonChargeableProject)
->first();
// dd($taskId->id);
$pt = new Pteam;
$pt->pt_project_description = $request->nonChargeableProject;
$pt->fk_project_id = $taskId->id;
$pt->pt_team = $user->name;
$pt->pt_staff_id = $user->u_staffID;
$pt->pt_project_task_sts = $request->status;
$pt->updated_by = $user->u_staffID;
$pt->pt_project_type = $nonchargeable;
$pt->save();
}else if ($request->chargeableProject == null && $request->nonChargeableProject != null) {
// dd('input ja');
$task = new Project;
$task->p_project_description = $request->nonChargeableProject;
$task->p_project_type = $nonchargeable;
$task->p_project_sts = $request->status;
$task->updated_by = $user->u_staffID;
$task->save();
$taskId = Project::select('id')
->where('p_project_description', $request->nonChargeableProject)
->first();
// dd($taskId->id);
$pt = new Pteam;
$pt->pt_project_description = $request->nonChargeableProject;
$pt->fk_project_id = $taskId->id;
$pt->pt_team = $user->name;
$pt->pt_staff_id = $user->u_staffID;
$pt->pt_project_task_sts = $request->status;
$pt->updated_by = $user->u_staffID;
$pt->pt_project_type = $nonchargeable;
$pt->save();
} else {
return redirect()->route('timesheet::form.nonChargeableForm')->withErrors('You did not select any task or enter any input!');
}
return redirect()->route('timesheet::form.nonChargeableForm')->withSuccess('Successfully Added New Task');
}
public function savenonchargeablehours(Request $request)
{
// chargeable, project type 1.
$nonchargeable = 2;
$userId = users::find(Auth::id())
->u_staffID;
// dd($request->phase);
// check table master. untuk total chargeable hours.
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
// dd($check);
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if($check)
{
// dd('tmaster dah ada');
}
// kalau takda, save() baru.
else
{
// dd('null, gi sini');
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
$check->save();
}
$tmasterid = $check->id;
// dd($tmasterid);
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail = $request->hour;
foreach ($detail as $key => $value)
{
foreach ($value as $keyday => $day)
{
$projectid = $key;
// dd($projectid);
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('td_project', $projectid)
->where('td_project_type', $nonchargeable)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
$valuehour = $day;
if($valuehour == null)
{
$valuehour = 0;
}
if($checkTimesheetDetail)
{
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
} //kalau takde, isi semua.
else
{
//isi semua
$tmdetail = new Ts_detail;
$tmdetail->td_date = $date;
$tmdetail->td_project = $projectid;
$tmdetail->fk_tm_id = $tmasterid;
$tmdetail->tm_staff_id = $userId;
$tmdetail->tm_month = $check->tm_month;
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $nonchargeable;
$project = Project::where('id', $projectid)
->first();
$tmdetail->td_project_name = $project->p_project_description;
$tmdetail->td_hours = $valuehour;
$tmdetail->updated_by = $userId;
$tmdetail->save();
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $nonchargeable)
->where('tm_phase', $request->phase)
->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_nonchargeable_hrs = $sumdetailhour;
$checktotalhours->tm_nonchargeable_days = $sumdetailhour/8.0;
$checktotalhours->update();
// return redirect::to('mobile/profile');
return redirect()->route('timesheet::form.nonChargeableForm', ['phase' => $request->phase, 'month' =>$request->month,'year',$request->year])->with('success', 'Timesheet Updated');
}
public function overheadForm(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$project = Overhead::where('o_overhead_sts',1)
->get();
$projectlist = [];
// nanti project code query dari table project:
foreach ($project as $key => $value) {
$projectlist[] = [
'td_project' => $value->id,
'td_project_name' => $value->o_overhead_desc,
];
}
//sample dulu
$phase = 1;
$month = date('n');
$year = date('Y');
$day = date('j');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$daymonth=cal_days_in_month(CAL_GREGORIAN,$month,$year);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $year)
->where('tm_month', $month)
->where('tm_phase', $phase)
->first();
//kalau ada, dia gi ke edit
if($check)
{
$hour = Ts_detail::where('fk_tm_id',$check->id)
// ->with('project:p_project_code')
->get();
// dd($hour);
}
//klu xde g create.php
else
{
$hour = null;
}
return view('timesheet::form.overheadForm', compact('projectlist','userId','month','phase','daymonth','year','day','hour', 'project'));
}
public function saveoverheadhours(Request $request)
{
// overhead, project type 3.
$overhead = 3;
$userId = users::find(Auth::id())
->u_staffID;
// check table master. untuk total chargeable hours.
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if($check)
{
}
// kalau takda, save() baru.
else
{
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
// $check ->tm_chargeable_hrs = ;
$check->save();
}
$tmasterid = $check->id;
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail = $request->hour;
foreach ($detail as $key => $value)
{
foreach ($value as $keyday => $day)
{
$projectid = $key;
$date = $request->year.'-'.$request->month.'-'.sprintf('%02d', $keyday);
$checkTimesheetDetail = Ts_detail::where('fk_o_id', $projectid)
// ->where('td_project_type', $project_type)
->where('td_date', $date)
->where('tm_phase', $request->phase)
->first();
$valuehour = $day;
if($valuehour == null)
{
$valuehour = 0;
}
if($checkTimesheetDetail)
{
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
} //kalau takde, isi semua.
else
{
//isi semua
$tmdetail = new Ts_detail;
$tmdetail->td_date = $date;
$tmdetail->fk_o_id = $projectid;
$tmdetail->fk_tm_id = $tmasterid;
$tmdetail->tm_staff_id = $userId;
$tmdetail->tm_month = $check->tm_month;
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $overhead;
$tmdetail->updated_by = $userId;
$project = Overhead::where('id', $projectid)
->first();
$tmdetail->td_overhead_desc = $project->o_overhead_desc;
$tmdetail->td_hours = $valuehour;
$tmdetail->save();
//error kat sini -> done : typo nama column td_overhead_description
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour = Ts_detail::where('td_project_type', $overhead)
->where('tm_phase', $request->phase)
->sum('td_hours');
// checktotalhours
$checktotalhours = Ts_master::where('id', $tmasterid)->first();
$checktotalhours->tm_overhead_hrs = $sumdetailhour;
$checktotalhours->tm_overhead_days = $sumdetailhour/8.0;
$checktotalhours->update();
// return redirect::to('mobile/profile');
return redirect()->route('timesheet::form.overheadForm', ['phase' => $request->phase, 'month' =>$request->month,'year',$request->year])->with('success', 'Timesheet Updated');
}
public function addOverheadDescription(Request $request)
{
$overhead = 3;
$userId = Users::find(Auth::id())
->u_staffID;
$check = Ts_master::where('tm_staff_id', $userId)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->first();
if($check) {
} else {
$check = new Ts_master;
$check->tm_staff_id = $userId;
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->updated_by = $userId;
$check->save();
}
$tmasterid = $check->id;
$checkTimesheetDetail = Ts_detail::where('td_date', $request->date)
->where('td_overhead_desc', $request->task)
->where('tm_year', $request->year)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->where('tm_staff_id', $userId)
->first();
if($checkTimesheetDetail){
dd('ada, update column');
$checkTimesheetDetail->td_overhead_note = $request->description;
$checkTimesheetDetail->update();
} else {
$pname = Overhead::where('o_overhead_desc', $request->description)
->first();
dd($pname);
$data = new Ts_detail;
$data->td_date = $request->date;
$data->fk_o_id = $pname->id;
$data->fk_tm_id = $tmasterid;
$data->tm_staff_id = $userId;
$data->tm_month = $request->tm_month;
$data->tm_year = $request->tm_year;
$data->tm_phase = $request->tm_phase;
$data->td_project_type = $overhead;
$data->updated_by = $userId;
$data->td_overhead_desc = $request->description;
$data->save();
}
// $data = Ts_detail::where('td_date', $request->date)
// ->where('')
// $data = new ODesc;
}
}
\ No newline at end of file
<?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;
class MaintenanceController extends Controller
{
public function senaraiProject()
{
$chargeable = 1;
$project = Project::where('p_project_type', $chargeable)
->get();
$projectlist = [];
// nanti project code query dari table project:
if(count($project) > 0) {
foreach ($project as $key => $value){
$pm = Pteam::where('fk_project_id', $value->id)
->where('role_id', 1)
->where('pt_project_task_sts', 1)
->first();
// dd($pm->pt_team);
$projectlist[] = [
'id' => $value->id,
'projectcode' => $value->p_project_code,
'projectname' => $value->p_project_description,
'projectmanager' => $pm->pt_team,
'status' => $value->p_project_sts,
];
}
}
else
{
$projectlist = [];
}
return view('timesheet::maintenance.senaraiProject',compact('projectlist'));
}
public function penambahanProject()
{
$pms = 4;
$pm = Staff_info::where('flag_pm', 1)
->where('status', 1)
->get();
// dd($pm);
return view('timesheet::maintenance.penambahanProject', compact('pm'));
}
public function addnewproject(Request $request)
{
$chargeable = 1;
$nonchargeable = 2;
$userId = users::find(Auth::id())
->u_staffID;
if ($request->projectcode == null || $request->projectname == null || $request->projectmanager == null) {
return redirect()->route('timesheet::maintenance.penambahanProject')
->withErrors('The information is not complete. Please re-enter!');
} else {
// dd($request);
$project = new Project;
$project->p_project_code = $request->projectcode;
$project->p_project_description = $request->projectname;
$project->p_project_type = $chargeable;
$project->p_project_task_team = $request->projectmanager;
$project->p_project_sts = $request->status;
$project->updated_by = $userId;
$project->save();
$noncharge = new Project;
$noncharge->p_project_description = $request->projectname;
$noncharge->p_project_type = $nonchargeable;
$noncharge->p_project_sts = $request->status;
$noncharge->updated_by = $userId;
$noncharge->save();
$projectId = Project::select('id')
->where('p_project_code', $request->projectcode)
->value('id');
$sname = Staff_info::select('fullname')
->where('staff_id', $request->projectmanager)
->value('fullname');
// dd($projectId);
$team = new Pteam;
$team->role_id = 1;
$team->pt_project_description = $request->projectname;
$team->fk_project_id = $projectId;
$team->pt_staff_id = $request->projectmanager;
$team->pt_team = $sname;
$team->pt_project_type = $chargeable;
$team->pt_project_task_sts = 1;
$team->updated_by = $userId;
$team->save();
}
return redirect()->route('timesheet::maintenance.senaraiProject')
->with('success', 'New Project Added');
}
public function senaraiProjectTeam(Request $request)
{
$chargeable = 1;
$pid = $request->id;
$project = Pteam::where('fk_project_id',$request->id)
->where('pt_project_type', $chargeable)
// ->where('pt_project_task_sts', 1)
->orderBy('pt_project_task_sts', 'DESC')
->orderBy('role_id')
->get();
$projectlist = [];
// dd($projectlistct);
// nanti project code query dari table project:
foreach ($project as $key => $value) {
// dd($value->toRole->role);
$projectlist[] = [
'id' => $value->id,
'projectcode' => $value->toProject->p_project_code,
'projectname' => $value->pt_project_description,
'projectteam' => $value->pt_team,
'role' => $value->toRole->role,
'status' => $value->pt_project_task_sts,
'pid' => $value->fk_project_id,
];
}
return view('timesheet::maintenance.senaraiProjectTeam', compact('projectlist', 'project', 'pid'));
}
public function penambahanProjectTeam(Request $request)
{
$pid = $request->id;
$project = Project::where('id', $request->id)
->first(); //find($request->id);
$departments = Department::all()
->except([7]);
// ->except($departments->code,['']);
foreach ($departments as $key => $value)
{
$staffs = Staff_info::where('fk_lkp_department', $value->id)
->get();
// dd($value->id);
}
$roles = Role::where('status', 1)
->get();
// dd($roles->role);
return view('timesheet::maintenance.penambahanProjectTeam', compact('project', 'departments', 'staffs', 'pid', 'roles'));
}
public function addprojectteam(Request $request)
{
$chargeable = 1;
$userId = users::find(Auth::id())
->u_staffID;
$expstaff = explode(',', $request->staffId);
if ($request->staffId == null || $request->role == null) {
dd($request);
return redirect()->route('timesheet::maintenance.penambahanProjectTeam', ['pcode'=>$request->pcode, 'pname'=>$request->pname, $request->id]);
} else {
foreach ($expstaff as $key => $value)
{
$staff = Staff_info::where('fk_users', $value)
->first();
// dd($request);
$pt = new Pteam;
$pt->fk_project_id = $request->pid;
$pt->pt_project_description = $request->pname;
$pt->pt_team = $staff->fullname;
$pt->pt_staff_id = $staff->staff_id;
// $pt->pt_staff_id = $value;
$pt->pt_project_task_sts = $request->status;
$pt->role_id = $request->role;
$pt->updated_by = $userId;
$pt->pt_project_type = $chargeable;
$pt->save();
}
}
return redirect()->route('timesheet::maintenance.senaraiProject')
->with('success', 'Project Team Added Successfully');
}
public function editprojectteam(Request $request)
{
$team = Pteam::where('id', $request->id)
->first();
$teamRole = Role::where('id', $team->role_id)
->first();
// dd($team);
$role = Role::all();
// dd($role);
$pid = $team->fk_project_id;
return view('timesheet::maintenance.editprojectteam', compact('team', 'pid', 'role', 'teamRole'));
}
public function updateprojectteam(Request $request)
{
$pid = $request->pid;
$userId = users::find(Auth::id())
->u_staffID;
// dd($request);
$team = Pteam::where('id', $request->id)->first();
$team->pt_project_task_sts = $request->status;
$team->role_id = $request->role;
$team->updated_by = $userId;
// letak query utk update role
// $team->pt_role = $request->role;
$team->update();
// $project = Pteam::where('fk_project_id',$request->pid)
// ->get();
// $projectlist = [];
// foreach ($project as $key => $value) {
// $projectlist[] = [
// 'id' => $value->id,
// 'projectcode' => $value->toProject->p_project_code,
// 'projectname' => $value->pt_project_description,
// 'projectteam' => $value->pt_team,
// 'status' => $value->pt_project_task_sts,
// ];
// }
return redirect()->route('timesheet::maintenance.senaraiProjectTeam', ['id' => $pid])
->with('success', 'Project Team Edited Successfully');;
}
public function senaraiPeranan()
{
$peranan = Role::all();
$roles = [];
foreach ($peranan as $key => $value) {
$roles[] = [
'id' => $value->id,
'role' => $value->role,
'status' => $value->status
];
}
return view('timesheet::maintenance.senaraiPeranan', compact('roles'));
}
public function penambahanPeranan()
{
return view('timesheet::maintenance.penambahanPeranan');
}
public function addrole(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$data = new Role;
$data->role = $request->role;
$data->status = $request->status;
$data->updated_by = $userId;
$data->save();
return redirect()->route('timesheet::maintenance.senaraiPeranan')
->with('success', 'Role Added Successfully');
}
public function editPeranan(Request $request)
{
$role = Role::where('id', $request->id)
->first();
if ($role->status == 1) {
$status = 'Active';
} else {
$status = 'Inactive';
}
return view('timesheet::maintenance.editPeranan', compact('role', 'status'));
}
public function updaterole(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$data = Role::where('id', $request->id)
->first();
$data->role = $request->role;
$data->status = $request->status;
$data->updated_by = $userId;
$data->update();
return redirect()->route('timesheet::maintenance.senaraiPeranan')
->with('success', 'Role Updated Successfully');
}
public function senaraiOverhead()
{
$overhead = Overhead::all();
$overheads = [];
foreach ($overhead as $key => $value) {
$overheads[] = [
'id' => $value->id,
'lkp_overhead' => $value->o_overhead_desc,
'status' => $value->o_overhead_sts,
];
}
return view('timesheet::maintenance.senaraiOverhead', compact('overheads'));
}
public function penambahanOverhead()
{
return view('timesheet::maintenance.penambahanOverhead');
}
public function addoverheadlookup(Request $request)
{
$userId = users::find(Auth::id())
->u_staffID;
$data = new Overhead;
$data->o_overhead_desc = $request->overheadlookup;
$data->o_overhead_sts = $request->status;
$data->updated_by = $userId;
$data->save();
return redirect()->route('timesheet::maintenance.senaraiOverhead')
->with('success', 'Role Updated');
}
public function loadstaff($dept)
{
$staffs = Staff_info::where('fk_lkp_department',$dept)
->where('status', 1)
->get();
return view('timesheet::ajax.senaraistaff', compact('staffs'));
}
}
\ No newline at end of file
...@@ -54,7 +54,7 @@ class ServiceProvider extends BaseServiceProvider ...@@ -54,7 +54,7 @@ class ServiceProvider extends BaseServiceProvider
$dashboard->add(__('Halaman Utama'), url('/home/')) $dashboard->add(__('Halaman Utama'), url('/home/'))
->data('icon', 'tachometer alternate icon') ->data('icon', 'tachometer alternate icon')
->active('home/*'); ->active('home/*');
$dashboard->add(__('Timesheet Calendar'), route('timesheet::dashboard.kalendar')) $dashboard->add(__('Timesheet Calendar'), route('timesheet::kalendar.kalendar'))
->data('icon', 'calendar alternate outline') ->data('icon', 'calendar alternate outline')
->active('kalendar/*') ->active('kalendar/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
...@@ -76,35 +76,27 @@ class ServiceProvider extends BaseServiceProvider ...@@ -76,35 +76,27 @@ class ServiceProvider extends BaseServiceProvider
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$pengurusanProject = $this->app['laravolt.menu']->add(__('Pengurusan Project'))->data('icon', 'align justify'); $pengurusanProject = $this->app['laravolt.menu']->add(__('Pengurusan Project'))->data('icon', 'align justify');
$pengurusanProject->add(__('Senarai Project'), route('timesheet::dashboard.senaraiProject')) $pengurusanProject->add(__('Senarai Project'), route('timesheet::maintenance.senaraiProject'))
->data('icon', 'users icon') ->data('icon', 'users icon')
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Penambahan Project'), route('timesheet::dashboard.penambahanProject')) $pengurusanProject->add(__('Penambahan Project'), route('timesheet::maintenance.penambahanProject'))
->data('icon', 'users icon')
->active('pengurusan/*')
->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Senarai Project Team'))
->data('icon', 'users icon') ->data('icon', 'users icon')
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Penambahan Project Team')) $pengurusanProject->add(__('Senarai Overhead'), route('timesheet::maintenance.senaraiOverhead'))
->data('icon', 'users icon')
->active('pengurusan/*')
->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Senarai Overhead'), route('timesheet::dashboard.senaraiOverhead'))
->data('icon', 'users icon') ->data('icon', 'users icon')
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Penambahan Overhead'), route('timesheet::dashboard.penambahanOverhead')) $pengurusanProject->add(__('Penambahan Overhead'), route('timesheet::maintenance.penambahanOverhead'))
->data('icon', 'users icon') ->data('icon', 'users icon')
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Senarai Peranan'), route('timesheet::dashboard.senaraiPeranan')) $pengurusanProject->add(__('Senarai Peranan'), route('timesheet::maintenance.senaraiPeranan'))
->data('icon', 'users icon') ->data('icon', 'users icon')
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
$pengurusanProject->add(__('Penambahan Peranan'), route('timesheet::dashboard.penambahanPeranan')) $pengurusanProject->add(__('Penambahan Peranan'), route('timesheet::maintenance.penambahanPeranan'))
->data('icon', 'users icon') ->data('icon', 'users icon')
->active('pengurusan/*') ->active('pengurusan/*')
->data('permission', Permission::pengurusan); ->data('permission', Permission::pengurusan);
...@@ -120,23 +112,23 @@ class ServiceProvider extends BaseServiceProvider ...@@ -120,23 +112,23 @@ class ServiceProvider extends BaseServiceProvider
// ->data('permission', Permission::kehadiran); // ->data('permission', Permission::kehadiran);
$form = $this->app['laravolt.menu']->add(__('Borang'))->data('icon', 'align justify'); $form = $this->app['laravolt.menu']->add(__('Borang'))->data('icon', 'align justify');
$form->add(__('Borang Chargeable'), url('/chargeableForm/')) $form->add(__('Borang Chargeable'), route('timesheet::form.chargeableForm'))
->data('icon', 'circle outline') ->data('icon', 'circle outline')
->active('chargeableForm/*') ->active('chargeableForm/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$form->add(__('Borang Non-Chargeable'), route('timesheet::dashboard.nonChargeableForm')) $form->add(__('Borang Non-Chargeable'), route('timesheet::form.nonChargeableForm'))
->data('icon', 'circle outline') ->data('icon', 'circle outline')
->active('nonChargeableForm/*') ->active('nonChargeableForm/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$form->add(__('Borang Overhead'), route('timesheet::dashboard.overheadForm')) $form->add(__('Borang Overhead'), route('timesheet::form.overheadForm'))
->data('icon', 'circle outline') ->data('icon', 'circle outline')
->active('overheadForm/*') ->active('overheadForm/*')
->data('permission', Permission::kehadiran); ->data('permission', Permission::kehadiran);
$calendar = $this->app['laravolt.menu']->add(__('Kalendar'))->data('icon', 'calendar alternate'); $calendar = $this->app['laravolt.menu']->add(__('Kalendar'))->data('icon', 'calendar alternate');
$calendar->add(__('Kalendar'), route('timesheet::dashboard.kalendar')) $calendar->add(__('Kalendar'), route('timesheet::kalendar.kalendar'))
->data('icon', 'calendar alternate outline') ->data('icon', 'calendar alternate outline')
->active('kalendar/*') ->active('kalendar/*')
->data('permission', Permission::calendar ); ->data('permission', Permission::calendar );
...@@ -145,15 +137,5 @@ class ServiceProvider extends BaseServiceProvider ...@@ -145,15 +137,5 @@ class ServiceProvider extends BaseServiceProvider
// ->data('icon', 'circle outline') // ->data('icon', 'circle outline')
// ->active('quota/*') // ->active('quota/*')
// ->data('permission', Permission::MAKLUMAT_CUTI); // ->data('permission', Permission::MAKLUMAT_CUTI);
// $pengurusan = $this->app['laravolt.menu']->add(__('Pengurusan'))->data('icon', 'align justify');
// $pengurusan->add(__('Pengurusan Peranan'), route('timesheet::dashboard.pengurusan'))
// ->data('icon', 'users icon')
// ->active('pengurusan/*')
// ->data('permission', Permission::pengurusan);
// $pengurusan->add(__('Perkhidmatan'), url('/perkhidmatan/'))
// ->data('icon', 'handshake icon')
// ->active('perkhidmatan/*')
// ->data('permission', Permission::perkhidmatan);
} }
} }
\ 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