|
@@ -45,6 +45,18 @@ export class DashboardService {
|
|
addItem(data, addType) {
|
|
addItem(data, addType) {
|
|
if(addType == 'advertisiment'){
|
|
if(addType == 'advertisiment'){
|
|
return this.http.post(this.authService.pathApi + '/add_main_ad' , data);
|
|
return this.http.post(this.authService.pathApi + '/add_main_ad' , data);
|
|
|
|
+ } else if(addType == 'role') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_role' , data);
|
|
|
|
+ } else if(addType == 'department'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_adminstration' , data);
|
|
|
|
+ } else if(addType == 'section'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_department' , data);
|
|
|
|
+ } else if(addType == 'tab'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_tab' , data);
|
|
|
|
+ } else if(addType == 'internalSer'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_internal_service' , data);
|
|
|
|
+ } else if(addType == 'achiev'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_achievement' , data);
|
|
} else if(addType == 'internalHospital') {
|
|
} else if(addType == 'internalHospital') {
|
|
return this.http.post(this.authService.pathApi + '/add_hospitals_centers' , data);
|
|
return this.http.post(this.authService.pathApi + '/add_hospitals_centers' , data);
|
|
} else if(addType == 'externalHospital') {
|
|
} else if(addType == 'externalHospital') {
|
|
@@ -107,19 +119,36 @@ export class DashboardService {
|
|
return this.http.post(this.authService.pathApi + '/add_location', data);
|
|
return this.http.post(this.authService.pathApi + '/add_location', data);
|
|
}else if(addType == 'definitionOfTime') {
|
|
}else if(addType == 'definitionOfTime') {
|
|
return this.http.post(this.authService.pathApi + '/add_time_period', data);
|
|
return this.http.post(this.authService.pathApi + '/add_time_period', data);
|
|
|
|
+ }else if(addType == 'livingService') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_covenant_category', data);
|
|
|
|
+ }else if(addType == 'definitionOfCovenant') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_covenant', data);
|
|
|
|
+ }else if(addType == 'recordInfoBuilding') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/add_housing_complex', data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //edit event
|
|
|
|
|
|
+ //edit event
|
|
editItem(editId,dataEdit,editPageName){
|
|
editItem(editId,dataEdit,editPageName){
|
|
const editData = dataEdit;
|
|
const editData = dataEdit;
|
|
- console.log(editId);
|
|
|
|
console.log(editPageName);
|
|
console.log(editPageName);
|
|
editData['id'] = editId;
|
|
editData['id'] = editId;
|
|
- console.log(dataEdit);
|
|
|
|
|
|
+ console.log(editData);
|
|
|
|
|
|
if(editPageName == 'advertisiment') {
|
|
if(editPageName == 'advertisiment') {
|
|
return this.http.post(this.authService.pathApi + '/edit_main_ad', editData);
|
|
return this.http.post(this.authService.pathApi + '/edit_main_ad', editData);
|
|
|
|
+ } else if(editPageName == 'role') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_role', editData);
|
|
|
|
+ } else if(editPageName == 'department'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_adminstration', editData);
|
|
|
|
+ } else if(editPageName == 'section'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_adminstration', editData);
|
|
|
|
+ } else if(editPageName == 'tab'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_tab', editData);
|
|
|
|
+ } else if(editPageName == 'achiev'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_achievement', editData);
|
|
|
|
+ } else if(editPageName == 'internalSer'){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/', editData);
|
|
} else if(editPageName == 'internalHospital') {
|
|
} else if(editPageName == 'internalHospital') {
|
|
return this.http.post(this.authService.pathApi + '/edit_hospitals_centers', editData);
|
|
return this.http.post(this.authService.pathApi + '/edit_hospitals_centers', editData);
|
|
} else if(editPageName == 'externalHospital') {
|
|
} else if(editPageName == 'externalHospital') {
|
|
@@ -187,14 +216,32 @@ export class DashboardService {
|
|
return this.http.post(this.authService.pathApi + '/edit_location', editData);
|
|
return this.http.post(this.authService.pathApi + '/edit_location', editData);
|
|
}else if(editPageName == 'definitionOfTime') {
|
|
}else if(editPageName == 'definitionOfTime') {
|
|
return this.http.post(this.authService.pathApi + '/edit_time_period', editData);
|
|
return this.http.post(this.authService.pathApi + '/edit_time_period', editData);
|
|
|
|
+ }else if(editPageName == 'livingService') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_covenant_category', editData);
|
|
|
|
+ }else if(editPageName == 'definitionOfCovenant') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_covenant', editData);
|
|
|
|
+ }else if(editPageName == 'recordInfoBuilding') {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/edit_housing_complex', editData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //get item data
|
|
|
|
|
|
+ //get item data
|
|
getItemData(pageId: number, typeGetData:string) {
|
|
getItemData(pageId: number, typeGetData:string) {
|
|
console.log('wwwwwwwwwwwwwwwwwwwwwwwwwwww', pageId);
|
|
console.log('wwwwwwwwwwwwwwwwwwwwwwwwwwww', pageId);
|
|
if(typeGetData == 'advertisiment') {
|
|
if(typeGetData == 'advertisiment') {
|
|
return this.http.get(this.authService.pathApi + '/get_main_ad/' + pageId);
|
|
return this.http.get(this.authService.pathApi + '/get_main_ad/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'role'){
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_role/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'department') {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_adminstration/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'section'){
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_department/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'tab'){
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_tab/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'internalSer'){
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_internal_service/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'achiev') {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_achievement/' + pageId);
|
|
} else if(typeGetData == 'hospital') {
|
|
} else if(typeGetData == 'hospital') {
|
|
return this.http.get(this.authService.pathApi + '/get_hospitals_centers/' + pageId);
|
|
return this.http.get(this.authService.pathApi + '/get_hospitals_centers/' + pageId);
|
|
} else if(typeGetData == 'managament') {
|
|
} else if(typeGetData == 'managament') {
|
|
@@ -249,6 +296,12 @@ export class DashboardService {
|
|
return this.http.get(this.authService.pathApi + '/get_time_period/' + pageId);
|
|
return this.http.get(this.authService.pathApi + '/get_time_period/' + pageId);
|
|
} else if(typeGetData == 'maintenance') {
|
|
} else if(typeGetData == 'maintenance') {
|
|
return this.http.get(this.authService.pathApi + '/get_communication/' + pageId);
|
|
return this.http.get(this.authService.pathApi + '/get_communication/' + pageId);
|
|
|
|
+ } else if(typeGetData == 'livingService') {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_covenant_category/' + pageId);
|
|
|
|
+ }else if(typeGetData == 'definitionOfCovenant') {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_covenant/' + pageId);
|
|
|
|
+ }else if(typeGetData == 'recordInfoBuilding') {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/get_housing_complex/' + pageId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//delete event
|
|
//delete event
|
|
@@ -259,6 +312,18 @@ export class DashboardService {
|
|
|
|
|
|
if(pageId == 24) {
|
|
if(pageId == 24) {
|
|
return this.http.post(this.authService.pathApi + '/delete_main_ads' , {'ads_id' : dataIds});
|
|
return this.http.post(this.authService.pathApi + '/delete_main_ads' , {'ads_id' : dataIds});
|
|
|
|
+ } else if(pageId == 2) {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_role' , {'roles_id' : dataIds});
|
|
|
|
+ } else if(pageId == 3){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_adminstration' , {'adminstrations_id' : dataIds});
|
|
|
|
+ } else if(pageId == 4){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_department' , {'departments_id' : dataIds});
|
|
|
|
+ } else if(pageId == 12){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_tabs' , {'tabs_id' : dataIds});
|
|
|
|
+ } else if(pageId == 11){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_achievements' , {'achievements_id' : dataIds});
|
|
|
|
+ } else if(pageId == 14){
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_internal_services' , {'internal_services_id' : dataIds});
|
|
} else if(pageId == 10) {
|
|
} else if(pageId == 10) {
|
|
return this.http.post(this.authService.pathApi + '/delete_managements' , {'managements_id' : dataIds});
|
|
return this.http.post(this.authService.pathApi + '/delete_managements' , {'managements_id' : dataIds});
|
|
} else if(pageId == 31) {
|
|
} else if(pageId == 31) {
|
|
@@ -317,12 +382,51 @@ export class DashboardService {
|
|
return this.http.post(this.authService.pathApi + '/delete_location', {'locations_id' : dataIds});
|
|
return this.http.post(this.authService.pathApi + '/delete_location', {'locations_id' : dataIds});
|
|
}else if(pageId == 53) {
|
|
}else if(pageId == 53) {
|
|
return this.http.post(this.authService.pathApi + '/delete_time_period', {'time_periods_id' : dataIds});
|
|
return this.http.post(this.authService.pathApi + '/delete_time_period', {'time_periods_id' : dataIds});
|
|
|
|
+ }else if(pageId == 63) {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_covenant_category', {'covenant_category_ids' : dataIds});
|
|
|
|
+ }else if(pageId == 64) {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_covenant', {'covenant_ids' : dataIds});
|
|
|
|
+ }else if(pageId == 65) {
|
|
|
|
+ return this.http.post(this.authService.pathApi + '/delete_housing_complex', {'housing_complex_ids' : dataIds});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
+ //get permissions list of roles
|
|
|
|
+ getPermissionList() {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/permissions_list');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //get report pages inside roles
|
|
|
|
+ get_report_pages_inside_roles(roleId: number) {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/report_pages_inside_roles/' + roleId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //get report of users inside roles
|
|
|
|
+ get_report_users_inside_roles(roleId: number) {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/report_users_inside_roles/' + roleId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //get adminstartion
|
|
|
|
+ getAdinstration() {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/adminstrations_list');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //get parent list
|
|
|
|
+ getParentList() {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/parents_list');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //get internal pages
|
|
|
|
+ getInternalPages() {
|
|
|
|
+ return this.http.get(this.authService.pathApi + '/system_pages_list');
|
|
|
|
+ }
|
|
|
|
+
|
|
//return seconds inot hh-mm-ss
|
|
//return seconds inot hh-mm-ss
|
|
secondsToDhms(seconds) {
|
|
secondsToDhms(seconds) {
|
|
seconds = Number(seconds);
|
|
seconds = Number(seconds);
|