Beispiel #1
0
    <div class="container">
        <div class="row">
            <div class="col-sm-8 col-sm-offset-2">
            <?php 
echo "<a href='inventory.php'><span class='glyphicon glyphicon-chevron-left'></span>&nbsp;&nbsp;Back to Inventory</a>";
?>
            <br /><br />
                <div class="panel panel-default">
                    <div class="panel-heading text-center">Gear Details</div>
                    <div class="panel-body text-center">
                        <p>
                        <?php 
echo "<strong>Gear ID:</strong> " . $gear_id . "<br /><br />";
echo "<strong>Name:</strong> " . $gearObject->getName() . "<br /><br />";
echo "<strong>Type:</strong> " . gearTypeWithID($gearObject->getType()) . "<br /><br />";
echo "<strong>Quantity:</strong> " . $gearObject->getQty() . "<br /><br />";
if (!$gearObject->isDisabled()) {
    echo "<strong>Enabled </strong><span class='glyphicon glyphicon-ok color-green'></span><br /><br />";
    echo "<strong>Status:</strong> " . $gearObject->status(date('Y-m-d h:m:s')) . "<br /><br />";
} else {
    echo "<strong>Disabled </strong><span class='glyphicon glyphicon-remove color-red'></span><br /><br />";
}
if (!empty($gearObject->getNotes())) {
    echo "<strong>Notes:</strong> <pre>" . $gearObject->getNotes() . "</pre><br />";
}
//only show to admins
if ($loggedInUser->checkPermission(array(2))) {
    echo "<a class='btn btn-primary' href='edit-gear.php?gear_id=" . $gear_id . "'>Edit</a> &nbsp;&nbsp;";
    echo "<a class='btn btn-danger' href='gear-item.php?gear_id=" . $gear_id . "&deleteGearItem=" . $gear_id . "'>Delete</a>";
}
?>
Beispiel #2
0
                    <input type="hidden" name="gear_id" value="<?php 
echo $gear_id;
?>
" />
                    <div class="form-group">
                        <label class="control-label" for="name">Name:</label>
                        <input class="form-control" name="name" type="text" placeholder="<?php 
echo $gearObject->getName();
?>
"/>
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="qty">Quantity:</label>
                        <input class="form-control" name="qty" type="text" placeholder="<?php 
echo $gearObject->getQty();
?>
"/>
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="type">Choose a category:</label>
                        <select class="form-control" name="type">
                        <?php 
$oldType = $gearObject->getType();
foreach ($types as $type) {
    echo "<option value='" . $type['gear_type_id'] . "' ";
    if ($type['gear_type_id'] == $oldType) {
        echo "selected='selected'>";
    } else {
        echo ">";
Beispiel #3
0
            $gearObject = new Gear();
            $gearObject->fetch($gear['gear_id']);
            printf("<tr>");
            printf("<td><a href='gear-item.php?gear_id=%s'>%s</a></td>", $gear['gear_id'], $gear['name']);
            echo "<td>" . $gearObject->status(date('Y-m-d h:m:s')) . "</td>";
            $co_id = $gearObject->lastCheckoutID();
            //fetchLastCheckout($gear['gear_id']);
            if (!empty($co_id)) {
                $co = new Checkout();
                $co->retrieveCheckout($co_id);
                printf("<td><a href='checkout.php?co_id=%s'>%s</a></td>", $co_id, getPersonName($co->getPerson()));
            } else {
                //no last checkout
                printf("<td>n/a</td>");
            }
            printf("<td class='text-center'>%s</td>", $gearObject->getQty());
            //$gear['qty']
            printf("</tr>");
        }
        ?>
                        </tbody>
                    </table>
                    <?php 
    }
}
//foreach
?>
                </form>
            </div>
        </div>
    </div> <!-- /container -->