step 5 : perbaikan list query
This commit is contained in:
@@ -28,3 +28,32 @@ templ Modal(modalID string, modalTitle string, modalBody templ.Component, modalA
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalXL(modalID string, modalTitle string, modalBody templ.Component, modalAction templ.Component, btnClose templ.Component) {
|
||||
<div
|
||||
class="modal fade"
|
||||
style="display: none"
|
||||
id={ modalID }
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
data-backdrop="static"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered" role="document">
|
||||
<div class="modal-content rounded-lg">
|
||||
<div class="modal-header border-bottom-0">
|
||||
<h6 class="modal-title text-black font-weight-bolder">
|
||||
{ modalTitle }
|
||||
</h6>
|
||||
@btnClose
|
||||
</div>
|
||||
<div class="modal-body border-bottom-0">
|
||||
@modalBody
|
||||
</div>
|
||||
<div class="modal-footer border-top-0">
|
||||
@modalAction
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -83,3 +83,77 @@ func Modal(modalID string, modalTitle string, modalBody templ.Component, modalAc
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func ModalXL(modalID string, modalTitle string, modalBody templ.Component, modalAction templ.Component, btnClose templ.Component) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"modal fade\" style=\"display: none\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(modalID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 36, Col: 14}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl modal-dialog-centered\" role=\"document\"><div class=\"modal-content rounded-lg\"><div class=\"modal-header border-bottom-0\"><h6 class=\"modal-title text-black font-weight-bolder\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 46, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = btnClose.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"modal-body border-bottom-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalBody.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"modal-footer border-top-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalAction.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,8 +28,9 @@ type DoctorV1 struct {
|
||||
M_DoctorM_SpecialistID string `db:"M_DoctorM_SpecialistID"`
|
||||
M_SpecialistID string `db:"M_SpecialistID"`
|
||||
M_SpecialistName string `db:"M_SpecialistName"`
|
||||
M_TitleName string `db:"M_TitleName"`
|
||||
M_DoctorAddress string `db:"M_DoctorAddress"`
|
||||
M_DoctorAddressRegionalCd string `db:"M_DoctorAddressRegionalCd"`
|
||||
M_DoctorAddressRegionalCd int `db:"M_DoctorAddressRegionalCd"`
|
||||
M_DoctorAddressCity string `db:"M_DoctorAddressCity"`
|
||||
M_DoctorAddressDistrict string `db:"M_DoctorAddressDistrict"`
|
||||
M_DoctorAddressState string `db:"M_DoctorAddressState"`
|
||||
|
||||
@@ -620,38 +620,12 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
|
||||
querytotal := `
|
||||
SELECT COUNT(*)
|
||||
FROM m_doctor as d
|
||||
-- join terminology religion
|
||||
JOIN terminology as religion
|
||||
ON d.M_DoctorReligionCode = religion.code
|
||||
AND d.M_DoctorReligionSystem = religion.code_system
|
||||
AND religion.status_cd = 'normal'
|
||||
-- join terminology blood type
|
||||
JOIN terminology as bloodType
|
||||
ON d.M_DoctorBloodTypeCode = bloodType.code
|
||||
AND d.M_DoctorBloodTypeSystem = bloodType.code_system
|
||||
AND bloodType.status_cd = 'normal'
|
||||
-- join terminology blood rhesus
|
||||
JOIN terminology as bloodRh
|
||||
ON d.M_DoctorBloodRhCode = bloodRh.code
|
||||
AND d.M_DoctorBloodRhSystem = bloodRh.code_system
|
||||
AND bloodRh.status_cd = 'normal'
|
||||
-- join terminology education
|
||||
JOIN terminology as education
|
||||
ON d.M_DoctorEducationCode = education.code
|
||||
AND d.M_DoctorEducationSystem = education.code_system
|
||||
AND education.status_cd = 'normal'
|
||||
-- join terminology ethnic
|
||||
JOIN terminology as ethnic
|
||||
ON d.M_DoctorEtnicCode = ethnic.code
|
||||
AND d.M_DoctorEtnicSystem = ethnic.code_system
|
||||
AND ethnic.status_cd = 'normal'
|
||||
-- join terminology identifier
|
||||
JOIN terminology as identifier
|
||||
ON d.M_DoctorIdentifierCode = identifier.code
|
||||
AND d.M_DoctorIdentifierSystem = identifier.code_system
|
||||
AND identifier.status_cd = 'normal'
|
||||
-- join m_title
|
||||
LEFT JOIN m_title as title
|
||||
ON d.M_DoctorM_TitleID = title.M_TitleID
|
||||
AND title.M_TitleIsActive = 'Y'
|
||||
-- join m_specialist
|
||||
JOIN m_specialist as spesialis
|
||||
LEFT JOIN m_specialist as spesialis
|
||||
ON d.M_DoctorM_SpecialistID = spesialis.M_SpecialistID
|
||||
AND spesialis.M_SpecialistIsActive = 'Y'
|
||||
WHERE d.M_DoctorIsActive = 'Y' AND
|
||||
@@ -713,6 +687,8 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
|
||||
d.M_DoctorM_SpecialistID,
|
||||
spesialis.M_SpecialistID,
|
||||
spesialis.M_SpecialistName,
|
||||
IFNULL(d.M_DoctorAddress, '') as M_DoctorAddress,
|
||||
IFNULL(title.M_TitleName, '') as M_TitleName,
|
||||
d.M_DoctorCreated,
|
||||
d.M_DoctorCreatedUserID,
|
||||
d.M_DoctorLastUpdated,
|
||||
@@ -720,38 +696,12 @@ func (su *ServicesMdDoctor) GetListMdDoctor(search string, currentPage int, rowP
|
||||
d.M_DoctorDeletedUserID,
|
||||
d.M_DoctorDeleted
|
||||
FROM m_doctor as d
|
||||
-- join terminology religion
|
||||
JOIN terminology as religion
|
||||
ON d.M_DoctorReligionCode = religion.code
|
||||
AND d.M_DoctorReligionSystem = religion.code_system
|
||||
AND religion.status_cd = 'normal'
|
||||
-- join terminology blood type
|
||||
JOIN terminology as bloodType
|
||||
ON d.M_DoctorBloodTypeCode = bloodType.code
|
||||
AND d.M_DoctorBloodTypeSystem = bloodType.code_system
|
||||
AND bloodType.status_cd = 'normal'
|
||||
-- join terminology blood rhesus
|
||||
JOIN terminology as bloodRh
|
||||
ON d.M_DoctorBloodRhCode = bloodRh.code
|
||||
AND d.M_DoctorBloodRhSystem = bloodRh.code_system
|
||||
AND bloodRh.status_cd = 'normal'
|
||||
-- join terminology education
|
||||
JOIN terminology as education
|
||||
ON d.M_DoctorEducationCode = education.code
|
||||
AND d.M_DoctorEducationSystem = education.code_system
|
||||
AND education.status_cd = 'normal'
|
||||
-- join terminology ethnic
|
||||
JOIN terminology as ethnic
|
||||
ON d.M_DoctorEtnicCode = ethnic.code
|
||||
AND d.M_DoctorEtnicSystem = ethnic.code_system
|
||||
AND ethnic.status_cd = 'normal'
|
||||
-- join terminology identifier
|
||||
JOIN terminology as identifier
|
||||
ON d.M_DoctorIdentifierCode = identifier.code
|
||||
AND d.M_DoctorIdentifierSystem = identifier.code_system
|
||||
AND identifier.status_cd = 'normal'
|
||||
-- join m_title
|
||||
LEFT JOIN m_title as title
|
||||
ON d.M_DoctorM_TitleID = title.M_TitleID
|
||||
AND title.M_TitleIsActive = 'Y'
|
||||
-- join m_specialist
|
||||
JOIN m_specialist as spesialis
|
||||
LEFT JOIN m_specialist as spesialis
|
||||
ON d.M_DoctorM_SpecialistID = spesialis.M_SpecialistID
|
||||
AND spesialis.M_SpecialistIsActive = 'Y'
|
||||
WHERE d.M_DoctorIsActive = 'Y' AND
|
||||
|
||||
Reference in New Issue
Block a user