<?php


function T_APPOITMENT_USER_SELECT() {
global $thiss,$result;
ZAP_SQL("select * from ADMIN_USERS where A_STATUS='NORMAL' and ADM_TECH_WORKER!='NO' and ADM_COMPANY like '$_SESSION[ADM_COMPANY]' ORDER BY ADM_NAME ASC");
	echo "<select name=L_APPOITMENT_USER><option value=''> </option>
 ";
        while ($h=mysql_fetch_row($result)) {
	echo "<option value='" . $h[$_SESSION['ADMIN_COLUMN']['DESC_TO_KEY']['ADM_ACCOUNT']] . "'" ;
         if ($_SESSION['CURRENT_MENU'] == 'USERS_EDIT') {
          if ($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDIT_TEMPLATE']['L_APPOITMENT_USER'] == $h[$_SESSION['ADMIN_COLUMN']['DESC_TO_KEY']['ADM_ACCOUNT']])	echo "selected";
         } else {
          if($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['L_APPOITMENT_USER'] == $h[$_SESSION['ADMIN_COLUMN']['DESC_TO_KEY']['ADM_ACCOUNT']])	echo "selected";
         }
	echo ">" . $h[$_SESSION['ADMIN_COLUMN']['DESC_TO_KEY']['ADM_NAME']] . "(". $h[$_SESSION['ADMIN_COLUMN']['DESC_TO_KEY']['ADM_ACCOUNT']] . ")</option>" ;
	}
	echo "</select>";
}
