action="src/php/search.php"
(SELECT * FROM users
INNER JOIN predprijatie ON users.mesto_rab = predprijatie.pred_id
WHERE user_visible=1 AND parent_id=0 AND users_id = 34)
UNION
(SELECT * FROM users
INNER JOIN predprijatie ON users.mesto_rab = predprijatie.pred_id
WHERE user_visible=1 AND parent_id=0 AND users_id <> 34
ORDER BY mesto_rab ASC , name ASC)
SELECT user_dolg.id , user_dolg.date, user_dolg.user_id, user_dolg.dolg_id, user_dolg.dogovorNomer, user_dolg.dogovor_name, user_dolg.object, user_dolg.vidraboty, user_dolg.hours, user_dolg.user_change,
predprijatie.all_name,
users.name, users.users_id ,users.mesto_rab , users.doljnost
FROM users
INNER JOIN user_dolg ON user_dolg.user_id = users.users_id
INNER JOIN predprijatie ON user_dolg.dolg_id = predprijatie.pred_id
WHERE users_id = 34
UNION
SELECT user_dolg.id , user_dolg.date, user_dolg.user_id, user_dolg.dolg_id, user_dolg.dogovorNomer, user_dolg.dogovor_name, user_dolg.object, user_dolg.vidraboty, user_dolg.hours, user_dolg.user_change,
predprijatie.all_name,
users.name, users.users_id ,users.mesto_rab , users.doljnost
FROM users
INNER JOIN user_dolg ON user_dolg.user_id = users.users_id
INNER JOIN predprijatie ON user_dolg.dolg_id = predprijatie.pred_id
WHERE `date` BETWEEN 2019-04-01 AND 2019-04-30 AND users_id <> 34