<?php


function T_TELBOX_BUILDING_IN( $cmd ) {
global $thiss,$result;

if ($cmd == 'POST_VERIFY') {

} else {

	$sql = "select ID, S_ADDRESS_STREET
		from `BUILDINGS`
		where 1=1
			-- and A_STATUS='NORMAL'
		order by S_ADDRESS_STREET asc
	";
	ZAP_SQL($sql);
	echo '<select name="'."T_TELBOX_BUILDING_IN".'">'.'<option value="">'." ".'</option>';
	while ($h = mysql_fetch_object($result)) {
		$sel = '';
		if ($_SESSION['CURRENT_MENU'] !== 'USERS_EDIT') {
			if (strtoupper($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDIT_TEMPLATE']['T_TELBOX_BUILDING_IN']) == strtoupper($h->S_ADDRESS_STREET))	$sel = ' selected="selected"';
		}
		echo '<option value="' . $h->S_ADDRESS_STREET . '"'.$sel.'>' . $h->S_ADDRESS_STREET . '</option>';
	}
	echo '</select>';
	if (!empty($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDIT_TEMPLATE']['T_TELBOX_BUILDING_IN'])) {
		echo' ('.$_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDIT_TEMPLATE']['T_TELBOX_BUILDING_IN'].')';
	}
}

}
