dashboard.service.ts 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. import { HttpClient } from '@angular/common/http';
  2. import { Injectable } from '@angular/core';
  3. import { NgxSpinnerService } from 'ngx-spinner';
  4. import { ToastrService } from 'ngx-toastr';
  5. import { AuthServiceService } from './auth-service.service';
  6. @Injectable({
  7. providedIn: 'root'
  8. })
  9. export class DashboardService {
  10. constructor(private http: HttpClient,
  11. private toastr: ToastrService,
  12. public authService: AuthServiceService,
  13. private spinner: NgxSpinnerService) { }
  14. //get hospitals list
  15. getListUnit( currentPage: number, dataTableNumber: number, housing_complex_id: any,building_type_id: any,building_id: any,unitId: any, pageId: number){
  16. this.spinner.show();
  17. console.log('services ', currentPage);
  18. if(pageId == 67){
  19. console.log(this.authService.pathApi +'/units_list/' + currentPage + '/' + dataTableNumber + '/' + housing_complex_id + '/' + building_type_id + '/' + building_id );
  20. return this.http.get(this.authService.pathApi +'/units_list/' + currentPage + '/' + dataTableNumber + '/' + housing_complex_id + '/' + building_type_id + '/' + building_id );
  21. }else if (pageId == 68) {
  22. return this.http.get(this.authService.pathApi +'/unit_covenants_list/' + currentPage + '/' + dataTableNumber + '/' + housing_complex_id + '/' + building_type_id + '/' + building_id + '/' + unitId );
  23. }
  24. }
  25. getHousingRequestsList(currentPage: number, dataTableNumber: number, to_whom: any ,status: any){
  26. console.log(this.authService.pathApi + '/housing_requests_list/'+ currentPage +'/' + dataTableNumber +'/' +'/' +to_whom + '/' + status);
  27. return this.http.get(this.authService.pathApi + '/housing_requests_list/'+ currentPage +'/' + dataTableNumber +'/' +to_whom + '/' + status);
  28. }
  29. getRequestTypesList(currentPage: number, dataTableNumber: number, require_attachments: any , require_approval: any, require_date:any){
  30. this.spinner.show();
  31. return this.http.get(this.authService.pathApi + '/request_types_list/'+ currentPage +'/' + dataTableNumber +'/' +require_attachments + '/' + require_approval + '/' + require_date);
  32. }
  33. getViewListOfRequests(currentPage: number, dataTableNumber: number, userId: number , status: any){
  34. this.spinner.show();
  35. return this.http.get(this.authService.pathApi + '/female_requests_list/' + currentPage + '/' + dataTableNumber + '/' + userId + '/' + status)
  36. }
  37. getListData(pageId: number, currentPage: number, dataTableNumber: number){
  38. this.spinner.show();
  39. console.log('services ', currentPage);
  40. console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
  41. return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
  42. }
  43. getListDataNew(pageId: number, currentPage: number, dataTableNumber: number , type: any){
  44. this.spinner.show();
  45. console.log('services ', currentPage);
  46. console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + type);
  47. return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/' +type);
  48. }
  49. //get data user from searchBar
  50. getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
  51. if(pageId == 40) {
  52. console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/1/' + data);
  53. return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/1/' + data);
  54. } else {
  55. console.log('urrrrrl',this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
  56. return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
  57. }
  58. }
  59. getDataUSerSearchBarUnit(data, currentPage: number, dataTableNumber: number, housing_complex_id: any,building_type_id: any,building_id: any, unitId: any ,pageId: number) {
  60. if(pageId == 67){
  61. return this.http.get(this.authService.pathApi +'/units_list/' + currentPage + '/' + dataTableNumber + '/' + housing_complex_id + '/' + building_type_id + '/' + building_id + '/' + data);
  62. }else if(pageId == 68){
  63. return this.http.get(this.authService.pathApi +'/unit_covenants_list/' + currentPage + '/' + dataTableNumber + '/' + housing_complex_id + '/' + building_type_id + '/' + building_id + '/' + unitId + '/' + data)
  64. }
  65. }
  66. getDataUSerSearchBarhousing(data, currentPage: number, dataTableNumber: number,to_whom: any, status: any){
  67. return this.http.get(this.authService.pathApi+ '/housing_requests_list/' + currentPage + '/' + dataTableNumber + '/' + to_whom + '/' + status + '/' + data);
  68. }
  69. getRequestTypesSearch(data, currentPage: number, dataTableNumber: number, require_attachments: any , require_approval: any, require_date:any ){
  70. return this.http.get(this.authService.pathApi + '/request_types_list/'+ currentPage +'/' + dataTableNumber +'/' +require_attachments + '/' + require_approval + '/' + require_date + '/' + data);
  71. }
  72. getViewSearchOnRequests( data ,currentPage: number, dataTableNumber: number, userId: number , status: any){
  73. this.spinner.show();
  74. return this.http.get(this.authService.pathApi + '/female_requests_list/' + currentPage + '/' + dataTableNumber + '/' + userId + '/' + status + '/' + data)
  75. }
  76. //if the page has filtter
  77. searchFiltterPagenation(pageId: number, currentPage: number, dataTableNumber: number, typeFiltter: string){
  78. console.log(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/' + typeFiltter)
  79. return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/' + typeFiltter);
  80. }
  81. //addEvent
  82. addItem(data, addType) {
  83. if(addType == 'advertisiment'){
  84. return this.http.post(this.authService.pathApi + '/add_main_ad' , data);
  85. } else if(addType == 'role') {
  86. return this.http.post(this.authService.pathApi + '/add_role' , data);
  87. } else if(addType == 'department'){
  88. return this.http.post(this.authService.pathApi + '/add_adminstration' , data);
  89. } else if(addType == 'section'){
  90. return this.http.post(this.authService.pathApi + '/add_department' , data);
  91. } else if(addType == 'tab'){
  92. return this.http.post(this.authService.pathApi + '/add_tab' , data);
  93. } else if(addType == 'internalSer'){
  94. return this.http.post(this.authService.pathApi + '/add_internal_service' , data);
  95. } else if(addType == 'achiev'){
  96. return this.http.post(this.authService.pathApi + '/add_achievement' , data);
  97. } else if(addType == 'lecture'){
  98. return this.http.post(this.authService.pathApi + '/add_lecture' , data);
  99. } else if(addType == 'internalHospital') {
  100. return this.http.post(this.authService.pathApi + '/add_hospitals_centers' , data);
  101. } else if(addType == 'externalHospital') {
  102. return this.http.post(this.authService.pathApi + '/add_hospitals_centers_ex' , data);
  103. } else if(addType == 'internalManagement') {
  104. return this.http.post(this.authService.pathApi + '/add_management' , data);
  105. } else if(addType == 'externalManagement') {
  106. return this.http.post(this.authService.pathApi + '/add_management_ex' , data);
  107. } else if(addType == 'internalMainMenu') {
  108. return this.http.post(this.authService.pathApi + '/add_menu' , data);
  109. } else if(addType == 'externalMainMenu') {
  110. return this.http.post(this.authService.pathApi + '/add_external_menu' , data);
  111. } else if(addType == 'internalServiceExternalPage') {
  112. return this.http.post(this.authService.pathApi + '/add_external_service' , data);
  113. } else if(addType == 'externalServiceExternalPage') {
  114. return this.http.post(this.authService.pathApi + '/add_external_service_ex' , data);
  115. } else if(addType == 'internalNews') {
  116. return this.http.post(this.authService.pathApi + '/add_report' , data);
  117. } else if(addType == 'externalNews') {
  118. return this.http.post(this.authService.pathApi + '/add_report_ex' , data);
  119. } else if(addType == 'internalFooter') {
  120. return this.http.post(this.authService.pathApi + '/add_footer' , data);
  121. } else if(addType == 'externalFooter') {
  122. return this.http.post(this.authService.pathApi + '/add_footer_ex' , data);
  123. } else if(addType == 'barEvent') {
  124. return this.http.post(this.authService.pathApi + '/add_event_bar', data);
  125. } else if(addType == 'visitingTime') {
  126. return this.http.post(this.authService.pathApi + '/add_visiting_time', data);
  127. } else if(addType == 'eventCalendar') {
  128. return this.http.post(this.authService.pathApi + '/add_event_calendar', data);
  129. } else if(addType == 'externalAchievement') {
  130. return this.http.post(this.authService.pathApi + "/add_external_achievement", data);
  131. } else if(addType == 'statistic') {
  132. return this.http.post(this.authService.pathApi + "/add_statistic", data);
  133. } else if(addType == 'advertising') {
  134. return this.http.post(this.authService.pathApi + "/add_advertising_service", data);
  135. } else if(addType == 'supervisor') {
  136. return this.http.post(this.authService.pathApi + "/asign_supervisor_to_department", data);
  137. } else if(addType == 'absorpation') {
  138. return this.http.post(this.authService.pathApi + "/add_absorpation_plan", data);
  139. } else if(addType == 'request') {
  140. return this.http.post(this.authService.pathApi + "/add_request", data);
  141. } else if(addType == 'trainee') {
  142. return this.http.post(this.authService.pathApi + "/add_user", data);
  143. } else if(addType == 'traineeRequest') {
  144. return this.http.post(this.authService.pathApi + "/add_request", data);
  145. } else if(addType == 'vehicle') {
  146. return this.http.post(this.authService.pathApi + '/add_vehicle_type', data);
  147. } else if(addType == 'modelVehicle') {
  148. return this.http.post(this.authService.pathApi + '/add_vehicle_model', data);
  149. } else if(addType == 'registerVehicle') {
  150. return this.http.post(this.authService.pathApi + '/add_vehicle_data', data);
  151. } else if(addType == 'registerMovementVehicle') {
  152. return this.http.post(this.authService.pathApi + '/add_vehicle_movement', data);
  153. } else if(addType == 'vehicleMaintenance') {
  154. return this.http.post(this.authService.pathApi + '/add_vehicle_maintenance', data);
  155. }else if(addType == 'definitionOfClassification') {
  156. return this.http.post(this.authService.pathApi + '/add_category', data);
  157. }else if(addType == 'definitionOfLocation') {
  158. return this.http.post(this.authService.pathApi + '/add_location', data);
  159. }else if(addType == 'definitionOfTime') {
  160. return this.http.post(this.authService.pathApi + '/add_time_period', data);
  161. }else if(addType == 'livingService') {
  162. return this.http.post(this.authService.pathApi + '/add_covenant_category', data);
  163. }else if(addType == 'definitionOfCovenant') {
  164. return this.http.post(this.authService.pathApi + '/add_covenant', data);
  165. }else if(addType == 'recordInfoBuilding') {
  166. return this.http.post(this.authService.pathApi + '/add_housing_complex', data);
  167. }else if(addType == 'events') {
  168. return this.http.post(this.authService.pathApi + '/add_event' , data);
  169. }else if(addType == 'unitsInformation') {
  170. return this.http.post(this.authService.pathApi + '/add_building_information' , data);
  171. }else if(addType == 'unitsBuildingInformation') {
  172. return this.http.post(this.authService.pathApi + '/add_unit_information' , data);
  173. }else if(addType == 'linkUnitToCovenants') {
  174. return this.http.post(this.authService.pathApi + '/assign_unit_covenant' , data);
  175. }else if(addType == 'femalesRequestTypesAdd') {
  176. return this.http.post(this.authService.pathApi + '/add_request_type' , data);
  177. }else if(addType == 'addFemaleRequest') {
  178. return this.http.post(this.authService.pathApi + '/add_female_request' , data);
  179. }else if(addType == 'addFemaleRequestAdmin') {
  180. return this.http.post(this.authService.pathApi + '/handle_female_request' , data);
  181. }
  182. }
  183. //edit event add_female_request
  184. editItem(editId,dataEdit,editPageName){
  185. const editData = dataEdit;
  186. console.log(editPageName);
  187. editData['id'] = editId;
  188. console.log(editData);
  189. if(editPageName == 'advertisiment') {
  190. return this.http.post(this.authService.pathApi + '/edit_main_ad', editData);
  191. } else if(editPageName == 'role') {
  192. return this.http.post(this.authService.pathApi + '/edit_role', editData);
  193. } else if(editPageName == 'department'){
  194. return this.http.post(this.authService.pathApi + '/edit_adminstration', editData);
  195. } else if(editPageName == 'section'){
  196. return this.http.post(this.authService.pathApi + '/edit_adminstration', editData);
  197. } else if(editPageName == 'tab'){
  198. return this.http.post(this.authService.pathApi + '/edit_tab', editData);
  199. } else if(editPageName == 'achiev'){
  200. return this.http.post(this.authService.pathApi + '/edit_achievement', editData);
  201. } else if(editPageName == 'lecture') {
  202. return this.http.post(this.authService.pathApi + '/edit_lecture', editData);
  203. } else if(editPageName == 'internalSer'){
  204. return this.http.post(this.authService.pathApi + '/edit_internal_service', editData);
  205. } else if(editPageName == 'internalHospital') {
  206. return this.http.post(this.authService.pathApi + '/edit_hospitals_centers', editData);
  207. } else if(editPageName == 'externalHospital') {
  208. return this.http.post(this.authService.pathApi + '/edit_hospitals_centers_ex', editData);
  209. } else if(editPageName == 'internalManagement') {
  210. return this.http.post(this.authService.pathApi + '/edit_management' , dataEdit);
  211. } else if(editPageName == 'externalManagement') {
  212. return this.http.post(this.authService.pathApi + '/edit_management_ex' , dataEdit);
  213. } else if(editPageName == 'internalMenu') {
  214. return this.http.post(this.authService.pathApi + '/edit_menu' , dataEdit);
  215. } else if(editPageName == 'externalMenu') {
  216. return this.http.post(this.authService.pathApi + '/edit_external_menu' , dataEdit);
  217. } else if(editPageName == 'internalServiceExternalPage') {
  218. return this.http.post(this.authService.pathApi + '/edit_external_service' , dataEdit);
  219. } else if(editPageName == 'externalServiceExternalPage') {
  220. return this.http.post(this.authService.pathApi + '/edit_external_service_ex' , dataEdit);
  221. } else if(editPageName == 'internalNew') {
  222. return this.http.post(this.authService.pathApi + '/edit_report' , dataEdit);
  223. } else if(editPageName == 'externalNew') {
  224. return this.http.post(this.authService.pathApi + '/edit_report_ex' , dataEdit);
  225. } else if(editPageName == 'internalFooter') {
  226. return this.http.post(this.authService.pathApi + '/edit_footer', dataEdit);
  227. } else if(editPageName == 'externalFooter') {
  228. return this.http.post(this.authService.pathApi + '/edit_footer_ex', dataEdit);
  229. }else if(editPageName == 'barEvent') {
  230. console.log(editData);
  231. return this.http.post(this.authService.pathApi + '/edit_event_bar', editData);
  232. } else if(editPageName == 'contactUs') {
  233. console.log(editData);
  234. return this.http.post(this.authService.pathApi + '/edit_contact_us', editData);
  235. } else if(editPageName == 'visitingTime') {
  236. console.log(editData);
  237. return this.http.post(this.authService.pathApi + '/edit_visiting_time', editData);
  238. } else if(editPageName == 'eventCalendar') {
  239. console.log(editData);
  240. return this.http.post(this.authService.pathApi + '/edit_event_calendar', editData);
  241. } else if(editPageName == 'externalAchievement') {
  242. console.log(editData);
  243. return this.http.post(this.authService.pathApi + '/edit_external_achievement', editData);
  244. } else if(editPageName == 'statistic') {
  245. console.log(editData);
  246. return this.http.post(this.authService.pathApi + '/edit_statistic', editData);
  247. } else if(editPageName == 'advertising') {
  248. console.log(editData);
  249. return this.http.post(this.authService.pathApi + '/edit_advertising_service', editData);
  250. } else if(editPageName == 'absorpation') {
  251. return this.http.post(this.authService.pathApi + '/edit_absorpation_plan', editData);
  252. } else if(editPageName == 'trainee') {
  253. return this.http.post(this.authService.pathApi + '/edit_user', editData);
  254. } else if(editPageName == 'request') {
  255. return this.http.post(this.authService.pathApi + '/edit_request', editData);
  256. } else if(editPageName == 'vehicle') {
  257. return this.http.post(this.authService.pathApi + '/edit_vehicle_type', editData);
  258. } else if(editPageName == 'vehicelModel') {
  259. return this.http.post(this.authService.pathApi + '/edit_vehicle_model', editData);
  260. } else if(editPageName == 'registerVehicle') {
  261. return this.http.post(this.authService.pathApi + '/edit_vehicle_data', editData);
  262. } else if(editPageName == 'registerMovementVehicle') {
  263. return this.http.post(this.authService.pathApi + '/edit_vehicle_movement', editData);
  264. } else if(editPageName == 'vehicleMaintenance') {
  265. return this.http.post(this.authService.pathApi + '/edit_vehicle_maintenance', editData);
  266. }else if(editPageName == 'definitionOfClassification') {
  267. return this.http.post(this.authService.pathApi + '/edit_category', editData);
  268. }else if(editPageName == 'definitionOfLocation') {
  269. return this.http.post(this.authService.pathApi + '/edit_location', editData);
  270. }else if(editPageName == 'definitionOfTime') {
  271. return this.http.post(this.authService.pathApi + '/edit_time_period', editData);
  272. }else if(editPageName == 'livingService') {
  273. return this.http.post(this.authService.pathApi + '/edit_covenant_category', editData);
  274. }else if(editPageName == 'definitionOfCovenant') {
  275. return this.http.post(this.authService.pathApi + '/edit_covenant', editData);
  276. }else if(editPageName == 'recordInfoBuilding') {
  277. return this.http.post(this.authService.pathApi + '/edit_housing_complex', editData);
  278. }else if(editPageName == 'events') {
  279. return this.http.post(this.authService.pathApi + '/edit_event', editData);
  280. }else if(editPageName == 'unitsInformation') {
  281. return this.http.post(this.authService.pathApi + '/edit_building_information', editData);
  282. }else if(editPageName == 'unitsBuildingInformation') {
  283. return this.http.post(this.authService.pathApi + '/edit_unit_information', editData);
  284. }else if(editPageName == 'linkUnitToCovenants') {
  285. return this.http.post(this.authService.pathApi + '/assign_unit_covenant', editData);
  286. }else if(editPageName == 'femalesRequestTypes') {
  287. return this.http.post(this.authService.pathApi + '/edit_request_type', editData);
  288. }else if(editPageName == 'editFemaleRequest') {
  289. return this.http.post(this.authService.pathApi + '/edit_female_request', editData);
  290. }
  291. }
  292. //get item data add_request_type
  293. getItemData(pageId: number, typeGetData:string) {
  294. console.log('wwwwwwwwwwwwwwwwwwwwwwwwwwww', pageId);
  295. if(typeGetData == 'advertisiment') {
  296. return this.http.get(this.authService.pathApi + '/get_main_ad/' + pageId);
  297. } else if(typeGetData == 'role'){
  298. return this.http.get(this.authService.pathApi + '/get_role/' + pageId);
  299. } else if(typeGetData == 'department') {
  300. return this.http.get(this.authService.pathApi + '/get_adminstration/' + pageId);
  301. } else if(typeGetData == 'section'){
  302. return this.http.get(this.authService.pathApi + '/get_department/' + pageId);
  303. } else if(typeGetData == 'tab'){
  304. return this.http.get(this.authService.pathApi + '/get_tab/' + pageId);
  305. } else if(typeGetData == 'internalSer'){
  306. return this.http.get(this.authService.pathApi + '/get_internal_service/' + pageId);
  307. } else if(typeGetData == 'lecture') {
  308. return this.http.get(this.authService.pathApi + '/get_lecture/' + pageId);
  309. } else if(typeGetData == 'achiev') {
  310. return this.http.get(this.authService.pathApi + '/get_achievement/' + pageId);
  311. } else if(typeGetData == 'hospital') {
  312. return this.http.get(this.authService.pathApi + '/get_hospitals_centers/' + pageId);
  313. } else if(typeGetData == 'managament') {
  314. return this.http.get(this.authService.pathApi + '/get_management/' + pageId);
  315. } else if(typeGetData == 'mainMenu') {
  316. return this.http.get(this.authService.pathApi + '/get_menu/' + pageId);
  317. } else if(typeGetData == 'externalService') {
  318. return this.http.get(this.authService.pathApi + '/get_external_service/' + pageId);
  319. } else if(typeGetData == 'news') {
  320. return this.http.get(this.authService.pathApi + '/get_report/' + pageId);
  321. } else if(typeGetData == 'footer') {
  322. return this.http.get(this.authService.pathApi + '/get_footer/' + pageId);
  323. }else if(typeGetData == 'barEvent') {
  324. return this.http.get(this.authService.pathApi + '/get_event_bar/' + pageId);
  325. } else if(typeGetData == 'contactUs') {
  326. return this.http.get(this.authService.pathApi + '/get_contact_us/' + pageId);
  327. } else if(typeGetData == 'visitingTime') {
  328. return this.http.get(this.authService.pathApi + '/get_visiting_time/' + pageId);
  329. } else if(typeGetData == 'eventCalendar') {
  330. return this.http.get(this.authService.pathApi + '/get_event_calendar/' + pageId);
  331. } else if(typeGetData == 'externalAchievement') {
  332. return this.http.get(this.authService.pathApi + '/get_external_achievement/' + pageId);
  333. } else if(typeGetData == 'statistic') {
  334. return this.http.get(this.authService.pathApi + '/get_statistic/' + pageId);
  335. } else if(typeGetData == 'advertising') {
  336. return this.http.get(this.authService.pathApi + '/get_advertising_service/' + pageId);
  337. } else if(typeGetData == 'supervisor') {
  338. return this.http.get(this.authService.pathApi + '/get_department/' + pageId);
  339. } else if(typeGetData == 'absorpation') {
  340. return this.http.get(this.authService.pathApi + '/get_absorpation_plan/' + pageId);
  341. } else if(typeGetData == 'trainee') {
  342. return this.http.get(this.authService.pathApi + '/get_user/' + pageId);
  343. } else if(typeGetData == 'traineeRequest') {
  344. return this.http.get(this.authService.pathApi + '/get_request/' + pageId);
  345. } else if(typeGetData == 'sectionReviewTrainee') {
  346. return this.http.get(this.authService.pathApi + '/get_request/' + pageId);
  347. } else if(typeGetData == 'vehicle') {
  348. return this.http.get(this.authService.pathApi + '/get_vehicle_type/' + pageId);
  349. } else if(typeGetData == 'vehicleModel') {
  350. return this.http.get(this.authService.pathApi + '/get_vehicle_model/' + pageId);
  351. } else if(typeGetData == 'registerVehicle') {
  352. return this.http.get(this.authService.pathApi + '/get_vehicle_data/' + pageId);
  353. } else if(typeGetData == 'registerMovementVehicle') {
  354. return this.http.get(this.authService.pathApi + '/get_vehicle_movement/' + pageId);
  355. } else if(typeGetData == 'maintenanceVehicle') {
  356. return this.http.get(this.authService.pathApi + '/get_vehicle_maintenance/' + pageId);
  357. }else if(typeGetData == 'definitionOfClassification') {
  358. return this.http.get(this.authService.pathApi + '/get_category/' + pageId);
  359. }else if(typeGetData == 'definitionOfLocation') {
  360. return this.http.get(this.authService.pathApi + '/get_location/' + pageId);
  361. }else if(typeGetData == 'definitionOfTime') {
  362. return this.http.get(this.authService.pathApi + '/get_time_period/' + pageId);
  363. } else if(typeGetData == 'maintenance') {
  364. return this.http.get(this.authService.pathApi + '/get_communication/' + pageId);
  365. } else if(typeGetData == 'livingService') {
  366. return this.http.get(this.authService.pathApi + '/get_covenant_category/' + pageId);
  367. }else if(typeGetData == 'definitionOfCovenant') {
  368. return this.http.get(this.authService.pathApi + '/get_covenant/' + pageId);
  369. }else if(typeGetData == 'recordInfoBuilding') {
  370. return this.http.get(this.authService.pathApi + '/get_housing_complex/' + pageId);
  371. }else if(typeGetData == 'events') {
  372. return this.http.get(this.authService.pathApi + '/get_event/' + pageId);
  373. }else if(typeGetData == 'unitInformation') {
  374. return this.http.get(this.authService.pathApi + '/get_building_information/' + pageId);
  375. }else if(typeGetData == 'unitBuildingInformation') {
  376. return this.http.get(this.authService.pathApi + '/get_unit_information/' + pageId);
  377. }else if(typeGetData == 'linkUnitToCovenants') {
  378. return this.http.get(this.authService.pathApi + '/get_unit_covenant/' + pageId);
  379. }else if(typeGetData == 'viewRequestsForAdminstrationDetails') {
  380. return this.http.get(this.authService.pathApi + '/get_housing_request/' + pageId);
  381. }else if(typeGetData == 'femalesRequestTypes') {
  382. return this.http.get(this.authService.pathApi + '/get_request_type/' + pageId);
  383. }else if(typeGetData == 'femalesRequest') {
  384. return this.http.get(this.authService.pathApi + '/get_female_request/' + pageId);
  385. }
  386. }
  387. //delete event get_request_type
  388. deleteItem(dataIds, pageId) {
  389. console.log(dataIds);
  390. console.log(pageId);
  391. if(pageId == 24) {
  392. return this.http.post(this.authService.pathApi + '/delete_main_ads' , {'ads_id' : dataIds});
  393. } else if(pageId == 2) {
  394. return this.http.post(this.authService.pathApi + '/delete_role' , {'roles_id' : dataIds});
  395. } else if(pageId == 3){
  396. return this.http.post(this.authService.pathApi + '/delete_adminstration' , {'adminstrations_id' : dataIds});
  397. } else if(pageId == 4){
  398. return this.http.post(this.authService.pathApi + '/delete_department' , {'departments_id' : dataIds});
  399. } else if(pageId == 12){
  400. return this.http.post(this.authService.pathApi + '/delete_tabs' , {'tabs_id' : dataIds});
  401. } else if(pageId == 15) {
  402. return this.http.post(this.authService.pathApi + '/delete_lectures' , {'lectures_id' : dataIds});
  403. } else if(pageId == 11){
  404. return this.http.post(this.authService.pathApi + '/delete_achievements' , {'achievements_id' : dataIds});
  405. } else if(pageId == 14){
  406. return this.http.post(this.authService.pathApi + '/delete_internal_services' , {'internal_services_id' : dataIds});
  407. } else if(pageId == 10) {
  408. return this.http.post(this.authService.pathApi + '/delete_managements' , {'managements_id' : dataIds});
  409. } else if(pageId == 31) {
  410. return this.http.post(this.authService.pathApi + '/delete_managements_ex' , {'managements_id' : dataIds});
  411. } else if(pageId == 6) {
  412. return this.http.post(this.authService.pathApi + '/delete_hospitals_centers' , {'hospitals_centers_id' : dataIds});
  413. } else if(pageId == 30) {
  414. return this.http.post(this.authService.pathApi + '/delete_hospitals_centers_ex' , {'hospitals_centers_id' : dataIds});
  415. } else if(pageId == 17) {
  416. return this.http.post(this.authService.pathApi + '/delete_menus' , {'menus_id' : dataIds});
  417. } else if(pageId == 18) {
  418. return this.http.post(this.authService.pathApi + '/delete_external_menus' , {'menus_id' : dataIds});
  419. } else if(pageId == 19) {
  420. return this.http.post(this.authService.pathApi + '/delete_external_services_ex' , {'external_services_id' : dataIds});
  421. } else if(pageId == 7) {
  422. return this.http.post(this.authService.pathApi + '/delete_external_services' , {'external_services_id' : dataIds});
  423. } else if(pageId == 20) {
  424. return this.http.post(this.authService.pathApi + '/delete_reports_ex' , {'reports_id' : dataIds});
  425. } else if(pageId == 13) {
  426. return this.http.post(this.authService.pathApi + '/delete_reports' , {'reports_id' : dataIds});
  427. } else if(pageId == 16) {
  428. return this.http.post(this.authService.pathApi + '/delete_footers' , {'footers_id' : dataIds});
  429. } else if(pageId == 29) {
  430. return this.http.post(this.authService.pathApi + '/delete_footers_ex' , {'footers_id' : dataIds});
  431. } else if (pageId == 21){
  432. return this.http.post(this.authService.pathApi + '/delete_event_bars' , {'event_bars_id' : dataIds});
  433. } else if (pageId == 23){
  434. return this.http.post(this.authService.pathApi + '/delete_visiting_times' , {'visiting_times_id' : dataIds});
  435. } else if (pageId == 25){
  436. return this.http.post(this.authService.pathApi + '/delete_event_calendars' , {'event_calendars_id' : dataIds});
  437. } else if (pageId == 27){
  438. return this.http.post(this.authService.pathApi + '/delete_external_achievements' , {'external_achievements_id' : dataIds});
  439. } else if (pageId == 26){
  440. return this.http.post(this.authService.pathApi + '/delete_statistics' , {'statistics_id' : dataIds});
  441. } else if (pageId == 22){
  442. return this.http.post(this.authService.pathApi + '/delete_advertising_services' , {'advertising_services_id' : dataIds});
  443. } else if(pageId == 33) {
  444. return this.http.post(this.authService.pathApi + '/un_asign_supervisor_to_department', {'departments_id' : dataIds})
  445. } else if(pageId == 34) {
  446. return this.http.post(this.authService.pathApi + '/delete_absorpation_plans', {'absorpation_plans_id' : dataIds});
  447. } else if(pageId == 40) {
  448. return this.http.post(this.authService.pathApi + '/delete_user', {'users_id' : dataIds});
  449. } else if(pageId == 43) {
  450. return this.http.post(this.authService.pathApi + '/delete_vehicle_type', {'types_id' : dataIds});
  451. } else if(pageId == 44) {
  452. return this.http.post(this.authService.pathApi + '/delete_vehicle_model', {'models_id' : dataIds});
  453. } else if(pageId == 45) {
  454. return this.http.post(this.authService.pathApi + '/delete_vehicle_data', {'datas_id' : dataIds});
  455. } else if(pageId == 46) {
  456. return this.http.post(this.authService.pathApi + '/delete_vehicle_maintenance', {'maintenances_id' : dataIds});
  457. } else if(pageId == 47) {
  458. return this.http.post(this.authService.pathApi + '/delete_vehicle_movement', {'movements_id' : dataIds});
  459. }else if(pageId == 51) {
  460. return this.http.post(this.authService.pathApi + '/delete_category', {'categories_id' : dataIds});
  461. }else if(pageId == 52) {
  462. return this.http.post(this.authService.pathApi + '/delete_location', {'locations_id' : dataIds});
  463. }else if(pageId == 53) {
  464. return this.http.post(this.authService.pathApi + '/delete_time_period', {'time_periods_id' : dataIds});
  465. }else if(pageId == 63) {
  466. return this.http.post(this.authService.pathApi + '/delete_covenant_category', {'covenant_category_ids' : dataIds});
  467. }else if(pageId == 64) {
  468. return this.http.post(this.authService.pathApi + '/delete_covenant', {'covenant_ids' : dataIds});
  469. }else if(pageId == 65) {
  470. return this.http.post(this.authService.pathApi + '/delete_housing_complex', {'housing_complex_ids' : dataIds});
  471. }else if (pageId == 8){
  472. return this.http.post(this.authService.pathApi + '/delete_events' , {'events_id' : dataIds});
  473. }else if(pageId == 66) {
  474. return this.http.post(this.authService.pathApi + '/delete_building_information', {'building_information_ids' : dataIds});
  475. }else if(pageId == 67) {
  476. return this.http.post(this.authService.pathApi + '/delete_unit_information', {'unit_information_ids' : dataIds});
  477. }else if(pageId == 68) {
  478. return this.http.post(this.authService.pathApi + '/delete_unit_covenant', {'unit_covenant_ids' : dataIds});
  479. }else if(pageId == 72) {
  480. return this.http.post(this.authService.pathApi + '/delete_request_type', {'types_ids' : dataIds});
  481. }else if(pageId == 73) {
  482. return this.http.post(this.authService.pathApi + '/delete_female_request', {'requests_ids' : dataIds});
  483. }
  484. };
  485. //get permissions list of roles
  486. getPermissionList() {
  487. return this.http.get(this.authService.pathApi + '/permissions_list');
  488. }
  489. //get report pages inside roles
  490. get_report_pages_inside_roles(roleId: number) {
  491. return this.http.get(this.authService.pathApi + '/report_pages_inside_roles/' + roleId);
  492. }
  493. //get report of users inside roles
  494. get_report_users_inside_roles(roleId: number) {
  495. return this.http.get(this.authService.pathApi + '/report_users_inside_roles/' + roleId);
  496. }
  497. //get adminstartion
  498. getAdinstration() {
  499. return this.http.get(this.authService.pathApi + '/adminstrations_list');
  500. }
  501. //get parent list
  502. getParentList(serviceId: number) {
  503. if(serviceId == 2){
  504. console.log(this.authService.pathApi + '/parents_list/' + 1);
  505. return this.http.get(this.authService.pathApi + '/parents_list/' + 1);
  506. }else if(serviceId == 6){
  507. return this.http.get(this.authService.pathApi + '/parents_list');
  508. }
  509. }
  510. //get internal pages
  511. getInternalPages() {
  512. return this.http.get(this.authService.pathApi + '/system_pages_list');
  513. }
  514. //return seconds inot hh-mm-ss
  515. secondsToDhms(seconds) {
  516. seconds = Number(seconds);
  517. var days = Math.floor(seconds / (3600*24));
  518. seconds -= days*3600*24;
  519. var hrs = Math.floor(seconds / 3600);
  520. seconds -= hrs*3600;
  521. var mnts = Math.floor(seconds / 60);
  522. seconds -= mnts*60;
  523. return (days + " يوم, " + hrs + " ساعه, " + mnts + " دقيقه, " + seconds + " ثانيه");
  524. }
  525. }