-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
93 lines (85 loc) · 2.67 KB
/
add.php
File metadata and controls
93 lines (85 loc) · 2.67 KB
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
<?php
include('includes/preferences.php');
$con = mysql_connect($server, $dbusername, $dbpassword);
if (!$con){
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db, $con);
include('functions.php');
$cans = getCanList();
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="js/functions.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("#tabs").tabs();
});
function addRow(){
document.getElementById('addSkus').innerHTML += '<tr><td><input type="text" id="sku[]" name="sku[]" /></td><td><input type="text" id="qty[]" name="qty[]" /></td></tr>';
}
function addPalletRow(){
document.getElementById('addSkusToPallet').innerHTML += '<tr><td><input type="text" id="sku[]" name="sku[]" /></td><td><input type="text" id="qty[]" name="qty[]" /></td></tr>';
}
</script>
</head>
<body>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Add Parts</a></li>
<li><a href="#tabs-2">Create Pallet</a></li>
</ul>
<div id="tabs-1">
<form action="addResponse.php?mode=sku" method="post">
<label>Add To Can: <select name="can-select" id="can-select">
<?php
foreach($cans as $can){
print '<option value="'.$can['id'].'">'.$can['name'].'</option>';
}
?>
</select></label><br />
<table id="addSkus">
<tr>
<th>Sku</th>
<th>Qty.</th>
</tr>
<tr>
<td><input type="text" name="sku[]" /></td>
<td><input type="text" name="qty[]" /></td>
</tr>
</table>
<button type="button" onClick="addRow()">Add Row</button>
<input type="submit" />
</form>
</div>
<div id="tabs-2">
<form action="addResponse.php?mode=pallet" method="post">
<label>Add To Can: <select name="can-select" id="can-select">
<?php
foreach($cans as $can){
print '<option value="'.$can['id'].'">'.$can['name'].'</option>';
}
?>
</select></label><br />
<label>Pallet Description: <input type="text" name="description" id="description" /></label><br />
<table id="addSkusToPallet">
<tr>
<th>Sku</th>
<th>Qty.</th>
</tr>
<tr>
<td><input type="text" name="sku[]" /></td>
<td><input type="text" name="qty[]" /></td>
</tr>
</table>
<button type="button" onClick="addPalletRow()">Add Row</button>
<input type="submit" />
</form>
</div>
</div>
</body>
</html>