$db_query="SELECT bloks_banner.pos_blok as pos_blok, bloks_banner.width_blok as width_blok,
bloks_banner.height_blok as height_blok, bloks_banner.id_blok as id_blok,
bloks_banner.template_blok,
banners.id_banner as id_banner,
banners.filename as filename, banners.filetype as filetype, banners.link as link ,
banners.redirect as redirect, banners.new_window as new_window , banners.banner_text,
bloks_banner.align_blok as align_blok
from ".DB_PREF."bloks_banner bloks_banner inner join ".DB_PREF."banners banners
on bloks_banner.id_blok = banners.num_blok
where bloks_banner.name_part = '".codeText($name_part_write)."'
and bloks_banner.hide_blok='show' and banners.hide = 'show'
and (banners.kolview_limit = 0 or (banners.kolview_limit > 0 and banners.kolview < banners.kolview_limit))
and (banners.start_date = 0 or (banners.start_date > 0 and banners.start_date < ".$GLOBALS["timeGlobal"]."))
and (banners.end_date = 0 or (banners.end_date > 0 and banners.end_date > ".$GLOBALS["timeGlobal"]."))
";