Commit | Line | Data |
---|---|---|
ec28d06c TM |
1 | <?php |
2 | //TODO: Merge SELL and DISPOSE to single file with parameter! | |
b895e8ea | 3 | //TODO: Highlight fields that should be filled (and maybe even check them when submited) |
ec28d06c TM |
4 | //TODO: Add support for selling/disposing multiple items at once... |
5 | //TODO: Reuse /item/$item_id/edit | |
de77377e | 6 | switch($SUBPATH[0]) { |
ec28d06c | 7 | default: case 1: |
35916247 TM |
8 | echo $this->html->form("$URL/2", 'GET', array( |
9 | array('serial','','text',false,'autofocus','item_serial:'), | |
10 | array(false,'SELL','submit') | |
11 | )); | |
ec28d06c TM |
12 | break; |
13 | case 2: | |
14 | $item_id = $this->db->map_unique('item_serial', $_GET['serial'], 'item_id', 'item'); | |
15 | $columns = $this->db->get_columns('item'); | |
16 | $selectbox = $this->db->columns_get_selectbox($columns, 'item'); | |
17 | ||
18 | $current = $this->db->get_listing('item', $item_id, 1); | |
19 | $current[$item_id]['status_id'] = 3; | |
20 | ||
21 | $action = $_SERVER['SCRIPT_NAME']."/item/$item_id/edit"; | |
22 | echo $this->html->render_insert_form('item', $columns, $selectbox, $current, false, $action); | |
23 | break; | |
24 | } |