import { AuthServiceService } from './auth-service.service';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class InternalPageService {

  constructor(private http: HttpClient, private authSer: AuthServiceService) { }


  //get internl page data 
  getInternalPageData() {
    if(this.authSer.isAuthenticated()) {
      return this.http.get(this.authSer.pathApi + '/internal_page');
    } else {
      return this.http.get(this.authSer.pathApi + '/internal_page/1');
    }
  }

  getParentData() {
    return  this.http.get(this.authSer.pathApi + '/main_menu_list') 
  }

  getSliderData() {
    return this.http.get(this.authSer.pathApi + '/reports_list');
  }

  getExternalServicesList() {
    return this.http.get(this.authSer.pathApi + '/external_services_list_web');
  }

  getJoinUsData() {
    return this.http.get(this.authSer.pathApi + '/latest_join_us_user')
  }

  getCongatoration() {
    return this.http.get( this.authSer.pathApi + '/latest_event/1');
  }

  getCondolences() {
    return this.http.get( this.authSer.pathApi + '/latest_event/0');
  }

  getInternalServicesList() {
    return this.http.get(this.authSer.pathApi + '/internal_services_list');
  }

  getTabData(numberTab) {
    alert(numberTab);
    console.log(this.authSer.pathApi + '/forth_tabs_list/' + numberTab);
    return this.http.get(this.authSer.pathApi + '/forth_tabs_list/' + numberTab);
  }

  getForthAchievementsList(){
    return this.http.get(this.authSer.pathApi + '/forth_achievements_list');
  }

  getEventNow(){
   return this.http.get(this.authSer.pathApi + '/lectures_list'); 
  }

  //get data of hospital page 
  getHospitalCenterList(typeGetData: string) {
    return this.http.get(this.authSer.pathApi + '/' + typeGetData);//managements_list  '/hospitals_centers_list'
  }

  //get news data 
  getNewsData(id) {
    return this.http.get(this.authSer.pathApi + '/get_report/' + id);
  }

  //get Cir data 
  getCircularsData(currentPage: number, perPage: number, index: number) {
    console.log('iiiiin reqqqqqqqqqqqqqqqqquuuuuuest');
    return this.http.get(this.authSer.pathApi + '/tabs_list_internal_gate/' + currentPage + '/' + perPage + '/' + index);
  }

  getInternalServices() {
    return this.http.get(this.authSer.pathApi + '/external_services_list_web');
  }

  
}
