Example #1
0
				<div class="panel panel-default">
					<div class="panel-heading">
						<a href="?page=admin&area=items&newitem=1&catid=' . $ItemCat->GetValue("ID") . '" style="float: right;"><span class="btn btn-xs btn-success">Add Item</span></a>
						<b>' . $ItemCat->GetValue("Name") . ' Items</b>
					</div>
					
					<table class="table">
						<thead style="font-size: 12px;">
							<th style="width: 50%;">Name</th>
							<th style="width: 25%;">Cost</th>
							<th style="width: 25%;text-align: right;">Actions</th>
						</thead>
						
						<tbody>
			';
        $Items = Item::SearchCachedResults("Item", "Category", $ItemCat->GetValue("ID"));
        if (count($Items) == 0) {
            echo '<tr><td colspan=3 style="text-align: center;padding: 16px;font-size: 12px;"><i>No items to display!</i></td></tr>';
        } else {
            foreach ($Items as $ItemObj) {
                echo '
						<tr style="font-size: 12px;">
							<td>' . $ItemObj->GetValue("Name") . ' 
					';
                if ($ItemObj->GetValue("Status") == ItemStatus::DISABLED) {
                    echo '<b style="font-size: 10px;color: #888;"> (Disabled)</b>';
                }
                echo '
							</td>
							<td><img src="includes/images/money_dollar.png" /> ' . number_format($ItemObj->GetValue("Cost"), 2) . '</td>
							<td style="text-align: right;">
Example #2
0
<?php

if (!is_numeric($_GET["cat"])) {
    die("Nice try. Your attempt has been recorded.");
}
$Items = Item::SearchCachedResults("Item", "Category", $_GET["cat"]);
$ItemsRendered = 0;
foreach ($Items as $ItemObj) {
    if ($ItemObj->GetValue("Status") != ItemStatus::DISABLED) {
        if ($ItemsRendered % 2 == 0) {
            echo '<div class="row">';
        }
        echo '
				<div class="col-sm-6 col-md-6">
					<div class="thumbnail">
			';
        // The code for showing the image
        if ($ItemObj->Data["ShowImage"] == 1) {
            if (empty($ItemObj->Data["Image"]) || $ItemObj->Data["Image"] == "item_default.png") {
                echo '<img data-src="js/holder.js/100%x150/text:No Image Available" alt="..." />';
            } else {
                echo '<img src="includes/images/uploaded/' . $ItemObj->Data["Image"] . '" />';
            }
        }
        echo '
				<div class="caption">
					<h3>' . $ItemObj->GetValue("Name") . '</h3>

					' . $ItemObj->GetValue("Description") . '
					
					<br /><br />