-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist_all_sub_offers.php
67 lines (52 loc) · 1.45 KB
/
list_all_sub_offers.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
<?php
include('connect.php');
include('./inc/cleeng/cleeng_api.php');
$cleengApi = new Cleeng_Api();
$cleengApi->setPublisherToken('LKL4ZSQhJHNnGLizJAioriOWwV0gbZaSaOKdB28uUVAuhiwj');
$offerList = $cleengApi->listSubscriptionOffers(array(), 0, 5);
?>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include('menu.php'); ?>
<div id="content">
<h2>Master List of Active Subscription Offers</h2>
<?php
$totalOffers = $offerList->totalItemCount;
echo 'There are ' . $totalOffers . ' total offers.<br><br>';
echo var_dump($offerList); //this is the raw response to be decoded
echo '<br><br>';
echo '<br><br>';
/* this may be used for pagination
$count = 0;
while ($count < $totalOffers) {
echo $offerList->items[$count]->title . '<br>';
echo $offerList->items[$count]->id . '<br>';
// echo $offer->publisherEmail . '<br>';
// echo $offer->url . '<br>';
// echo $offer->description . '<br>';
// echo $offer->currency . '<br>';
// echo $offer->price . '<br>';
// echo $offer->tags[1] . '<br>';
// echo $offer->contentType . '<br>';
echo '<hr>';
$count = $count + 1;
} */
foreach ($offerList->items as $offer) {
echo $offer->title . '<br>';
echo $offer->id . '<br>';
echo $offer->publisherEmail . '<br>';
echo $offer->url . '<br>';
echo $offer->description . '<br>';
echo $offer->currency . '<br>';
echo '$' . $offer->price . '<br>';
echo $offer->period . '<br>';
echo '<br>';
echo '<hr>';
}
?>
</div>
</body>
</html>