<span class="pagedisplay"></span> <!-- this can be any element, including an input --> <img src="lib/tablesorter/addons/pager/icons/next.png" class="next" alt="Next" /> <img src="lib/tablesorter/addons/pager/icons/last.png" class="last" alt="Last" /> <select class="pagesize" title="Nombre de vins / page"> <option value="10">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> <select class="gotoPage" title="Choisir la page"></select> </div> <?php // display the products if there are any if ($num > 0) { $aoc = new AOC($db); $type = new Type($db); $emplacement = new Emplacement($db); echo "<div id='modal_confirm_yes_no' title='Confirm'></div>"; echo "<table class='table table-striped table-hover table-responsive tablesorter' id='allVins'>"; echo "<thead><tr>"; echo "<th>Nom</th>"; echo "<th class='colMagnum'> </th>"; echo "<th>Qté</th>"; echo "<th class='colCouleur'>Type</th>"; echo "<th class='filter-select filter-onlyAvail'>Emplacement</th>"; echo "<th class='filter-select filter-onlyAvail'>Millesime</th>"; echo "<th class='filter-select filter-onlyAvail'>Apogée</th>"; echo "<th>AOC</th>"; echo "<th class='filter-select filter-onlyAvail'>Achat</th>"; echo "</tr></thead>";
echo "<option value='{$id}'>"; } echo "{$nom}</option>"; } echo "</select>"; ?> </div> </div> <div class="form-group"> <label for="id_aoc" class="col-sm-2 control-label">Appellation</label> <div class="col-sm-10"> <?php // read the bouteille categories from the database include_once 'objects/AOC.php'; $aoc = new AOC($db); $stmt = $aoc->read(); // put them in a select drop-down echo "<select class='form-control' name='id_aoc'>"; echo "<option>Choisir l'AOC ...</option>"; while ($row_aoc = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row_aoc); // current aoc of the product must be selected if ($bouteille->id_aoc == $id) { echo "<option value='{$id}' selected>"; } else { echo "<option value='{$id}'>"; } echo "{$appellation}</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/AOC.php'; // instantiate database and product object $database = new Database(); $db = $database->getConnection(); $aoc = new AOC($db); // query products $stmt = $aoc->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>Appellation</th>"; echo "<th>Région</th>"; echo "<th>Sous-Division</th>"; echo "</tr>"; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row); echo "<tr>"; echo "<td>{$appellation}</td>";