-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from tonicospinelli/05-layout
refactoring: isolating application layout
- Loading branch information
Showing
3 changed files
with
75 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title><?php echo $title ?></title> | ||
</head> | ||
<body> | ||
<?php echo $content ?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
<html> | ||
<head></head> | ||
<body> | ||
<?php if (null !== $errormsg): ?> | ||
<div class="alert error"><?php echo $errormsg; ?> </div> | ||
<?php elseif (isset($product)): ?> | ||
<div class="alert success"><?php echo $successmsg; ?></div> | ||
<?php endif; ?> | ||
<h3>Products</h3> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>PRODUCT</th> | ||
<th>UNIT PRICE</th> | ||
<th>STOCK</th> | ||
<th>ACTIONS</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($products as $product): ?> | ||
<?php $title = 'List of Producst' ?> | ||
|
||
<?php ob_start() ?> | ||
<h3>Products</h3> | ||
<?php if (null !== $errormsg): ?> | ||
<div class="alert error"><?php echo $errormsg; ?> </div> | ||
<?php elseif (isset($product)): ?> | ||
<div class="alert success"><?php echo $successmsg; ?></div> | ||
<?php endif; ?> | ||
<table> | ||
<thead> | ||
<tr> | ||
<td><?php echo $product['id']; ?> </td> | ||
<td><?php echo $product['name']; ?> </td> | ||
<td><?php echo $product['unit_price']; ?> </td> | ||
<td><?php echo $product['stock']; ?> </td> | ||
<td><?php echo removeUrl('product.php', $product['id']); ?> </td> | ||
<th>ID</th> | ||
<th>PRODUCT</th> | ||
<th>UNIT PRICE</th> | ||
<th>STOCK</th> | ||
<th>ACTIONS</th> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($products as $product): ?> | ||
<tr> | ||
<td><?php echo $product['id']; ?> </td> | ||
<td><?php echo $product['name']; ?> </td> | ||
<td><?php echo $product['unit_price']; ?> </td> | ||
<td><?php echo $product['stock']; ?> </td> | ||
<td><?php echo removeUrl('product.php', $product['id']); ?> </td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
<?php $content = ob_get_clean() ?> | ||
|
||
<?php include __DIR__.'/../layout.php' ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
<html> | ||
<head></head> | ||
<body> | ||
<?php if (null !== $errormsg): ?> | ||
<div class="alert error"><?php echo $errormsg; ?> </div> | ||
<?php elseif (isset($wishItem)): ?> | ||
<div class="alert success"><?php echo $successmsg; ?></div> | ||
<?php endif; ?> | ||
<h3>My Wish List</h3> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>PRODUCT</th> | ||
<th>STATUS</th> | ||
<th>ACTIONS</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($wishlist as $wish): ?> | ||
<?php $title = 'My Wish List' ?> | ||
|
||
<?php ob_start() ?> | ||
<h3><?php echo $title;?></h3> | ||
<?php if (null !== $errormsg): ?> | ||
<div class="alert error"><?php echo $errormsg; ?> </div> | ||
<?php elseif (isset($wishItem)): ?> | ||
<div class="alert success"><?php echo $successmsg; ?></div> | ||
<?php endif; ?> | ||
<table> | ||
<thead> | ||
<tr> | ||
<td><?php echo $wish['id']; ?> </td> | ||
<td><?php echo $wish['product_name']; ?> </td> | ||
<?php if ($wish['product_stock'] == 0): ?> | ||
<td>Not Available</td> | ||
<?php else: ?> | ||
<td>Available</td> | ||
<?php endif; ?> | ||
<td><?php echo removeUrl('wishlist.php', $wish['id'], ['email' => $_GET['email']]); ?> </td> | ||
<th>ID</th> | ||
<th>PRODUCT</th> | ||
<th>STATUS</th> | ||
<th>ACTIONS</th> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($wishlist as $wish): ?> | ||
<tr> | ||
<td><?php echo $wish['id']; ?> </td> | ||
<td><?php echo $wish['product_name']; ?> </td> | ||
<?php if ($wish['product_stock'] == 0): ?> | ||
<td>Not Available</td> | ||
<?php else: ?> | ||
<td>Available</td> | ||
<?php endif; ?> | ||
<td><?php echo removeUrl('wishlist.php', $wish['id'], ['email' => $_GET['email']]); ?> </td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
<?php $content = ob_get_clean() ?> | ||
|
||
<?php include __DIR__.'/../layout.php' ?> |