Add Ajax : change stock_id update page.
[order_line_extra.git] / item_schedule.php
index 0fa2aa7e5375cf8941606f7a71b0e92acdad0e8a..45bbfd60a07a96e183c5c18dcb2774efaf17b9b5 100644 (file)
@@ -1,4 +1,3 @@
-
 <?php
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
@@ -37,16 +36,26 @@ start_form();
 start_table(TABLESTYLE_NOBORDER);
 start_row();
 
+?>GET<?php
+print_r($_GET);
+?>POST<?php
+print_r($_POST);
+
+if (!isset($_POST['stock_id'])) {
 if (isset($_GET['stock_id']))
 {
        $_POST['stock_id'] = $_GET['stock_id'];
 }
+else {
+       $_POST['stock_id'] = get_global_stock_item();
+       }
+}
+if (list_updated('stock_id')) 
+       $Ajax->activate('item_schedule');
 
 //if (!@$_GET['popup'])
        start_form();
 
-if (!isset($_POST['stock_id']))
-       $_POST['stock_id'] = get_global_stock_item();
 
 $stock_id = $_POST['stock_id'];
        stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
@@ -68,11 +77,61 @@ end_table();
 div_end();
 
 
-submit_center_first('Update', _("Update"), true, '', 'default', true);
-submit_center_last('Cancel', _("Cancel"), true, '', 'cancel', true);
+submit_center_first('Update', _("Update"), '', 'default', false);
+submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
 
 
 
 end_form();
 end_page();
 ?>
+<style type='text/css'>
+tr.partial {
+       color: darkred;
+}
+
+tr.partial  td:nth-child(5) {
+       background: pink;
+}
+
+tr.location {
+       font-weight: normal;
+               background: #8f8;
+}
+tr.on_time {
+}
+
+tr.late {
+               background: #fc8;
+}
+
+tr.soldout {
+               background: pink;
+}
+
+tr.tDnD_whileDrag {
+       background: #ccc;
+       border: 2px solid black;
+}
+tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
+       color: transparent;
+       background: transparent;
+}
+</style>
+<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
+<script src="js/jquery.tablednd.0.8.min.js"></script>
+<script text="text/javascript">
+       console.log('hello')
+       $(document).ready(function() {
+               console.log('ready')
+               $('#item_schedule table').tableDnD({
+                       onDragStart: function (table, row) {
+                                       console.log(table)
+                                       console.log(row)}
+                       ,onDrop: function (table, row) {
+                                       console.log(table)
+                                       console.log(row)}
+               })
+       }
+       )
+</script>