/var/www/enzatesting.onesolution.hk/01_20240711_full_backup/inv_accessory_addform.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?php $formid "Accessory";
require_once 
"inc/configure.php";

$row null;

 
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$system_var['COMPANY_NAME']?></title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<?php require_once "inc/jsheader.php"?>
<script>
$(document).ready(function(){
    $('#enableABOM').change(function(){
        if( $('#enableABOM').attr('checked') ){
            $('#abom_table').show();    
        }else{
            $('#abom_table').hide();
        }
    });
    
    $('#enableABOM').change();
    
    //sync the 2 mattype dropdown
    $('.mattype').change(function() { // When first list changes
        var index = $('option:selected', this).index(); // Find selected item's index
        $('.mattype').each(function() { // For each other list
            //alert('mt');
            $(this).val($('option:eq(' + index + ')', this).val()); // Find the matching item
        });
    });
    
    $('.uom_cy').change(function() { // When first list changes
        var index = $('option:selected', this).index(); // Find selected item's index
        $('.uom_cy').each(function() { // For each other list
            //alert('c');
            $(this).val($('option:eq(' + index + ')', this).val()); // Find the matching item
        });
    });
    
    $('.uom_wt').change(function() { // When first list changes
        var index = $('option:selected', this).index(); // Find selected item's index
        $('.uom_wt').each(function() { // For each other list
            //alert($(this).attr("name"));
            $(this).val($('option:eq(' + index + ')', this).val()); // Find the matching item
        });
    });
    
    $('.uom_unitwt').change(function() { // When first list changes
        var index = $('option:selected', this).index(); // Find selected item's index
        $('.uom_unitwt').each(function() { // For each other list
            //alert($(this).attr("name"));
            $(this).val($('option:eq(' + index + ')', this).val()); // Find the matching item
        });
    });
    
    $(".weight").bind("keyup paste change", function() {
        $(".weight").val($(this).val());
        //alert('chang');
    });
    
    $('.uom_cy').change(function() { // When first list changes
        var index = $('option:selected', this).index(); // Find selected item's index
        $('.uom_cy').each(function() { // For each other list
            //alert($(this).attr("name"));
            $(this).val($('option:eq(' + index + ')', this).val()); // Find the matching item
        });
    });
    
    $('.uom_price').change(function() { // When first list changes
        var index = $('option:selected', this).index(); // Find selected item's index
        $('.uom_price').each(function() { // For each other list
            //alert($(this).attr("name"));
            $(this).val($('option:eq(' + index + ')', this).val()); // Find the matching item
        });
    });
    
    $(".price").bind("keyup paste change", function() {
        $(".price").val($(this).val());
        //alert('chang');
    });
    
    $('.mattype').change();
    $('.uom_cy').change();
    $('.uom_wt').change();
    $('.uom_unitwt').change();
    $('.weight').change();
    $('.uom_price').change();
    $('.price').change();
});
</script>
</head>
<body>

<form action="inv_accessory_add.php" id="myform" method="post">
<input type="hidden" name="action" value="accessory_addform" />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" class="top"><?php require"mod_webhead.php"?></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top" class="menu_bg"><?php require"mod_menu.php"?></td>
        <td valign="top" class="padding1"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr></tr>
          <tr>
            <td class="c3_bg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="20" class="separator"><input type="image" src="image/icon_save.jpg" width="20" height="20" class="pressnhide2" /></td>
                <td width="20" class="separator"><a href="<?=basename($_SERVER['REQUEST_URI'])?>"><img src="image/icon_undo.jpg" width="20" height="20" /></a></td>
                <!--<td width="20" class="separator"><img src="image/icon_redo.jpg" width="20" height="20" /></td>
                <td width="20" class="separator"><img src="image/icon_delete.jpg" width="20" height="20" /></td>-->
                <td class="separator stext1"><?=ACCESSORY?> - <span><?=ADD?></span></td>
                <td class="separator etext1"><?=$row['itemno']?> - <span><?=$row['name']?></span></td>
                <!--<td width="200" align="right" class="separator etext2">Last Modified: <?=$row['lastupdate']?></td>-->
                <td width="80" align="right" class="separator etext2"><a href="inv_accessory_index.php?act=resume" onclick="return ConfirmSave('myform')" class="closebtn"><?=CLOSE?></a>
                <input type="hidden" name="godest" id="godest" />
                <input type="hidden" name="formdest" value="inv_accessory_index.php?act=resume" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td valign="top" class="c2_bg">
            <!--main form-->
            

    <div id="tabs" class="ui-tabs">
    <ul>
        <li><a href="#tabs-2"><?=GENERAL?></a></li>
        <li><a href="#tabs-3"><?=SEGMENTS?></a></li>
<?php if(havePermission("BMu")){//BM--------------------------------------?>
        <li><a href="#tabs-4"><?=BOM?></a></li>
<?php //End of BM-------------------------------------------------------?>
    </ul>
    <div id="scontent">
        <div id="tabs-2">
        <p><table width="100%" border="0">
    <tr>
        <td width="60px"><?=ITEMNO?></td>
        <td><?=$row['itemno']?><input type="hidden" name="itemno_gen" value="<?=$row['itemno']?>" id="itemno_gen" readonly/></td>
        <td width="60px"><?=NAME?></td>
        <td><input type="text" name="name" value="<?=$row['name_en']?>" id="name" size="40" /></td>
    </tr>
    <tr>        
        <td>&nbsp;</td>
        <td>&nbsp;</td>    
        <td><?=NAMESC?></td>
        <td><input type="text" name="cname" value="<?=$row['name_sc']?>" id="cname" size="40" /></td>
    </tr>
    <tr>        
        <td><?=ITEMGP?></td>
        <td><select name="itemgp"><?=master_option("ITEMGP"$row['itemgp'], true)?></select></td>    
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
<!--    <tr>        
        <td><?=ITEMBOM?></td>
        <td><input type="text" name="bom" value="<?=$row['bom']?>" id="bom" /></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>-->
    <tr>
        <td><?=WEIGHT?></td>
        <td colspan="3"><input type="text" name="weight" value="<?=$row['weight']?>" id="weight" class="positive weight shortfield" /><select name="uom_wt" class="uom_wt"><?=master_option("UOM_WT"$row['uom_wt'])?></select>/<select name="uom_unitwt" class="uom_unitwt"><?=master_option("UOM_UNITWT"$row['uom_unitwt'])?></select></td>
    </tr>
<?php if(havePermission("GPu")){ //GP-----------------------------------?>
    <tr>
        <td><?=PRICE?></td>
        <td colspan="3"><input type="text" name="price" value="<?=numf($row['price'],4)?>" id="price" class="positive price shortfield" /><select name="uom_cy" class="uom_cy"><?=master_option("UOM_CY"$row['uom_cy'])?></select>/<select name="uom_price" class="uom_price"><?=master_option("UOM_PRICE"$row['uom_price'])?></select></td>
    </tr>
<?php //END of GP--------------------------------------------------?>
</table></p>
    </div>
    
    
    <div id="tabs-3">
        <p><table width="100%" border="0">
    <tr>        
        <td><?=ACCSTYPE?></td>
        <td><select name="accstype"><?=master_option("ACCSTYPE"$row['accstype'], true)?></select></td>    
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>        
        <td><?=ACCSCATEGY?></td>
        <td><select name="accscategy"><?=master_option("ACCSCATEGY"$row['accscategy'], true)?></select></td>    
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><?=MATTYPE?></td>
        <td><select name="mattype"><?=master_option("MATTYPE"$row['mattype'], true)?></select></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><?=MATCOLOR?></td>
        <td><select name="matcolor"><?=master_option("MATCOLOR"$row['matcolor'], true)?></select></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><?=FINISHING?></td>
        <td><select name="finishing"><?=master_option("FINISHING"$row['finishing'], true)?></select></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><?=SIZE?></td>
        <td><input type="text" name="accssize" value="<?=$row['accssize']?>" size="6" maxlength="6"/><input type="text" name="accssize2d" value="<?=$row['accssize2d']?>" size="6" maxlength="6" class="positive" /></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr><td><?=VERIFIED?></td>
        <td><select name="verified"><?=master_option("VERIFIED"$row['verified'], true)?></select></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table><!--<input type="submit" name="submit" value="Save"/>&nbsp;--></p>
    </div>
<?php if(havePermission("BMu")){//BM--------------------------------------?>  
<div id="tabs-4">
        <p><label for="enableABOM"><?=ACTIVATE?><?=WS?><?=BOM?></label><input type="checkbox" name="abom[enable]" id="enableABOM" <?=$abom_enable?> />
        <table width="100%" id="abom_table">
        <tr>
            <td><?=LABOR?><?=WS?><?=PRICE?></td>
            <td>
                <input type="text" name="abom[labor_price]" value="<?=$abom['labor_price']?>" class="positive price" /><select name="abom[uom_cy]" class="uom_cy"><?=master_option("UOM_CY"$abom['uom_cy'])?></select>/<select name="abom[uom_labor]" class="uom_price"><?=master_option("UOM_PRICE"$abom['uom_labor'])?></select></td>
        </tr>
        <tr>
            <td><?=MATERIAL?><?=WS?><?=WEIGHT?></td>
            <td><select name="abom[mattype]" class="mattype"><?=master_option("MATTYPE"$abom['mattype'], true)?></select><input type="text" name="abom[weight]" value="<?=$abom['weight']?>" class="positive weight" /><select name="abom[uom_wt]" class="uom_wt"><?=master_option("UOM_WT"$abom['uom_wt'])?></select>/<select name="abom[uom_unitwt]" class="uom_unitwt"><?=master_option("UOM_UNITWT"$abom['uom_unitwt'])?></select></td>
        </tr>
        <tr>
            <td><?=MATERIAL?><?=WS?><?=PRICE?></td>
            <td>Material Price: <?=mattypeCost($abom['mattype'], 1$abom['uom_wt'])?>/<?=$abom['uom_wt']?><br />
<!--<?=mattypeCost($abom['mattype'], 1"ct")?>/ct<br />-->
<?=mattypeCost($abom['mattype'], $abom['weight'], $abom['uom_wt'], $abom['uom_unitwt'])?> (Material) + <?=accessoryLaborCost($abom['labor_price'], $abom['uom_labor'], $abom['weight'])?> (LABOR)<br />
<?=mattypeCost($abom['mattype'], $abom['weight'], $abom['uom_wt'], $abom['uom_unitwt'])+accessoryLaborCost($abom['labor_price'], $abom['uom_labor'], $abom['weight'])?></td>
        </tr>
        </table>
        </p>
    </div>    
<?php //end of BM--------------------------------------------------?>
    </div><!--end scontent-->
<input type="hidden" name="refid" value="<?=$refid?>" /><!--&nbsp;<input type="button" name="Close" value="Close" onclick="fbox_close(); location.href='stone_index.php?msg=Cancel'" style="float:right"/>-->
</div>

            <!-- end of mainform-->
            </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>