Update
This commit is contained in:
@@ -78,6 +78,7 @@ class MemberController extends Controller
|
|||||||
->leftJoin('plans', 'plans.id', '=', 'member_plans.plan_id')
|
->leftJoin('plans', 'plans.id', '=', 'member_plans.plan_id')
|
||||||
->leftJoin('services', 'services.code', '=', 'plans.service_code')
|
->leftJoin('services', 'services.code', '=', 'plans.service_code')
|
||||||
->where('member_plans.member_id', $members->id)
|
->where('member_plans.member_id', $members->id)
|
||||||
|
->whereNull('member_plans.deleted_at')
|
||||||
->select('plans.service_code', 'services.name')
|
->select('plans.service_code', 'services.name')
|
||||||
->get();
|
->get();
|
||||||
$res_data['services'] = $services;
|
$res_data['services'] = $services;
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ use Illuminate\Support\Facades\DB;
|
|||||||
|
|
||||||
class NotificationController extends Controller
|
class NotificationController extends Controller
|
||||||
{
|
{
|
||||||
public function getNotifications(Request $request, $hospital_id)
|
public function getNotifications(Request $request, $user_id)
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'hospital_id' => $hospital_id,
|
'user_id' => $user_id,
|
||||||
];
|
];
|
||||||
if (!$hospital_id)
|
if (!$user_id)
|
||||||
{
|
{
|
||||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,8 @@ class NotificationController extends Controller
|
|||||||
DB::raw('DATE_FORMAT(notifications.created_at, "%Y-%m-%dT%H:%i:%s.000+07:00") as createdAt'),
|
DB::raw('DATE_FORMAT(notifications.created_at, "%Y-%m-%dT%H:%i:%s.000+07:00") as createdAt'),
|
||||||
'notifications.isUnRead',
|
'notifications.isUnRead',
|
||||||
)
|
)
|
||||||
->where('hospital_id', '=', $hospital_id)
|
->where('user_id', '=', $user_id)
|
||||||
|
->orderBy('id', 'DESC')
|
||||||
->get();
|
->get();
|
||||||
$res_data['notifications'] = $notifications;
|
$res_data['notifications'] = $notifications;
|
||||||
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
||||||
@@ -50,15 +51,15 @@ class NotificationController extends Controller
|
|||||||
public function setReadNotification(Request $request)
|
public function setReadNotification(Request $request)
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'hospital_id' => $request->hospital_id,
|
'user_id' => $request->user_id,
|
||||||
'id' => $request->id,
|
'id' => $request->id,
|
||||||
'isUnRead'=> 0,
|
'isUnRead'=> 0,
|
||||||
];
|
];
|
||||||
$validator = Validator::make($request->all(), [
|
$validator = Validator::make($request->all(), [
|
||||||
'hospital_id' => 'required',
|
'user_id' => 'required',
|
||||||
'id' => 'required'
|
'id' => 'required'
|
||||||
], [
|
], [
|
||||||
'hospital_id.required' => trans('Validation.required',['attribute' => 'Hospital ID']),
|
'user_id.required' => trans('Validation.required',['attribute' => 'Hospital ID']),
|
||||||
'id.required' => trans('Validation.required',['attribute' => 'ID']),
|
'id.required' => trans('Validation.required',['attribute' => 'ID']),
|
||||||
]);
|
]);
|
||||||
if ($validator->fails())
|
if ($validator->fails())
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ use App\Helpers\Helper;
|
|||||||
use App\Models\File;
|
use App\Models\File;
|
||||||
use Dompdf\Dompdf;
|
use Dompdf\Dompdf;
|
||||||
use Dompdf\Options;
|
use Dompdf\Options;
|
||||||
|
use Illuminate\Support\Facades\View;
|
||||||
|
|
||||||
class RequestLogController extends Controller
|
class RequestLogController extends Controller
|
||||||
{
|
{
|
||||||
@@ -107,6 +108,33 @@ class RequestLogController extends Controller
|
|||||||
|
|
||||||
if($response->original['statusCode'] == 200)
|
if($response->original['statusCode'] == 200)
|
||||||
{
|
{
|
||||||
|
//send email
|
||||||
|
// Insert data notifications
|
||||||
|
$emailTo = 'alarm.center@linksehat.com';
|
||||||
|
$dataNotif = [
|
||||||
|
'email' => $emailTo,
|
||||||
|
'title' => 'Request LOG',
|
||||||
|
'description' => 'Request LOG from Hospital Portal',
|
||||||
|
'type' => 1,
|
||||||
|
'isUnRead' => true,
|
||||||
|
'created_by' => auth()->user()->id,
|
||||||
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
|
'updated_at' => date('Y-m-d H:i:s'),
|
||||||
|
];
|
||||||
|
$sendNotif = Helper::insertNotification($dataNotif);
|
||||||
|
// Send Email after insert notifications
|
||||||
|
if($sendNotif)
|
||||||
|
{
|
||||||
|
//send to alarm
|
||||||
|
$nameTo = 'Admin LinkSehat';
|
||||||
|
$dataEmail = [
|
||||||
|
'email' => $emailTo,
|
||||||
|
'name' => $nameTo,
|
||||||
|
'subject' => 'Request LOG from Hospital Portal'. ' '.date('Y-m-d H:i:s'),
|
||||||
|
'body' => View::make('email/notif_email', ['name' => $nameTo, 'link' => 'https://primecenter.linksehat.com/'])->render(),
|
||||||
|
];
|
||||||
|
Helper::sendEmail($dataEmail);
|
||||||
|
}
|
||||||
return ApiResponse::apiResponse("Success", $data, trans('Message.success'), 200);
|
return ApiResponse::apiResponse("Success", $data, trans('Message.success'), 200);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -352,6 +380,33 @@ class RequestLogController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
//send email
|
||||||
|
// Insert data notifications
|
||||||
|
$emailTo = 'alarm.center@linksehat.com';
|
||||||
|
$dataNotif = [
|
||||||
|
'email' => $emailTo,
|
||||||
|
'title' => 'Request Final LOG',
|
||||||
|
'description' => 'Request Final LOG from Hospital Portal',
|
||||||
|
'type' => 1,
|
||||||
|
'isUnRead' => true,
|
||||||
|
'created_by' => auth()->user()->id,
|
||||||
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
|
'updated_at' => date('Y-m-d H:i:s'),
|
||||||
|
];
|
||||||
|
$sendNotif = Helper::insertNotification($dataNotif);
|
||||||
|
// Send Email after insert notifications
|
||||||
|
if($sendNotif)
|
||||||
|
{
|
||||||
|
//send to alarm
|
||||||
|
$nameTo = 'Admin LinkSehat';
|
||||||
|
$dataEmail = [
|
||||||
|
'email' => $emailTo,
|
||||||
|
'name' => $nameTo,
|
||||||
|
'subject' => 'Request Final LOG from Hospital Portal'. ' '.date('Y-m-d H:i:s'),
|
||||||
|
'body' => View::make('email/notif_email', ['name' => $nameTo, 'link' => 'https://primecenter.linksehat.com/'])->render(),
|
||||||
|
];
|
||||||
|
Helper::sendEmail($dataEmail);
|
||||||
|
}
|
||||||
return ApiResponse::apiResponse('Success', $data, trans('Message.success'), 200);
|
return ApiResponse::apiResponse('Success', $data, trans('Message.success'), 200);
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {
|
catch (\Exception $e) {
|
||||||
@@ -370,6 +425,7 @@ class RequestLogController extends Controller
|
|||||||
$dataMember = DB::table('members')
|
$dataMember = DB::table('members')
|
||||||
->where('members.id', '=', $dataRequestLog->member_id)
|
->where('members.id', '=', $dataRequestLog->member_id)
|
||||||
->select(
|
->select(
|
||||||
|
'members.nric',
|
||||||
'members.id',
|
'members.id',
|
||||||
'members.principal_id',
|
'members.principal_id',
|
||||||
'members.name',
|
'members.name',
|
||||||
@@ -517,6 +573,7 @@ class RequestLogController extends Controller
|
|||||||
$dataMember = DB::table('members')
|
$dataMember = DB::table('members')
|
||||||
->where('members.id', '=', $dataRequestLog->member_id)
|
->where('members.id', '=', $dataRequestLog->member_id)
|
||||||
->select(
|
->select(
|
||||||
|
'members.nric',
|
||||||
'members.id',
|
'members.id',
|
||||||
'members.principal_id',
|
'members.principal_id',
|
||||||
'members.name',
|
'members.name',
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Route::prefix('v1')->group(function() {
|
|||||||
//Notification
|
//Notification
|
||||||
Route::controller(NotificationController::class)->group(function() {
|
Route::controller(NotificationController::class)->group(function() {
|
||||||
//get notifications
|
//get notifications
|
||||||
Route::get('notifications/{hospital_id}', 'getNotifications');
|
Route::get('notifications/{user_id}', 'getNotifications');
|
||||||
//Set read notification
|
//Set read notification
|
||||||
Route::post('set-read-notification', 'setReadNotification');
|
Route::post('set-read-notification', 'setReadNotification');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -977,8 +977,9 @@ class ClaimController extends Controller
|
|||||||
public function sendNotif($description)
|
public function sendNotif($description)
|
||||||
{
|
{
|
||||||
// Insert data notifications
|
// Insert data notifications
|
||||||
|
$emailTo = 'hospitaladmin@linksehat.com';
|
||||||
$dataNotif = [
|
$dataNotif = [
|
||||||
'hospital_id' => 1,
|
'email' => $emailTo,
|
||||||
'title' => 'Request Document',
|
'title' => 'Request Document',
|
||||||
'description' => 'Please enter the document '.$description,
|
'description' => 'Please enter the document '.$description,
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
@@ -991,12 +992,12 @@ class ClaimController extends Controller
|
|||||||
// Send Email after insert notifications
|
// Send Email after insert notifications
|
||||||
if($sendNotif)
|
if($sendNotif)
|
||||||
{
|
{
|
||||||
//Beluma ada Data Users
|
$nameTo = 'Hospital Admin';
|
||||||
$dataEmail = [
|
$dataEmail = [
|
||||||
'email' => 'akun.kerja.ivan@gmail.com',
|
'email' => $emailTo,
|
||||||
'name' => 'Ivan Julian',
|
'name' => $nameTo,
|
||||||
'subject' => 'Enter Document '.$description,
|
'subject' => 'Enter Document '.$description,
|
||||||
'body' => View::make('email/notif_email', ['name' => 'Ivan Julian', 'link' => 'https://linkmedis.com/chat'])->render(),
|
'body' => View::make('email/notif_email', ['name' => $nameTo, 'link' => 'https://hospitalportal.linksehat.com/dashboard'])->render(),
|
||||||
];
|
];
|
||||||
Helper::sendEmail($dataEmail);
|
Helper::sendEmail($dataEmail);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('notifications', function (Blueprint $table) {
|
||||||
|
// Ubah nama field hospital_id ke user_id dan izinkan nilai null
|
||||||
|
$table->renameColumn('hospital_id', 'user_id')->nullable();
|
||||||
|
|
||||||
|
// Tambahkan field email setelah user_id
|
||||||
|
$table->string('email')->after('hospital_id')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('notifications', function (Blueprint $table) {
|
||||||
|
// Rollback migrasi dengan mengembalikan nama field ke semula
|
||||||
|
$table->renameColumn('user_id', 'hospital_id');
|
||||||
|
|
||||||
|
// Hapus field email
|
||||||
|
$table->dropColumn('email');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -38,5 +38,7 @@
|
|||||||
"txtAddNew" : "Add New",
|
"txtAddNew" : "Add New",
|
||||||
"txtAddress" : "Address",
|
"txtAddress" : "Address",
|
||||||
"txtProvider": "Provider",
|
"txtProvider": "Provider",
|
||||||
"txtAlertProvider" : "Please enter provider"
|
"txtAlertProvider" : "Please enter provider",
|
||||||
|
"txtHelp" : "Need help?",
|
||||||
|
"txtContactUs" : "Contact Us"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,13 +30,15 @@
|
|||||||
"txtSubmissionDate" : "Tanggal Pengajuan",
|
"txtSubmissionDate" : "Tanggal Pengajuan",
|
||||||
"txtDataNotFound" : "Data Tidak Ditemukan",
|
"txtDataNotFound" : "Data Tidak Ditemukan",
|
||||||
"txtConditionDocument" : "Dokumen Kondisi",
|
"txtConditionDocument" : "Dokumen Kondisi",
|
||||||
"txtDiagnosisDokument" : "Dokumen Diagnosa",
|
"txtDiagnosisDokument" : "Dokumen Diagnosis",
|
||||||
"txtSupportingResultDocument" : "Dokumen Hasil Pendukung",
|
"txtSupportingResultDocument" : "Dokumen Pendukung",
|
||||||
"txtAddResult" : "Tambah Hasil",
|
"txtAddResult" : "Tambah Hasil",
|
||||||
"txtServiceType" : "Tipe Layanan",
|
"txtServiceType" : "Tipe Layanan",
|
||||||
"txtAdditionalDocuments" : "Dokumen Tambahan",
|
"txtAdditionalDocuments" : "Dokumen Tambahan",
|
||||||
"txtAddNew" : "Tambah Baru",
|
"txtAddNew" : "Tambah Baru",
|
||||||
"txtAddress" : "Alamat",
|
"txtAddress" : "Alamat",
|
||||||
"txtProvider": "Provider",
|
"txtProvider": "Provider",
|
||||||
"txtAlertProvider" : "Mohon masukan provider"
|
"txtAlertProvider" : "Mohon masukan provider",
|
||||||
|
"txtHelp" : "Butuh Bantuan?",
|
||||||
|
"txtContactUs" : "Kontak Kami"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ function NotificationItem({ notification, getDataNotifications }: { notification
|
|||||||
const {enqueueSnackbar} = useSnackbar();
|
const {enqueueSnackbar} = useSnackbar();
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
const data = {
|
const data = {
|
||||||
'hospital_id' : 1,
|
'user_id' : 1,
|
||||||
'id' : notification.id,
|
'id' : notification.id,
|
||||||
};
|
};
|
||||||
if(notification.isUnRead)
|
if(notification.isUnRead)
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
// @mui
|
// @mui
|
||||||
import { Stack, Button, Typography } from '@mui/material';
|
import { Stack,Link, Button, Typography } from '@mui/material';
|
||||||
// assets
|
// assets
|
||||||
import { DocIllustration } from '@/assets';
|
import { DocIllustration } from '@/assets';
|
||||||
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
|
|
||||||
|
import { LanguageContext } from '@/contexts/LanguageContext';
|
||||||
|
import { useContext, useEffect, useState } from 'react';
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
export default function NavbarDocs() {
|
export default function NavbarDocs() {
|
||||||
|
const { localeData }: any = useContext(LanguageContext);
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
window.location.href = 'https://wa.me/6285890008500';
|
window.location.href = 'https://wa.me/6285890008500';
|
||||||
};
|
};
|
||||||
@@ -15,7 +20,7 @@ export default function NavbarDocs() {
|
|||||||
spacing={3}
|
spacing={3}
|
||||||
sx={{ px: 5, pb: 5, mt: 10, width: 1, textAlign: 'center', display: 'block' }}
|
sx={{ px: 5, pb: 5, mt: 10, width: 1, textAlign: 'center', display: 'block' }}
|
||||||
>
|
>
|
||||||
<DocIllustration sx={{ width: 1 }} />
|
{/* <DocIllustration sx={{ width: 1 }} />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Typography gutterBottom variant="subtitle1">
|
<Typography gutterBottom variant="subtitle1">
|
||||||
@@ -28,7 +33,18 @@ export default function NavbarDocs() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button variant="contained" onClick={handleClick}>WhatsApp</Button>
|
<Button variant="contained" onClick={handleClick}>WhatsApp</Button>
|
||||||
<Typography variant='body2'>Hak Cipta © 2023 - 2024 LinkSehat</Typography>
|
<Typography variant='body2'>Hak Cipta © 2023 - 2024 LinkSehat</Typography> */}
|
||||||
|
<Typography variant="body2" >
|
||||||
|
{localeData.txtHelp} {""}
|
||||||
|
<Link
|
||||||
|
variant="subtitle2"
|
||||||
|
component={RouterLink}
|
||||||
|
to="#"
|
||||||
|
onClick={handleClick}
|
||||||
|
>
|
||||||
|
{localeData.txtContactUs}
|
||||||
|
</Link>
|
||||||
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -116,14 +116,16 @@ export default function Login() {
|
|||||||
/>
|
/>
|
||||||
</SectionStyle>
|
</SectionStyle>
|
||||||
)} */}
|
)} */}
|
||||||
|
|
||||||
<Container maxWidth="sm">
|
<Container maxWidth="sm">
|
||||||
<ContentStyle>
|
<ContentStyle>
|
||||||
|
<Card sx={{padding:2}}>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
sx={{ mb: 5 }}
|
sx={{ mb: 5 }}
|
||||||
>
|
>
|
||||||
|
|
||||||
<Logo sx={{ width: 90, height: 90 }} />
|
<Logo sx={{ width: 90, height: 90 }} />
|
||||||
<Box sx={{ flexGrow: 1 }}>
|
<Box sx={{ flexGrow: 1 }}>
|
||||||
<Typography variant="h4" gutterBottom>
|
<Typography variant="h4" gutterBottom>
|
||||||
@@ -149,6 +151,7 @@ export default function Login() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<LoginForm />
|
<LoginForm />
|
||||||
|
</Card>
|
||||||
|
|
||||||
{/*{false && !smUp && (
|
{/*{false && !smUp && (
|
||||||
<Typography
|
<Typography
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Identitas Peserta</td>
|
<td>Identitas Peserta</td>
|
||||||
<td>:</td>
|
<td>:</td>
|
||||||
<td>{{ $dataMember->nik }}</td>
|
<td>{{ $dataMember->nric }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Hak Kamar Pasien</td>
|
<td>Hak Kamar Pasien</td>
|
||||||
|
|||||||
@@ -297,7 +297,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Identitas Peserta</td>
|
<td>Identitas Peserta</td>
|
||||||
<td>:</td>
|
<td>:</td>
|
||||||
<td>{{ $dataMember->nik }}</td>
|
<td>{{ $dataMember->nric }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Hak Kamar Pasien</td>
|
<td>Hak Kamar Pasien</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user