label_cell($myrow["name"]); label_cell($myrow["decimals"]); edit_link_cell(SID . "selected_id={$myrow['0']}"); delete_link_cell(SID . "selected_id={$myrow['0']}&delete=yes"); end_row(); } end_table(); //---------------------------------------------------------------------------------- hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Unit of Measure")); start_form(); start_table("class='tablestyle_noborder'"); if (isset($selected_id)) { //editing an existing item category $myrow = get_item_unit($selected_id); $_POST['abbr'] = $myrow["abbr"]; $_POST['description'] = $myrow["name"]; $_POST['decimals'] = $myrow["decimals"]; hidden('selected_id', $selected_id); } if (isset($selected_id) && item_unit_used($selected_id)) { label_row(tr("Unit Abbreviation:"), $_POST['abbr']); hidden('abbr', $_POST['abbr']); } else { text_row(tr("Unit Abbreviation:"), 'abbr', null, 20, 20); } text_row(tr("Descriptive Name:"), 'description', null, 40, 40); text_row(tr("Decimal Places:"), 'decimals', null, 3, 3); end_table(1); submit_add_or_update_center(!isset($selected_id)); end_form(); end_page();
inactive_control_cell($myrow["abbr"], $myrow["inactive"], 'item_units', 'abbr'); edit_button_cell("Edit" . $myrow["abbr"], _("Edit")); delete_button_cell("Delete" . $myrow["abbr"], _("Delete")); end_row(); } inactive_control_row($th); end_table(1); //---------------------------------------------------------------------------------- start_table(TABLESTYLE2); if ($selected_id != '') { if ($Mode == 'Edit') { //editing an existing item category $myrow = get_item_unit($selected_id); $_POST['abbr'] = $myrow["abbr"]; $_POST['description'] = $myrow["name"]; $_POST['decimals'] = $myrow["decimals"]; } hidden('selected_id', $selected_id); } if ($selected_id != '' && item_unit_used($selected_id)) { label_row(_("Unit Abbreviation:"), $_POST['abbr']); hidden('abbr', $_POST['abbr']); } else { text_row(_("Unit Abbreviation:"), 'abbr', null, 20, 20); } text_row(_("Descriptive Name:"), 'description', null, 40, 40); number_list_row(_("Decimal Places:"), 'decimals', null, 0, 6, _("User Quantity Decimals")); end_table(1); submit_add_or_update_center($selected_id == '', '', 'both'); end_form(); end_page();