use POST prior to GET for stock_id
[order_line_extra.git] / item_schedule.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $path_to_root = "../..";
13
14 include_once($path_to_root . "/includes/session.inc");
15 include_once($path_to_root . "/includes/ui/ui_lists.inc");
16 include_once($path_to_root . "/includes/ui/ui_globals.inc");
17 include_once($path_to_root . "/includes/ui/ui_input.inc");
18 include_once($path_to_root . "/reporting/includes/reporting.inc");
19
20 //include_once("includes/item_scheduler.inc");
21 include_once("hincludes/lib/php/Boot.class.php");
22
23 $page_security = 'SA_ORDERLINEX_EDIT';
24 add_access_extensions();
25
26 $_SESSION['page_title'] = _($help_context = "Item schedule");
27
28
29 $js = "";
30 page($_SESSION['page_title'], false, false, "", $js);
31
32 //---------------------------------------------------------------------------------------------
33
34 start_form();
35
36 start_table(TABLESTYLE_NOBORDER);
37 start_row();
38
39 ?>GET<?php
40 print_r($_GET);
41 ?>POST<?php
42 print_r($_POST);
43
44 if (!isset($_POST['stock_id'])) {
45 if (isset($_GET['stock_id']))
46 {
47         $_POST['stock_id'] = $_GET['stock_id'];
48 }
49 else {
50         $_POST['stock_id'] = get_global_stock_item();
51         }
52 }
53
54 //if (!@$_GET['popup'])
55         start_form();
56
57
58 $stock_id = $_POST['stock_id'];
59         stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
60
61 end_row();
62 end_table(1);
63
64 $scheduler = new ItemScheduler($stock_id, 'DEF');
65
66 div_start('item_schedule');
67 start_table(TABLESTYLE);
68 $th = $scheduler->tableHeader();
69
70 table_header($th);
71
72 $scheduler->generateTable();
73
74 end_table();
75 div_end();
76
77
78 submit_center_first('Update', _("Update"), '', 'default', false);
79 submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
80
81
82
83 end_form();
84 end_page();
85 ?>
86 <style type='text/css'>
87 tr.partial {
88         color: darkred;
89 }
90
91 tr.partial  td:nth-child(5) {
92         background: pink;
93 }
94
95 tr.location {
96         font-weight: normal;
97                 background: #8f8;
98 }
99 tr.on_time {
100 }
101
102 tr.late {
103                 background: #fc8;
104 }
105
106 tr.soldout {
107                 background: pink;
108 }
109
110 tr.tDnD_whileDrag {
111         background: #ccc;
112         border: 2px solid black;
113 }
114 tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
115         color: transparent;
116         background: transparent;
117 }
118 </style>
119 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
120 <script src="js/jquery.tablednd.0.8.min.js"></script>
121 <script text="text/javascript">
122         console.log('hello')
123         $(document).ready(function() {
124                 console.log('ready')
125                 $('#item_schedule table').tableDnD({
126                         onDragStart: function (table, row) {
127                                         console.log(table)
128                                         console.log(row)}
129                         ,onDrop: function (table, row) {
130                                         console.log(table)
131                                         console.log(row)}
132                 })
133         }
134         )
135 </script>