dashboard.service.ts 33 KB

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