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