summaryrefslogtreecommitdiff
path: root/trunk/reprap/web/part-lister/views/supplier.digikey_parts_list.php
blob: 62e519d8d74bfa24c858c092eaee1a39857ca525 (plain)
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

<? if (!empty($parts)): ?>
	<FORM METHOD=POST ACTION='http://sales.digikey.com/scripts/sales.dll'>
		<INPUT TYPE=HIDDEN NAME='action' VALUE='checkfastadd'>
		<INPUT TYPE=HIDDEN NAME='source' VALUE='fastadd'>
		<table width="100%">
			<tr>
				<th>Part #</th>
				<th>Name</th>
				<th>Math</th>
				<th>Quantity</th>
			</tr>
			<? $i=1; ?>
			<? foreach ($parts AS $part): ?>
				<? $unique = new UniquePart($part->get('part_id')) ?>
				<? $url = $part->getBuyUrl() ?>
				<tr>
					<td>
						<INPUT TYPE="hidden" NAME='cref<?=$i?>' value="<?=$unique->get('name')?>"/>
						<INPUT TYPE="hidden" NAME='part<?=$i?>' value="<?=$part->get('part_num')?>"/>
						<?=$part->get('part_num')?>
					</td>
					<td>
						<a href="<?=$unique->getViewUrl()?>"><?=$unique->get('name')?></a>
					</td>
					<td>
						<?=$part->get('total_quantity')?> <?=$unique->get('units')?> needed / 
						<?=$part->get('quantity')?> <?=$unique->get('units')?> per unit
					</td>
					<td>
						<INPUT TYPE=TEXT NAME='qty<?=$i?>' size="3" value="<?=$part->orderQuantity()?>"/>
					</td>
				</tr>
				<? $i++ ?>
			<? endforeach ?>
			<tr>
				<td colspan="4"><input type="submit" NAME='Add List To Order' value="Click here to order above list from DigiKey"/></td>
			</tr>
		</table>
	</form>
<? else: ?>
	<b>No parts found.</b>
<? endif?>