<div class="col-sm-5"> <input type='text' id="sliderApogee" data-slider-min="2000" data-slider-max="2050" data-slider-step="1" data-slider-value="<?php echo $bouteille->apogee; ?> " > </div> </div> <div class="form-group"> <label for="id_cepage" class="col-sm-2 control-label">Cépage</label> <div class="col-sm-10"> <?php // read the bouteille categories from the database include_once 'objects/Cepage.php'; $cepage = new Cepage($db); $stmt = $cepage->read(); // put them in a select drop-down echo "<select class='form-control' name='id_cepage'>"; echo "<option>Choisir le cépage ...</option>"; while ($row_cepage = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row_cepage); // current cepage of the product must be selected if ($bouteille->id_cepage == $id) { echo "<option value='{$id}' selected>"; } else { echo "<option value='{$id}'>"; } echo "{$nom}</option>"; } echo "</select>";
<?php // page given in URL parameter, default page is one $page = isset($_GET['page']) ? $_GET['page'] : 1; // set number of records per page $records_per_page = 15; // calculate for the query LIMIT clause $from_record_num = $records_per_page * $page - $records_per_page; // include database and object files include_once 'config/database.php'; include_once 'objects/Cepage.php'; // instantiate database and product object $database = new Database(); $db = $database->getConnection(); $cepage = new Cepage($db); // query products $stmt = $cepage->readAll($page, $from_record_num, $records_per_page); $num = $stmt->rowCount(); // display the products if there are any if ($num > 0) { echo "<table class='table table-striped table-hover table-responsive'>"; echo "<tr>"; echo "<th>Nom</th>"; echo "<th>Couleur</th>"; echo "<th>Origine</th>"; echo "<th>Superficie (m2)</th>"; echo "<th>Année</th>"; echo "</tr>"; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row);