select re.repair_id,re.repair_date,re.repair_time,re.personal_end,pro.units_name,ca.name_work,re.repair_detail,re.repair_status,re.time_end,us.name_user,us.surname_user from tb_repair as re left join TIN_UNITS_PROFILES as pro on(re.repair_groud=pro.units_id)
left join tb_Groub_Repair as ca on (re.cause=ca.id_work)left join tb_userrepair as us on (re.personal=us.id_user)
where repair_date='$date' order by repair_status,repair_time ASC