<?php $association_level = empty($bc_label_auto_trigger->association_level) ? $association_level : $bc_label_auto_trigger->association_level; switch ($association_level) { case 'SITE': echo $f->text_field('association_level_value', 'SITE', '', '', '', 1, 1); break; case 'BUSINESS': echo $f->select_field_from_object('association_level_value', $org->findAll_business(), 'org_id', 'org', ${$class}->association_level_value, '', '', 1); break; case 'INVENTORY': echo $f->select_field_from_object('association_level_value', $org->findAll_inventory(), 'org_id', 'org', ${$class}->association_level_value, '', '', 1); break; case 'FROM_SUBINV': $org_id_sub = null; if (!empty(${$class}->association_level_value)) { $subinv_i = subinventory::find_by_id(${$class}->association_level_value); $org_id_sub = $subinv_i->org_id; } echo $f->select_field_from_object('', $org->findAll_inventory(), 'org_id', 'org', $org_id_sub, '', 'org_id', 1); echo '</td><td>'; echo $f->select_field_from_object('association_level_value', subinventory::find_all(), 'subinventory_id', array('subinventory', 'org_id'), ${$class}->association_level_value, '', 'subinventory_id', 1); break; case 'USER': echo $f->select_field_from_object('association_level_value', user::find_all(), 'user_id', 'username', ${$class}->association_level_value, '', '', 1); break; } ?> </td> <td> <?php echo $f->select_field_from_object('bc_label_format_header_id', bc_label_format_header::find_all(), 'bc_label_format_header_id', 'format_name', ${$class}->bc_label_format_header_id, '', '', 1) . "</td>";