本文整理汇总了PHP中Package::getGearList方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::getGearList方法的具体用法?PHP Package::getGearList怎么用?PHP Package::getGearList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package::getGearList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
die;
}
require_once 'models/funcs.php';
require_once 'models/Gear.php';
require_once 'models/Package.php';
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$pkg_id = test_input($_GET['pkg_id']);
$del = test_input($_GET['delete']);
if ($del == true) {
Package::removePackage($pkg_id);
header("Location: packages.php");
}
$pkg = new Package();
$pkg->retrievePackage($pkg_id);
//pull pkg and gearlist
$gearList = $pkg->getGearList();
//create array of gear types within this checkout
$gearTypes = array();
foreach ($gearList as $gear) {
$gearObject = new Gear();
$gearObject->fetch($gear);
$type = gearTypeWithID($gearObject->getType());
if (!in_array($type, $gearTypes)) {
$gearTypes[] = $type;
}
}
//foreach
}
?>
<!DOCTYPE html>
示例2: getGearTypes
">
</div>
<div class="form-group"> <!-- DESC -->
<label class="control-label" for="Description">Description:</label>
<textarea class="form-control" name="description" rows="3"><?php
echo $pkg->getDescription();
?>
</textarea>
</div>
<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>";
}
示例3: array
$title = test_input($_POST['title']);
$description = test_input($_POST['description']);
$co_start = test_input($_POST['co_start']);
$co_end = test_input($_POST['co_end']);
$location = test_input($_POST['location']);
$dr_number = test_input($_POST['dr_number']);
//look and see what pkgs are added already
$preCheck = array();
//items to precheck if possible based on pkgs
if (isset($_POST['addedPkgs'])) {
$addedPkgs = array();
foreach ($_POST['addedPkgs'] as $pkg) {
$addedPkgs[] = test_input($pkg);
$newPkg = new Package();
$newPkg->retrievePackage($pkg);
$preCheck = array_merge($preCheck, $newPkg->getGearList());
unset($newPkg);
}
if ($_POST['submit'] != "Next") {
$step = 1;
}
//don't move onto step 3 yet.
}
//construct a clean gear list
$gearList = array();
$gearToGetQtyFor = array();
if (isset($_POST['gear'])) {
foreach ($_POST['gear'] as $gearItem) {
$gearList[] = test_input($gearItem);
//if the available qty is > 1, we need to find out
//what qty the user wants to check out