Beispiel #1
0
					<h2>Select Gear</h2>
					<p>Quantities are chosen at checkout based on what is available.</p>
					<hr />

					<?php 
$currGearList = $pkg->getGearList();
$types = getGearTypes();
foreach ($types as $type) {
    $items = Gear::getGearListWithType($type['gear_type_id']);
    echo "<h4>" . $type['type'] . "</h4>";
    foreach ($items as $item) {
        $gearObject = new Gear();
        $gearObject->fetch($item['gear_id']);
        echo "<div class='checkbox'>";
        if (in_array($gearObject->getID(), $currGearList)) {
            echo "<label><input type='checkbox' name='gear[]' value='" . $gearObject->getID() . "' checked> " . $gearObject->getName();
        } else {
            echo "<label><input type='checkbox' name='gear[]' value='" . $gearObject->getID() . "'> " . $gearObject->getName();
        }
        echo "</label></div>";
    }
    echo "<br />";
}
?>
					<br />
					<input class="btn btn-success" type="submit" name="submit" value="Submit">
                </form>
            </div>
        </div>
    </div>
Beispiel #2
0
                <?php 
echo resultBlock($errors, $successes);
?>

                <form role="form" action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
" method="POST">
                    <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">
Beispiel #3
0
     } else {
         echo "<div class='col-sm-4'>";
     }
     echo "<div class='panel panel-default'>";
     echo "<div class='panel-heading text-center'>" . $gearType . "</div>";
     echo "<div class='panel-body text-center'>";
     echo "<p>";
     foreach ($gearList as $gear) {
         $gearObject = new Gear();
         $gearObject->fetch($gear[0]);
         $qty = $gear[1];
         $type = gearTypeWithID($gearObject->getType());
         //gearTypeWithID(getGearType($gear[0]));
         if ($type == $gearType) {
             if ($qty > 1) {
                 echo $gearObject->getName() . " ({$qty})<br />";
             } else {
                 echo $gearObject->getName() . "<br />";
             }
         }
     }
     echo "</p>";
     echo "</div></div></div>";
     //panel-body //panel //col
     //if second col on row or last col, end the row
     if ($i % 2 == 1 || $i == count($gearTypes) - 1) {
         echo "</div>";
         //end row
     }
     $i++;
 }
Beispiel #4
0
<!DOCTYPE html>
<html lang="en">

<head>
	<!-- INCLUDE BS HEADER INFO -->
	<?php 
include 'templates/bs-head.php';
?>

    <title>Gear Item</title>
</head>
<body>
    <!-- IMPORT NAVIGATION & HEADER-->
    <?php 
include 'templates/bs-nav.php';
echo printHeader($gearObject->getName(), NULL);
?>

    <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 />";
        } else {
            echo "<tr>";
        }
        printf("<td><a href='checkout.php?co_id=%s'>%s</a></td>", $checkout->getID(), $checkout->getTitle());
        printf("<td class='hidden-xs'>%s</td>", shortString($checkout->getDescription(), 100, true));
        printf("<td>%s</td>", $personDetails['display_name']);
        printf("<td>%s</td>", $co_start->format('m-d g:iA'));
        printf("<td>%s</td>", $co_end->format('m-d g:iA'));
        printf("<td class='hidden-xs hidden-sm'>");
        $i = 0;
        //counter. Only want to show a few items
        foreach ($checkout->getGearList() as $gear) {
            $gearObject = new Gear();
            $gearObject->fetch($gear[0]);
            if ($i > 4) {
                echo "<div class='hide" . $checkout->getID() . "' style='display:none'>" . $gearObject->getName() . "</div>";
            } elseif ($i == 4) {
                echo "<div class='hide" . $checkout->getID() . "' style='display:none'>" . $gearObject->getName() . "</div>";
                echo "<div class='unhide' id='" . $checkout->getID() . "'>...</div>";
            } else {
                printf("%s<br />", $gearObject->getName());
            }
            $i++;
        }
        printf("</td></tr>");
    }
    ?>
                    </tbody>
                </table>
                <?php 
} else {
Beispiel #6
0
    echo $co_end;
    ?>
" />
						<?php 
    //make sure gear list is resubmitted
    foreach ($gearList as $gear) {
        echo "<input type='hidden' name='gear[]' value='{$gear}' />";
    }
    //get quantities...
    if (count($gearToGetQtyFor) == 0) {
        echo "<p><strong>There are no items to get quantity for. Click below to finish</strong></p>";
    } else {
        foreach ($gearToGetQtyFor as $gear) {
            $gearObject = new Gear();
            $gearObject->fetch($gear);
            echo $gearObject->getName() . "&nbsp;&nbsp;&nbsp;";
            echo "<select name='gearQty[]'>";
            $qty = $gearObject->availableQty($co_start, $co_end);
            $currQty = $co->qtyOfItem($gearObject->getID());
            for ($i = 1; $i <= $qty; $i++) {
                if ($i == $currQty) {
                    echo "<option value='{$i}' selected='selected'>{$i}</option>";
                } else {
                    echo "<option value='{$i}'>{$i}</option>";
                }
            }
            echo "</select><br /><br />";
        }
    }
    ?>
						<br />
Beispiel #7
0
                                <th class='text-center'>Gear</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
foreach ($packages as $pkg) {
    $gearList = $pkg->getGearList();
    echo "<tr>";
    echo "<td><a href='package.php?pkg_id=" . $pkg->getID() . "'>" . $pkg->getTitle() . "</a></td>";
    echo "<td>" . $pkg->getDescription() . "</td><td class='text-center'>";
    $i = 0;
    foreach ($gearList as $gear) {
        $gearObject = new Gear();
        $gearObject->fetch($gear);
        if ($i > 5) {
            echo "<div class='hide" . $pkg->getID() . "' style='display:none'>" . $gearObject->getName() . "</div>";
        } elseif ($i == 5) {
            echo "<div class='hide" . $pkg->getID() . "' style='display:none'>" . $gearObject->getName() . "</div>";
            echo "<div class='unhide' id='" . $pkg->getID() . "'>...</div>";
        } else {
            echo $gearObject->getName() . "<br />";
        }
        $i++;
    }
    echo "</td></tr>";
}
?>
                        </tbody>
                    </table>
                </form>
            </div> <!-- end col -->
Beispiel #8
0
        if ($i % 2 == 0) {
            //start row
            echo "<div class='row'>";
            echo "<div class='col-sm-4 col-sm-offset-2'>";
        } else {
            echo "<div class='col-sm-4'>";
        }
        echo "<div class='panel panel-default'>";
        echo "<div class='panel-heading text-center'>" . $gearType . "</div>";
        echo "<div class='panel-body text-center'>";
        echo "<p>";
        foreach ($gearList as $gear) {
            $gearObject = new Gear();
            $gearObject->fetch($gear);
            if (gearTypeWithID($gearObject->getType()) == $gearType) {
                echo $gearObject->getName() . "<br />";
            }
        }
        echo "</p>";
        echo "</div></div></div>";
        //panel-body //panel //col
        //if second col on row or last col, end the row
        if ($i % 2 == 1 || $i == count($gearTypes) - 1) {
            echo "</div>";
            //end row
        }
        $i++;
    }
}
?>