diff --git a/handlers/corporate/patient.handlers.go b/handlers/corporate/patient.handlers.go index 0365026..6bba2f9 100644 --- a/handlers/corporate/patient.handlers.go +++ b/handlers/corporate/patient.handlers.go @@ -67,10 +67,10 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { } listingcomponent := corporate_patient.ListingData(listingdata, listID, - "/corp/dashboard_pat/opencetak", + "/corp/dashboard_pat/open", "#"+dialogBodyID, + "#listID, #paginationID, #dialogID, #dialogBodyID", "outerHTML", - "#dialogID, #dialogBodyID", ) paginationcomponent := pagination.PaginationV3( @@ -85,28 +85,28 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { corporate_patient.AfterRequestContent(), ) - dialogBody := corporate_patient.BodyDialogPat( + bodyModal := corporate_patient.ModalBody( dialogBodyID, - corporate_patient.JSHideModal(""), + corporate_patient.JsShowModal(""), ) - dialogClose := corporate_patient.BtnClosePat( - "/corp/dashboard_pat/closecetak", + bodyClose := corporate_patient.ModalClose( + "/corp/dashboard_pat/closemodal", "#"+dialogBodyID, "outerHTML", "#"+dialogID, ) - dialogCetak := corporate_patient.PatientDialogForm( - "cetakdialog", - "/corp/dashboard_pat/cetak", + modalDialog := corporate_patient.DialogReport( + "", + "/corp/dashboard_pat/dialog", "#"+dialogBodyID, "outerHTML", - "#listID, #paginationID, #dialogID, #dialogBodyID", + "#listID, #paginationID, #dialogID, #dialogBodyID"+paginationID, dialogID, - "Cetak", - dialogBody, - dialogClose, + title, + bodyModal, + bodyClose, ) content := corporate_patient.DashboardPat( @@ -117,7 +117,7 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error { breadcrumb, listingcomponent, paginationcomponent, - dialogCetak, + modalDialog, ) css := corporate_patient.CSSDashboardPat() js := corporate_patient.JSDashboardPat() @@ -150,10 +150,10 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { } listcomponent := corporate_patient.ListingData(listData, listID, - "/corp/dashboard_pat/opencetak", + "/corp/dashboard_pat/open", "#"+dialogBodyID, + "#listID, #paginationID, #dialogID", "outerHTML", - "#dialogID, #dialogBodyID", ) paginationcomponent := pagination.PaginationV3( @@ -161,7 +161,7 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { page, "/corp/dashboard_pat/changepage", paginationID, - "#listID, #paginationID", + "#listID, #paginationID, #dialogID, #dialogBodyID, #currPage"+paginationID, "#"+paginationID, "outerHTML", "", "", corporate_patient.BeforeRequestContent(), @@ -173,32 +173,18 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error { return utils.ViewMulti(c, retval) } -func (ph *PatientHandler) HandleOpenDialog(c echo.Context) error { +func (ph *PatientHandler) HandleOpenReport(c echo.Context) error { logger, _ := zap.NewProduction() - defer logger.Sync() id := c.QueryParam("id") - logger.Info("params", zap.Any("id", id)) dialogID := c.QueryParam("dialogID") dialogBodyID := c.QueryParam("dialogBodyID") + logger.Info("params", zap.Any("id", id)) - dialogBody := corporate_patient.BodyDialogPat( + modalBody := corporate_patient.ModalBody( dialogBodyID, - corporate_patient.JSShowModal("#"+dialogID), + corporate_patient.JsShowModal("#"+dialogID), ) - return utils.View(c, dialogBody) -} - -func (ph *PatientHandler) HandleCloseDialog(c echo.Context) error { - // logger, _ := zap.NewProduction() - - dialogBodyID := c.QueryParam("dialogBodyID") - - dialogBody := corporate_patient.BodyDialogPat( - dialogBodyID, - corporate_patient.JSHideModal(""), - ) - - return utils.View(c, dialogBody) + return utils.View(c, modalBody) } diff --git a/handlers/routes.go b/handlers/routes.go index a856c0d..1a9ca8b 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -130,12 +130,7 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { patientHandler := corporate_handlers.NewPatientHandler(patienServices) corp.GET("/dashboard_pat", patientHandler.HandleShowPatient) corp.GET("/dashboard_pat/changepage", patientHandler.HandleChangePage) - corp.GET("/dashboard_pat/opencetak", patientHandler.HandleOpenDialog) - corp.POST("/dashboard_pat/closecetak", patientHandler.HandleCloseDialog) - - // dev.GET("/md/samplestation/openedit", devMDSampleStationHandlers.HandleOpenEditForm) - // dev.POST("/md/samplestation/edit", devMDSampleStationHandlers.HandleEditMDSS) - // dev.POST("/md/samplestation/closeeditform", devMDSampleStationHandlers.HandleCloseEditForm) + corp.GET("/dashboard_pat/open", patientHandler.HandleOpenReport) } func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { diff --git a/views/corporate/patient/listingpatient.templ b/views/corporate/patient/listingpatient.templ index 93a2702..8f3db54 100644 --- a/views/corporate/patient/listingpatient.templ +++ b/views/corporate/patient/listingpatient.templ @@ -6,10 +6,10 @@ import "strconv" templ ListingData( data []models.DashboardPatient, listID string, - hxGetCetak string, - hxTargetCetak string, - hxSwapCetak string, - hxIncludeCetak string, + hxGet string, + hxTarget string, + hxInclude string, + hxSwap string, ) {