/*
EEEEEEEEEEEEEEEEEEEEEEVVVVVVVV           VVVVVVVVEEEEEEEEEEEEEEEEEEEEEENNNNNNNN        NNNNNNNNTTTTTTTTTTTTTTTTTTTTTTT
E::::::::::::::::::::EV::::::V           V::::::VE::::::::::::::::::::EN:::::::N       N::::::NT:::::::::::::::::::::T
E::::::::::::::::::::EV::::::V           V::::::VE::::::::::::::::::::EN::::::::N      N::::::NT:::::::::::::::::::::T
EE::::::EEEEEEEEE::::EV::::::V           V::::::VEE::::::EEEEEEEEE::::EN:::::::::N     N::::::NT:::::TT:::::::TT:::::T
  E:::::E       EEEEEE V:::::V           V:::::V   E:::::E       EEEEEEN::::::::::N    N::::::NTTTTTT  T:::::T  TTTTTT
  E:::::E               V:::::V         V:::::V    E:::::E             N:::::::::::N   N::::::N        T:::::T
  E::::::EEEEEEEEEE      V:::::V       V:::::V     E::::::EEEEEEEEEE   N:::::::N::::N  N::::::N        T:::::T
  E:::::::::::::::E       V:::::V     V:::::V      E:::::::::::::::E   N::::::N N::::N N::::::N        T:::::T
  E:::::::::::::::E        V:::::V   V:::::V       E:::::::::::::::E   N::::::N  N::::N:::::::N        T:::::T
  E::::::EEEEEEEEEE         V:::::V V:::::V        E::::::EEEEEEEEEE   N::::::N   N:::::::::::N        T:::::T
  E:::::E                    V:::::V:::::V         E:::::E             N::::::N    N::::::::::N        T:::::T
  E:::::E       EEEEEE        V:::::::::V          E:::::E       EEEEEEN::::::N     N:::::::::N        T:::::T
EE::::::EEEEEEEE:::::E         V:::::::V         EE::::::EEEEEEEE:::::EN::::::N      N::::::::N      TT:::::::TT
E::::::::::::::::::::E          V:::::V          E::::::::::::::::::::EN::::::N       N:::::::N      T:::::::::T
E::::::::::::::::::::E           V:::V           E::::::::::::::::::::EN::::::N        N::::::N      T:::::::::T
EEEEEEEEEEEEEEEEEEEEEE            VVV            EEEEEEEEEEEEEEEEEEEEEENNNNNNNN         NNNNNNN      TTTTTTTTTTT*/
IF OBJECT_ID ( 'SelectEventByDate', 'P' ) IS NOT NULL
    DROP PROCEDURE SelectEventByDate;
GO
CREATE PROCEDURE SelectEventByDate
    @dateV date
AS
SELECT * FROM [dbo].[T_event] Where CAST(E_date AS DATE) = @dateV;
RETURN
GO
IF OBJECT_ID ( 'SelectEventBetweenTwoDateTime', 'P' ) IS NOT NULL
    DROP PROCEDURE SelectEventBetweenTwoDateTime;
GO
CREATE PROCEDURE SelectEventBetweenTwoDateTime
    @dateStart datetime,
    @dateEnd datetime
AS
SELECT * FROM [dbo].[T_event] Where E_Date>=@dateStart AND E_Date<@dateEnd;
RETURN
GO
IF OBJECT_ID ( 'ListParticipantEquipe', 'P' ) IS NOT NULL
    DROP PROCEDURE ListParticipantEquipe;
GO
CREATE PROCEDURE ListParticipantEquipe
    @ID_equipe int
AS
SELECT T_beneficiaire.ID_beneficiaire, T_beneficiaire.B_nom,T_beneficiaire.B_prenom,T_beneficiaire.B_anniversaire,
		T_beneficiaire.B_img FROM [dbo].[T_listParticipant] RIGHT JOIN T_beneficiaire
		ON T_listParticipant.ID_benificiaire=T_beneficiaire.ID_beneficiaire AND T_listParticipant.ID_equipe=@ID_Equipe
		WHERE T_listParticipant.ID_equipe=@ID_Equipe;
RETURN
GO
/*
RRRRRRRRRRRRRRRRR   EEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPP        AAA
R::::::::::::::::R  E::::::::::::::::::::EP::::::::::::::::P      A:::A
R::::::RRRRRR:::::R E::::::::::::::::::::EP::::::PPPPPP:::::P    A:::::A
RR:::::R     R:::::REE::::::EEEEEEEEE::::EPP:::::P     P:::::P  A:::::::A
  R::::R     R:::::R  E:::::E       EEEEEE  P::::P     P:::::P A:::::::::A
  R::::R     R:::::R  E:::::E               P::::P     P:::::PA:::::A:::::A
  R::::RRRRRR:::::R   E::::::EEEEEEEEEE     P::::PPPPPP:::::PA:::::A A:::::A
  R:::::::::::::RR    E:::::::::::::::E     P:::::::::::::PPA:::::A   A:::::A
  R::::RRRRRR:::::R   E:::::::::::::::E     P::::PPPPPPPPP A:::::A     A:::::A
  R::::R     R:::::R  E::::::EEEEEEEEEE     P::::P        A:::::AAAAAAAAA:::::A
  R::::R     R:::::R  E:::::E               P::::P       A:::::::::::::::::::::A
  R::::R     R:::::R  E:::::E       EEEEEE  P::::P      A:::::AAAAAAAAAAAAA:::::A
RR:::::R     R:::::REE::::::EEEEEEEE:::::EPP::::::PP   A:::::A             A:::::A
R::::::R     R:::::RE::::::::::::::::::::EP::::::::P  A:::::A               A:::::A
R::::::R     R:::::RE::::::::::::::::::::EP::::::::P A:::::A                 A:::::A
RRRRRRRR     RRRRRRREEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPAAAAAAA                   AAAAAAA*/
IF OBJECT_ID ( 'SelectListPlatByDate', 'P' ) IS NOT NULL
    DROP PROCEDURE SelectListPlatByDate;
GO
CREATE PROCEDURE SelectListPlatByDate
    @dateV date
AS
SELECT T_plat.ID_plat, T_plat.P_nom, T_plat.P_img, T_plat.ID_typePlat FROM [dbo].[T_listPlat] RIGHT JOIN T_plat ON T_listPlat.ID_plat=T_Plat.ID_plat WHERE CAST(LP_datePlat AS DATE) = @dateV
RETURN
GO
IF OBJECT_ID ( 'SelectListPlatBetweenTwoDateTime', 'P' ) IS NOT NULL
    DROP PROCEDURE SelectRepaBetweenTwoDateTime;
GO
CREATE PROCEDURE SelectRepaBetweenTwoDateTime
    @dateStart datetime,
    @dateEnd datetime
AS
SELECT T_plat.ID_plat, T_plat.P_nom, T_plat.P_img, T_plat.ID_typePlat FROM [dbo].[T_listPlat] RIGHT JOIN T_plat ON T_listPlat.ID_plat=T_Plat.ID_plat AND LP_datePlat>=@dateStart AND LP_datePlat<@dateEnd;
RETURN
GO

IF OBJECT_ID ( 'ListPlat', 'P' ) IS NOT NULL
    DROP PROCEDURE ListPlat;
GO
CREATE PROCEDURE ListPlat
    @ID_repa int
AS
SELECT T_plat.ID_plat, T_plat.P_nom, T_plat.P_img, T_plat.ID_typePlat FROM [dbo].[T_listPlat] RIGHT JOIN T_plat ON T_listPlat.ID_repa=@ID_repa;
RETURN
GO
