Esempio n. 1
0
<?php

require_once 'classes/ec/product_manager.php';
$productManager = new ProductManager();
$products = $productManager->getProducts();
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>商品一覧</title>
</head>
<body>
<table border="1">
	<tr>
		<th>商品ID</th>
		<th>商品名</th>
		<th>価格</th>
	</tr>
	<?php 
foreach ($products as $product) {
    ?>
	<tr>
		<td><a href="detail.php?id=<?php 
    echo $product['id'];
    ?>
"><?php 
    echo $product['id'];
    ?>
</td>
		<td><?php 
Esempio n. 2
0
<body>
	<div class="row">
		<section class="col-sm-8">
			<h2>Products</h2>

			<form action="add-to-basket.php" method="post">
				<table class="table table-striped">
					<tr>
						<th>Code</th>
						<th>Name</th>
						<th>Price</th>
						<th>Discount</th>
						<th></th>
					</tr>
					<?php 
foreach ($ProductManager->getProducts() as $i => $product) {
    ?>
							<tr>
								<td><?php 
    echo $product->getCode();
    ?>
</td>
							 	<td><?php 
    echo $product->getName();
    ?>
</td>
							 	<td><?php 
    echo money_format('%n', $product->getPrice());
    ?>
</td>
							 	<td>