<?php

Game::addSqlQuery(
    'ROUND_LIST',
    'SELECT * FROM MJ_ROUND'
);

Game::addSqlQuery(
    'ROUND_GET_WITH_ID',
    'SELECT * FROM MJ_ROUND WHERE ID_ROUND=:id'
);

Game::addSqlQuery(
    'ROUND_GET_USERS',
    'SELECT usr.ID_USER,
    usr.ID_ROLE,
    usr.LOGIN,
    usr.AVATAR,
    usr.LASTNAME,
    usr.FIRSTNAME,
    usr.MAIL,
    usr.BAN_ACCOUNT,
    usr.LAST_IP 
    FROM MJ_USER as usr
    JOIN MJ_PLAY as p on p.ID_USER = usr.ID_USER
    JOIN MJ_ROUND as r on r.ID_ROUND = p.ID_ROUND
    WHERE r.ID_ROUND=:id'
);

Game::addSqlQuery(
    'ROUND_CREATE',
    'INSERT INTO MJ_ROUND (ID_ROUND ,ID_GAME ,PREVAILING_WIND ,SEED ,BEGINING ,ENDING ,ACTIONS)
    VALUES (NULL, :id_game, :prevailing_wind, :seed, :begin_date, NULL, NULL)'
);

Game::addSqlQuery(
    'ACTION_UPDATE',
    'UPDATE MJ_ROUND 
    SET ACTIONS = :actions WHERE ID_ROUND = :id'
);