コード例 #1
0
 	for ( var int = 0; int < array.length; int++) {
		$(array[5]).attr("id", "selected");
	}
 </script>';
include_once '../../controller/PromotionController.php';
require_once "../../utility/Utils.php";
include_once "../../controller/config.php";
$maxItems = 10;
$curPage = "";
if (isset($_GET["page"])) {
    $curPage = (int) $_GET["page"];
}
$curPage = $curPage > 0 ? $curPage : 1;
$curItem = ($curPage - 1) * $maxItems;
$promotionController = new PromotionController();
$promotionList = $promotionController->Get($curItem, $maxItems);
$totalItems = $promotionController->Count();
?>
		<div id="contain" class="contain contain box-transparent">
				<?php 
if (!empty($promotionList) && $promotionList != null) {
    ?>
					<?php 
    foreach ($promotionList as $promotion) {
        ?>
					<div class="promotion">
						<?php 
        echo $promotion['Detail'];
        ?>
					</div>
					<?php 
コード例 #2
0
		<table width="100%">
			<thead>
				<tr>
					<th width="40px"><a href="#">ID<img src="img/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></a></th>					
					<th><a href="#">Name</a></th>
					<th><a href="#">Detail</a></th>
					<th width="90px"><a href="#">Start Date</a></th>
					<th width="70px"><a href="#">End Date</a></th>
					<th width="60px"><a href="#">Action</a></th>
					
				</tr>
			</thead>
			<tbody>
				<?php 
require_once "../../controller/PromotionController.php";
$products = PromotionController::Get($curItem, $maxItems);
$totalItems = PromotionController::Count();
if ($totalItems != 0) {
    foreach ($products as $product) {
        ?>
					<tr>
					<td class="a-center"><?php 
        echo $product["ID"];
        ?>
</td>
					<td><a href="?action=view&<?php 
        echo "id=" . $product["ID"];
        ?>
"><?php 
        echo $product["Name"];
        ?>