function getSubCategory($collapse_number, $product_category) { global $con; $sql = "SELECT * FROM category"; $unique_brands = getRows('DISTINCT pro_brand', 'products WHERE pro_category="' . $product_category . '"'); echo '<div class="collapse" id="collapse' . $collapse_number . '">'; getBrand($product_category, $unique_brands); echo '</div>'; }
// The "back" link $prevlink = $page > 1 ? '<a href="?action=surveys&page=1" title="First page">«</a> <a href="?action=surveys&page=' . ($page - 1) . '" title="Previous page">‹</a>' : '<span class="disabled">«</span> <span class="disabled">‹</span>'; // The "forward" link $nextlink = $page < $pages ? '<a href="?action=surveys&page=' . ($page + 1) . '" title="Next page">›</a> <a href="?action=surveys&page=' . $pages . '" title="Last page">»</a>' : '<span class="disabled">›</span> <span class="disabled">»</span>'; // Return an iteration from the samples table. $samples = getSamplesNew($limit, $offset); // Do we have any results? if ($samples) { foreach ($samples as $row) { ?> <form class="form-inline" action="?action=confirmation" method="POST"> <?php $questions = getQuestions(); $brand_name = getBrand($row['brandID']); $origin_type = getOrigin($row['originID']); ?> <div class="form-group col-sm-12"> <h3><?php print $page . ". " . $brand_name['brandName'] . ' - ' . $origin_type['type']; ?> </h3> <?php foreach ($questions as $question) { ?> <p><?php print $question['questionText']; ?> </p>
<?php include 'config/autoload.php'; if (!isset($_GET['id'])) { header('Location: brand.php'); } $brand = getBrand($db, $_GET['id']); if (isset($_POST['name']) and isset($_POST['brandGroup']) and isset($_POST['continent']) and isset($_POST['country']) and isset($_POST['website']) and isset($_POST['comment'])) { updateBrand($db, $_GET['id'], $_POST['name'], $_POST['brandGroup'], $_POST['continent'], $_POST['country'], $_POST['website'], $_POST['comment']); header('Location: brand.php'); } ?> <h3>Gestion des marques</h3> <form action="editBrand.php?id=<?php echo $_GET['id']; ?> " method="post"> <fieldset> <legend>Edition de la marque :</legend> <input type="text" name="name" value="<?php echo $brand['name']; ?> " placeholder="Nom de la marque" required>* <input type="text" name="brandGroup" value="<?php echo $brand['brand_group']; ?> " placeholder="Groupe de la marque"> <hr> <input type="text" name="continent" value="<?php
<div class="row"> <div class="col-sm-2"> <input name="action" type="hidden" value="createSample"> <button type="submit" formaction="." class="btn btn-default">Save sample</button> </div> </div> </form> <!-- end inline form --> <div class="createdSamples"> <ul class="list-group"> <?php $samples = getSamples(); foreach ($samples as $sample) { $brand_name = getBrand($sample['brandID']); $origin_type = getOrigin($sample['originID']); ?> <li class="list-group-item"><?php print $brand_name['brandName'] . ' | ' . $origin_type['type'] . ' | ' . $sample['batch']; ?> </li> <?php } ?> </ul> </div> </div> <!-- end col-12 -->