Adding Haxe
authorMaxime Bourget <bmx007@gmail.com>
Mon, 27 May 2013 16:45:30 +0000 (17:45 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Mon, 27 May 2013 16:47:00 +0000 (17:47 +0100)
haxe/ItemScheduler.hx [new file with mode: 0644]
item_schedule.php
makefile [new file with mode: 0644]

diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx
new file mode 100644 (file)
index 0000000..92d0212
--- /dev/null
@@ -0,0 +1,28 @@
+import php.Lib;
+class ItemScheduler {
+       var stock_id:String;
+       function new(stock_id: String) {
+               this.stock_id = stock_id;
+       }
+
+       function tableHeader() {
+               return ["A", "B", "C"];
+       }
+
+       function generateTable(): Void {
+               for(schedule in this.schedules()) {
+                       this.formatRow(schedule);
+               }
+       }
+
+       function formatRow(row) {
+               php.Lib.print('<tr><td>helli</td></tr>');
+               
+       }
+
+       function schedules() {
+               return ["a", "b", "c"];
+       }
+}
+
+
index 6a7614f78086963a7b8d3ddaf6880d578c87fcfb..329d6fcc6a276d933289758fbd202c54f4afc822 100644 (file)
@@ -18,7 +18,8 @@ include_once($path_to_root . "/includes/ui/ui_globals.inc");
 include_once($path_to_root . "/includes/ui/ui_input.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
 
-//include_once("includes/item_schedule.inc");
+//include_once("includes/item_scheduler.inc");
+include_once("hincludes/lib/php/Boot.class.php");
 
 $page_security = 'SA_ORDERLINEX_EDIT';
 add_access_extensions();
@@ -41,21 +42,37 @@ if (isset($_GET['stock_id']))
        $_POST['stock_id'] = $_GET['stock_id'];
 }
 
-if (!@$_GET['popup'])
+//if (!@$_GET['popup'])
        start_form();
 
 if (!isset($_POST['stock_id']))
        $_POST['stock_id'] = get_global_stock_item();
 
-       stock_costable_items_list_cells(_("Item:"), 'stock_id', $_POST['stock_id']);
+$stock_id = $_POST['stock_id'];
+       stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
 
 end_row();
-
 end_table(1);
 
+$scheduler = new ItemScheduler($stock_id);
+
+div_start('item_schedule');
+start_table(TABLESTYLE);
+$th = $scheduler->tableHeader();
+
+table_header($th);
+
+$scheduler->generateTable();
+
+end_table();
+div_end();
+
+
 submit_center_first('Update', _("Update"), true, '', 'default', true);
 submit_center_last('Cancel', _("Cancel"), true, '', 'cancel', true);
 
-       end_form();
-       end_page();
+
+
+end_form();
+end_page();
 ?>
diff --git a/makefile b/makefile
new file mode 100644 (file)
index 0000000..ade68e8
--- /dev/null
+++ b/makefile
@@ -0,0 +1,2 @@
+compile:
+       (cd haxe; haxe -php ../hincludes *)