-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-addons.php
71 lines (66 loc) · 2 KB
/
get-addons.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
<?php
#20111213 #1581:sougata
#201201160211 #1631:sougata
include("LIB/lib.php");
//$h = new HAPI();
$h = new HAPI(CH_KEY, CH_SEC);
$xmlDom = $h->getAddons($_REQUEST['itemId']);
//print $xmlDom->saveXML();
$curCode = '';
$addons = $xmlDom->getElementsByTagName('addon');
if($addons->item(0))
{
$curCode = $addons->item(0)->getAttribute('currencyCode');
}
$attached = $_REQUEST['attached'];
$attachedArr = explode(",", $attached);
?>
<style>#ssb-container {
display: none !important;
}</style>
<form method="POST" action="<?php echo site_url(); ?>/add-addons" name="frm" id="frm">
<input type="hidden" name="itemId" value="<?php echo $_REQUEST['itemId']?>"/>
<div class="table-responsive cart">
<table style="width:100%;" class="simple-table">
<tr class="table-bg">
<td> </td>
<td><strong>Inclusions</strong></td>
<td><strong>Description</strong></td>
<td><strong>Price</strong></td>
</tr>
<?php
if($addons->length>0)
{
foreach ($addons as $addon)
{
$checked = '';
if(in_array($addon->getAttribute("id") , $attachedArr))
$checked = ' checked="checked" ';
?>
<tr>
<td width="6%">
<input type="checkbox" <?php echo $checked;?> name="addchk[]"
value="<?php echo $addon->getAttribute("id") ?>" /></td>
<td width="24%">
<?php echo $addon->getAttribute('title'); ?><br>
<span class="colorgrey01" style="font-size:10px;"></span>
</td>
<td width="39%">
<?php echo $addon->getAttribute('description'); ?></td>
<td width="13%">
<?php echo displayPrice($addon->getAttribute('price'), $curCode); ?><br></td>
</tr>
<?php
}
?>
<tr class="table-bg">
<td colspan="4" align="center">
<input class="table-button" type="button" name="btnAddons" value="Add" onclick="addAddonsfrmSubmit()"/>
</td>
</tr>
<?php
}
?>
</table>
</div>
</form>