This commit is contained in:
Truong Vo 2024-08-09 14:13:06 +07:00
parent 5703804e5c
commit 1057eec8c0
2 changed files with 33 additions and 3 deletions

View File

@ -290,6 +290,7 @@ class TicketController extends Controller
// Send notification email to users
if ($action == "confirm") {
dd($results);
foreach ($results as $result) {
list($year, $month, $day) = explode('-', $result['date']);
Notes::create([
@ -301,6 +302,37 @@ class TicketController extends Controller
'n_reason' => $ticket->type,
'n_note' => $ticket->reason
]);
if($ticket->type == "WFH"){
// $user_ids = $request->users;
// $year = $request->year;
// $month = $request->month;
// $day = $request->day;
// $type = $request->type;
// foreach ($user_ids as $id) {
// $user = Admin::find($id);
// $date = Carbon::create($year, $month, $day)->setTimezone(env('TIME_ZONE'));
// $start = $date->copy()->setTime(7, 31, 11);
// $end = $type == 'half' ? $date->copy()->setTime(11, 31, 11) : $date->copy()->setTime(17, 1, 11);
// Tracking::insert([
// [
// 'name' => $user->name,
// 'user_id' => $user->id,
// 'status' => 'check in',
// 'time_string' => $start->format('Y-m-d H:i:s'),
// 'created_at' => $start->setTimezone('UTC')
// ],
// [
// 'name' => $user->name,
// 'user_id' => $user->id,
// 'status' => 'check out',
// 'time_string' => $end->format('Y-m-d H:i:s'),
// 'created_at' => $end->setTimezone('UTC')
// ]
// ]);
// }
// $this->createOrUpdateRecordForCurrentMonth($month, $year);
}
}
$ticket['updated_by'] = $admin->name;

View File

@ -10,7 +10,6 @@ import {
import { update, Xdelete } from '@/rtk/helpers/CRUD'
import { get } from '@/rtk/helpers/apiService'
import {
Avatar,
Box,
Button,
Drawer,
@ -22,8 +21,7 @@ import {
Text,
Textarea,
TextInput,
Tooltip,
TypographyStylesProvider,
Tooltip
} from '@mantine/core'
import { useDisclosure } from '@mantine/hooks'
import { notifications } from '@mantine/notifications'