Example #1
0
$i_PinkieID = -1;
if (isset($_GET['pid'])) {
    $i_PinkieID = $_GET['pid'];
}
if ($i_PinkieID < 0) {
    // You don't have a valid Pinkie ID, need to redirect home.
    header("Location: ./home.php");
}
// Load the pinkie from the pinkie database.
$_pinkie = new Pinkie();
$_pinkie->i_PinkieID = (int) $i_PinkieID;
$_pinkie->fromDatabase();
// Load the Vendor associated with this pinkie.
$_vendor = new Vendor();
$_vendor->i_VendorID = $_pinkie->v_Vendor;
$_vendor->fromDatabase();
// Prints all the objects associated with this pinkie.
function printObjectsTable()
{
    global $_pinkie;
    if (count($_pinkie->a_Objects) == 0) {
        echo '<tr>
              <td></td>
              <td></td>
              <td> No Objects attached to this Pinkie!</td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
            </tr>';
        return;