<?php


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

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

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

	$sql = "select p.`ID`, p.`P_NAME`, p.`A_STATUS`
		from `USERS2_PRODUKT` as p
		where
			p.`A_STATUS`!='DELETED'
		order by `ID`
	";
	ZAP_SQL( $sql );
	while ($r = mysql_fetch_object( $result )) {
		$select_list [$r->ID] = $r->ID . ": " . $r->P_NAME . " (" . $r->A_STATUS . ")";
	}

	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>';
		}//end foreach
	echo '</select>';
}
