Yeah, here’s a sample file:
<?php
if(!checkClient())
redirect("index.php");
if (!empty($_GET['interval']))
$weekInterval = $_GET['interval'];
else
$weekInterval = 0;
$myid = $_SESSION['myid'];
$query = "SELECT DISTINCT store_brands.name, stores.store_number AS storeNum,
shops.shop_date AS date, shops.shop_time AS time, shops.id
FROM little_bird.shops, little_bird.responses, little_bird.tests,
sea_stallion.store_brands, sea_stallion.stores, sea_stallion.times,
sea_stallion.accounts, sea_stallion.clients
WHERE
shop_date >= SUBDATE(
SUBDATE(
CURDATE(), INTERVAL ".(7 * $weekInterval)." DAY
),
DAYOFWEEK(
SUBDATE(
CURDATE(), INTERVAL ".(7 * $weekInterval)." DAY)) - 1) AND
shop_date <= ADDDATE(
SUBDATE(
CURDATE(), INTERVAL ".(7 * $weekInterval)." DAY
),
7 - DAYOFWEEK(
SUBDATE(
CURDATE(), INTERVAL ".(7 * $weekInterval)." DAY))) AND
shops.testid = tests.id AND
tests.time = times.id AND
times.storeid = stores.id AND
responses.shopid = shops.id AND
stores.accountid = accounts.id AND
clients.account = accounts.id AND
clients.id = $myid AND
stores.brandid = store_brands.id
ORDER BY shop_date, shop_time";
$shops = resourceToArray(BlueBird::oneTimeQuery($query));
$content = clientShopView($shops);
echo $content;
?>
</body>
</html>
?>
That’s the code I put in the snippet. The page itself is just [[snippetname]]. Most of the page is the same the only real different is in the content area, but the content area on nearly every page is unique and almost without exception generated on the spot using php. The code for viewClientShop is in another file altogether (which beg the question: does every one else put functions that are frequently used in snippets?) as is the code for checkClient. Though this isn’t the best example often the PHP is rather complex. But the code above creates all the content for the page (header, footer, etc, largely remains the same).
I hope that’s enough information.
-Mike