Пример #1
0
<?php

require_once 'sprd/ShirtOfDay.php';
// initialize spreadshirt library (load data)
$aod = new ShirtOfDay();
?>
    <div class="sprdShirtArea">
      <h2>Donate us!</h2>
      <div id="test" title="Donate us and buy our shirt!<BR/> Click here for more informations.">
        <div id="testee" class="sprdHeadline">Buy our shirt !</div>
        <div id="article-button" class="sprdArticleButton" align="center">
          <?php 
echo $aod->getArticlePreviewImage("1", "200", "200");
?>
        </div>
      </div>
      <div>
        Untersützt uns mit dem Kauf eines T-Shirts zum Preis von <?php 
echo $aod->getPriceString();
?>
        <a title="Details" class="sprdDetailsButton" href="#"><em>mehr Infos...</em></a>
      </div>
      <div class="sprdArticleDetails">
        Mit jedem verkauften
        <?php 
echo "<strong>" . $aod->getShortName() . " </strong>";
?>
 unterstützt Ihr
        die Weiterentwicklung unserer Website.
        <div id="buynow" class="sprdArticleButton">jetzt kaufen</div>
      </div>
Пример #2
0
<?php

// helper routine: collect the checkout data (size, appearance) and redirect
// to index.[html, php] or to the spreadshirt checkout
require_once 'ShirtOfDay.php';
// initialize spreadshirt library (load data)
$aod = new ShirtOfDay();
$checkoutURL = $aod->goToCheckout($_POST['size'], $_POST['appearance']);
// redirect to your website root document (index.php) because
// the checkout url could not resolved
if ($checkoutURL === NULL) {
    echo "Sorry, the parameters are not valid!";
    echo '<meta http-equiv="refresh" content="20; URL=index.php">';
} else {
    // redirect to the spreadshirt checkouta
    header('Location: ' . $checkoutURL);
    // you can use this stuff too
    //    echo "redirecting to checkout, please wait";
    //    echo '<meta http-equiv="refresh" content="0; URL='.$checkoutURL.'">';
}