summaryrefslogtreecommitdiffstats
path: root/productedit.php
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-05-18 14:22:11 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-05-18 14:22:11 +0200
commit8ec5b1c386cd1f4266009cd5da734b43e1ce2291 (patch)
tree0c44c7adb9974d5cc6c2aeb943fcad91f2c178d1 /productedit.php
parent0a51d468632181c757b9cdeec162cd42385c93b5 (diff)
downloadCatalog-8ec5b1c386cd1f4266009cd5da734b43e1ce2291.tar.gz
Catalog-8ec5b1c386cd1f4266009cd5da734b43e1ce2291.zip
Add layout and style to the *edit.php
Diffstat (limited to 'productedit.php')
-rw-r--r--productedit.php133
1 files changed, 78 insertions, 55 deletions
diff --git a/productedit.php b/productedit.php
index c2b33fa..97f60cb 100644
--- a/productedit.php
+++ b/productedit.php
@@ -67,63 +67,86 @@
<link rel="stylesheet" type="text/css" href="styles/style.css">
</head>
<body>
- <a href="products.php?id=<?php echo $catid; ?>" accesskey="b"><em>B</em>ack</a>
- <form action="productedit.php?<?php echo "{$type}={$product->getId()}" ?>&catid=<?php echo $catid; ?>" method="post">
- <h1>Product</h1>
- <div class="row">
- <label for="name"><u>N</u>ame:</label>
- <input class="formw" type="text"
- placeholder="Name" id="name" name="name" accesskey="n"
- maxlength="100" value="<?php echo $product->getName(); ?>">
- </div>
- <div class="row">
- <label for="price"><u>P</u>rice (Euro):</label>
- <input class="formw" type="number" step="0.01" min="0"
- placeholder="Price (Euro)" id="price" name="price" accesskey="p"
- maxlength="13" value="<?php echo $product->getPrice(); ?>">
- </div>
- <div class="row">
- <label for="width"><u>W</u>idth (mm):</label>
- <input class="formw" type="number"
- placeholder="Width (mm)" id="width" name="width" accesskey="w"
- maxlength="11" value="<?php echo $product->getWidth(); ?>">
- </div>
- <div class="row">
- <label for="height"><u>H</u>eight (mm):</label>
- <input class="formw" type="number"
- placeholder="Height (mm)" id="height" name="height" accesskey="h"
- maxlength="11" value="<?php echo $product->getHeight(); ?>">
- </div>
- <div class="row">
- <label for="desc"><u>D</u>escription:</label>
- <textarea class="formw" placeholder="Description" id="desc" name="desc"
- accesskey="d" maxlength="1000"><?php echo $product->getDescription(); ?></textarea>
- </div>
- <div class="row">
- <label for="cat"><u>D</u>escription:</label>
- <select multiple class="formw" id="cat" name="cat[]">
- <?php
- foreach (CategoryQuery::create()->find() as $category)
- {
- echo "<option value=\"{$category->getId()}\" ";
- if($product->getCategories()->contains($category))
+ <header><h1><?php echo $product->getName(); ?></h1></header>
+ <nav>
+ <dl>
+ <dt><a href="contact.php">Contact us</a></dt>
+ <dt><a href=".">Home</a></dt>
+ <dt><a href="categories.php">Categories</a></dt>
+ <dt><a href="products.php?id=<?php echo $catid; ?>">Back</a></dt>
+ <?php
+ if(isset($_SESSION['username']))
+ {
+ echo "<dt><a href=\"login.php?logout\">Logout</a></dt>";
+ $username = $_SESSION['username'];
+ }
+ else
+ {
+ echo "<dt><a href=\"login.php\">Login</a></dt>";
+ }
+ ?>
+ </dl>
+ </nav>
+ <div id="content">
+ <form action="productedit.php?<?php echo "{$type}={$product->getId()}" ?>&catid=<?php echo $catid; ?>" method="post">
+ <h1>Product</h1>
+ <div class="row">
+ <label for="name"><u>N</u>ame:</label>
+ <input class="formw" type="text"
+ placeholder="Name" id="name" name="name" accesskey="n"
+ maxlength="100" value="<?php echo $product->getName(); ?>">
+ </div>
+ <div class="row">
+ <label for="price"><u>P</u>rice (Euro):</label>
+ <input class="formw" type="number" step="0.01" min="0"
+ placeholder="Price (Euro)" id="price" name="price" accesskey="p"
+ maxlength="13" value="<?php echo $product->getPrice(); ?>">
+ </div>
+ <div class="row">
+ <label for="width"><u>W</u>idth (mm):</label>
+ <input class="formw" type="number"
+ placeholder="Width (mm)" id="width" name="width" accesskey="w"
+ maxlength="11" value="<?php echo $product->getWidth(); ?>">
+ </div>
+ <div class="row">
+ <label for="height"><u>H</u>eight (mm):</label>
+ <input class="formw" type="number"
+ placeholder="Height (mm)" id="height" name="height" accesskey="h"
+ maxlength="11" value="<?php echo $product->getHeight(); ?>">
+ </div>
+ <div class="row">
+ <label for="desc"><u>D</u>escription:</label>
+ <textarea class="formw" placeholder="Description" id="desc" name="desc"
+ accesskey="d" maxlength="1000"><?php echo $product->getDescription(); ?></textarea>
+ </div>
+ <div class="row">
+ <label for="cat"><u>D</u>escription:</label>
+ <select multiple class="formw" id="cat" name="cat[]">
+ <?php
+ foreach (CategoryQuery::create()->find() as $category)
{
- echo "selected";
+ echo "<option value=\"{$category->getId()}\" ";
+ if($product->getCategories()->contains($category))
+ {
+ echo "selected";
+ }
+ echo ">{$category->getName()}</option>";
}
- echo ">{$category->getName()}</option>";
- }
+ ?>
+ </select>
+ </div>
+ <div class="spacer">&nbsp;</div>
+ <button type="submit">
+ <?php
+ echo ucfirst($type);
?>
- </select>
- </div>
- <div class="spacer">&nbsp;</div>
- <button type="submit">
- <?php
- echo ucfirst($type);
- ?>
- </button>
- <button type="reset">
- Reset
- </button>
- </form>
+ </button>
+ <button type="reset">
+ Reset
+ </button>
+ </form>
+ <div class="spacer"></div>
+ </div>
+ <footer>Copyright by SomeCompany Ltd.</footer>
</body>
</html> \ No newline at end of file