<?php


function T_WORKPOINTS_USER_SELECT( $cmd, $value ) {
	global $result, $thiss;

	if ($cmd == 'POST_VERIFY') {
		return;
	}

	$field_name = 'T_WORKPOINTS_USER';
	$select_list = array();

	$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
	";
	ZAP_SQL( $sql );
	//echo "select * from ADMIN_USERS where A_STATUS='NORMAL' and ADM_TECH_WORKER!='NO' and ADM_COMPANY like '$_SESSION[ADM_COMPANY]'";

	while ($r = mysql_fetch_object($result)) {
		$select_list [$r->ADM_ACCOUNT] = "" . $r->ADM_NAME . " (" . $r->ADM_ACCOUNT . ")";
	}

	echo '<select name="' . $field_name . '">';
		echo ' <option value="">' . " " . '</option>';
		foreach ($select_list as $key => $val) {
			$sel = ($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD'][$field_name] == $key)? ' selected="selected"' : '';
			echo '<option value="' . $key . '"' . $sel . '>' . $val . '</option>';
		}
	echo '</select>';
}
