Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 8 |
CRAP | |
0.00% |
0 / 23 |
| HolidayCalendarController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 8 |
72 | |
0.00% |
0 / 23 |
| index | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 8 |
|||
| create | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| store | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
|||
| getHolidayListYearWise | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
|||
| show | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| edit | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| update | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| destroy | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace App\Http\Controllers\HolidayCalendar; | |
| use Illuminate\Http\Request; | |
| use App\Http\Controllers\Controller; | |
| use App\Models\Admin\Holiday; | |
| use App\Helpers\HolidayHelper; | |
| use Illuminate\Support\Facades\Auth; | |
| use DB; | |
| use Carbon\Carbon; | |
| use App\Helpers\AttendanceHelper; | |
| class HolidayCalendarController extends Controller | |
| { | |
| /** | |
| * Display a listing of the resource. | |
| * | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function index(Request $request) | |
| { | |
| $title = '/Holidays Calendar'; | |
| $userid = Auth::user()->id; | |
| $holidayIds = HolidayHelper::getholidayList($userid); | |
| $holidays = $this->getHolidayListYearWise(Carbon::now(config('settings.time_zone'))->format('Y'),$holidayIds); //dd($holidays); | |
| // For returning attendance marking for home controller | |
| $val = AttendanceHelper::getAttendanceMarkValue(); | |
| $valTeam = AttendanceHelper::getAttendanceTeam($request); | |
| $valUser = AttendanceHelper::getAttendanceUser($request); | |
| return view('holiday.HolidayCalendar', compact('title','val','valTeam','valUser'))->with('holidays',$holidays); | |
| } | |
| /** | |
| * Show the form for creating a new resource. | |
| * | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function create() | |
| { | |
| // | |
| } | |
| /** | |
| * Store a newly created resource in storage. | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function store(Request $request) | |
| { | |
| $userid = Auth::user()->id; | |
| $holidayIds = HolidayHelper::getholidayList($userid); | |
| $holidayListColl = $this->getHolidayListYearWise($request->year,$holidayIds); | |
| return view('holiday.SelectedDateTable')->with('holidayListColl', $holidayListColl); | |
| } | |
| public function getHolidayListYearWise($year,$holidayIds) | |
| { | |
| $query = Holiday::query(); | |
| $query->whereYear('date', '=',$year); | |
| $query->whereIn('id',$holidayIds); | |
| $query->orderBy('date', 'asc'); | |
| $holidayList = $query->get(); //dd($holidayList); | |
| return collect($holidayList); | |
| } | |
| /** | |
| * Display the specified resource. | |
| * | |
| * @param int $id | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function show($id) | |
| { | |
| } | |
| /** | |
| * Show the form for editing the specified resource. | |
| * | |
| * @param int $id | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function edit($id) | |
| { | |
| // | |
| } | |
| /** | |
| * Update the specified resource in storage. | |
| * | |
| * @param \Illuminate\Http\Request $request | |
| * @param int $id | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function update(Request $request, $id) | |
| { | |
| } | |
| /** | |
| * Remove the specified resource from storage. | |
| * | |
| * @param int $id | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function destroy($id) | |
| { | |
| // | |
| } | |
| } |