<?php

User::addSqlQuery(
    'USER_LIST',
    'SELECT * FROM MJ_USER ORDER BY 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'
);

//TODO
User::addSqlQuery(
    'USER_CREATE',
    'INSERT INTO MJ_USER (USER_ID, USER_LOGIN, USER_EMAIL, USER_ROLE, USER_PASSWORD, USER_NAME, USER_SURNAME) VALUES (NULL, :login, :email, :role, :pwd, :name, :surname)'
);

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'
);
