-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_offer.php
36 lines (31 loc) · 914 Bytes
/
update_offer.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
<?PHP
include_once('connect.php');
include('./inc/cleeng/cleeng_api.php');
$offerid = $_POST['offerid'];
$title = $_POST['title'];
$price = $_POST['price'];
$desc = $_POST['desc'];
$tags = $_POST['tags'];
$clientid = $_POST['clientid'];
$offerSetup = array(
'title' => $title,
'price' => $price,
'description' => $desc,
'accessToTags' => $tags,
);
$cleengApi = new Cleeng_Api();
if (cleeng_sandbox == '1') {
$cleengApi->enableSandbox();
$cleengApi->setPublisherToken(cleeng_sandbox_token);
} else {
$cleengApi->setPublisherToken(cleeng_token);
}include_once('connect.php');
$offer = $cleengApi->updatePassOffer($offerid, $offerSetup);
if ($offer->id) {
//header('edit_sub_offers.php');
Echo "Subscription Offer Updated Sucessfully.";
header('Location: list_offers.php?id='. $clientid);
} else {
echo "ERROR.";
}
?>