$link->real_query("SELECT * FROM items");
$res = $link->use_result();
echo "Result set order...\n";
while ($row = $res->fetch_assoc()) {
    echo $row['id'] . " " . $row['email'] . " " . $row['phone'];
}
$link->close();
// creating sns topic
$topicArn = $sns->createTopic(['Name' => 'MP2-sns-test']);
echo "<p/>";
echo "ARN is:";
echo $topicArn['TopicArn'];
$topicAttributes = $sns->setTopicAttributes(['TopicArn' => $topicArn['TopicArn'], 'AttributeName' => 'DisplayName', 'AttributeValue' => 'MP2-alert']);
echo "<p/>";
echo "Created display name";
if (isSubscribed($email)) {
    echo "</p> The email: " . $email . " is already subscribed";
} else {
    $listedSubscriptions = $sns->listSubscriptions(array());
    echo $listedSubscriptions;
    echo "</p> Subscriptions: " . $listedSubscriptions->get('Subscriptions');
    echo "</p> TopicArn: " . $listedSubscriptions->get('TopicArn');
    $topicSubscribe = $sns->subscribe(array('TopicArn' => $topicArn['TopicArn'], 'Protocol' => 'email', 'Endpoint' => $email));
    echo "<p/>";
    echo "Please check your email and confirm subsciption";
    ?>

<form enctype="multipart/form-data" action="confirmsubscription.php" method="POST">
    <input type="hidden" name="email" value="<?php 
    echo $email;
    ?>
function displayTopicFlat($itemId)
{
    global $h, $db, $config;
    if (!is_numeric($itemId)) {
        return false;
    }
    echo '<div class="forum_overview_group">';
    $item = getForumItem($itemId);
    echo getForumDepthHTML(FORUM_MESSAGE, $item['parentId']) . '<br/><br/>';
    showForumPost($item);
    if ($h->session->id) {
        if (!isSubscribed(SUBSCRIPTION_FORUM, $itemId)) {
            echo '<a href="?id=' . $itemId . '&subscribe=' . $itemId . '">Subscribe to topic</a><br/><br/>';
        } else {
            echo '<a href="?id=' . $itemId . '&unsubscribe=' . $itemId . '">Unsubscribe to topic</a><br/><br/>';
        }
    }
    $tot_cnt = getForumItemCountFlat($itemId);
    $pager = makePager($tot_cnt, $config['forum']['posts_per_page']);
    $list = getForumItems($itemId, true, $pager['limit']);
    //get replies
    echo $pager['head'];
    if ($list) {
        foreach ($list as $row) {
            showForumPost($row, $item['locked']);
        }
    }
    echo '</div>';
}
Beispiel #3
0
<?php

include "include.php";
if (!isSubscribed($_SESSION["customer_ref"])) {
    header("location:billing.php");
    exit;
}
if (isset($_POST["cancel"])) {
    try {
        $cancelSub = $fastspring->cancelSubscription($_SESSION["subscription_ref"]);
    } catch (FsprgException $cancelEx) {
        // Error can be handled here
    }
} elseif (isset($_POST["renew"])) {
    try {
        $fastspring->renewSubscription($_SESSION["subscription_ref"]);
    } catch (FsprgException $renewEx) {
        // Error can be handled here
    }
} elseif (isset($_POST["update"])) {
    $update = new FsprgSubscriptionUpdate($_SESSION["subscription_ref"]);
    if (isset($_POST["productPath"])) {
        $update->productPath = $_POST["productPath"];
    }
    if (isset($_POST["tags"])) {
        $update->tags = $_POST["tags"];
    }
    if (isset($_POST["quantity"])) {
        $update->quantity = $_POST["quantity"];
    }
    if (isset($_POST["coupon"])) {
Beispiel #4
0
<?php

include "include.php";
/** Get the customer's ref */
$customer_ref = $_SESSION["customer_ref"];
if (isSubscribed($customer_ref)) {
    $redirectToUrl = "subpage1.php";
    header("Location: {$redirectToUrl}");
} else {
    $fastspring->createSubscription(product_id, $customer_ref);
}
exit;