<?php

User::addSqlQuery(
    'USER_LIST',
    'SELECT * FROM MJ_USER ORDER BY LOGIN'
);

User::addSqlQuery(
    'USER_CHECK_LOGIN',
    'SELECT LOGIN FROM MJ_USER WHERE LOGIN=:login'
);

User::addSqlQuery(
    'USER_GET_WITH_LOGIN',
    'SELECT * FROM MJ_USER WHERE LOGIN=:login'
);

User::addSqlQuery(
    'USER_GET_WITH_ID',
    'SELECT * FROM MJ_USER WHERE ID_USER=:id'
);

User::addSqlQuery(
    'USER_CREATE',
    'INSERT INTO MJ_USER (ID_USER ,ID_ROLE ,LOGIN ,PASWORD ,AVATAR ,LASTNAME ,FIRSTNAME ,MAIL ,BAN_ACCOUNT ,LAST_IP) 
    VALUES (NULL, 1, :login, :pwd, :avatar, :lastname, :firstname, :mail, false, NULL)'
);

User::addSqlQuery(
    'USER_CONNECT',
    'SELECT * FROM MJ_USER WHERE LOGIN=:login and PASWORD=:password'
);

User::addSqlQuery(
    'USER_UPDATE',
    'UPDATE MJ_USER SET MAIL = :email WHERE ID_USER = :id'
);

User::addSqlQuery(
    'USER_DELETE',
    'DELETE FROM MJ_USER WHERE ID_USER=:id'
);