Pridan assistant s jedinym okynkem pro naskladneni dle caroveho kodu
[mirrors/SokoMan.git] / assistants / store.inc.php
diff --git a/assistants/store.inc.php b/assistants/store.inc.php
new file mode 100644 (file)
index 0000000..8af2da6
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+$script = $_SERVER['SCRIPT_NAME'].'/assistant/store';
+switch($step) {
+       default: case 1:
+?>
+<form action="<?=$script?>/2" method="GET">
+       model_barcode: <input type="text" name="barcode" />
+       <input type="submit" value="STORE" />
+</form>
+<?php
+               break;
+       case 2:
+               $model_id = $this->db->map_unique('model_barcode', $_GET['barcode'], 'model_id', 'model');
+               $columns = $this->db->get_columns('item');
+    $selectbox = $this->db->columns_get_selectbox($columns, 'item');
+
+               //print_r(array('<pre>', $selectbox));
+               //foreach($selectbox['model_id'] as $id => $name) if($id != $model_id) unset($selectbox['model_id'][$id]);
+               $current = array(array(
+                       'model_id' => $model_id,
+                       'item_quantity' => 1,
+                       'status_id' => 1
+               ));
+
+               $action = $_SERVER['SCRIPT_NAME'].'/item/new';
+    echo $this->html->render_insert_form('item', $columns, $selectbox, $current, false, $action);
+               break;
+}
This page took 0.097555 seconds and 4 git commands to generate.