match('/heic|HEIC|jpg|jpeg|JPG|JPEG|webp|WEBP$/'); echo '

' . count($dir) . gettext(' images found in folder') . ' photos/img/ ...

'; $conn = new PDO("sqlite:db_photo.sqlite3"); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); try { $columns = array('date','lens','model','iso','lat'); $column = isset($_GET['column']) && in_array($_GET['column'], $columns) ? $_GET['column'] : $columns[0]; //$_SESSION['column'] = $column; $sort_order = isset($_GET['order']) && strtolower($_GET['order']) == 'desc' ? 'DESC' : 'ASC'; //$_SESSION['sort_order'] = $sort_order; $query4 = "SELECT id,filename, date, lens, speed, iso, width, height, html, aperture, model, lat, long, alt, legende, copyright, title, creator, keywords, metering, flash, focal, wb, program FROM photos ORDER BY " . $column . " " . $sort_order . " LIMIT ? OFFSET ?"; //$query4 = "SELECT id,filename, date, lens, speed, iso, width, height, html, aperture, model, lat, long, alt, legende, copyright, title, creator, keywords, metering, flash, focal, wb, program FROM photos ORDER BY date DESC LIMIT ? OFFSET ?"; $perpage = 50; $offset = $perpage * ($page -1); echo $query4 . "
"; echo $perpage . " - " . $offset . "
"; $stmt = $conn->prepare($query4); $stmt->execute(array($perpage, $offset));// (1,3...) 1=1ere valeur 3=valeur # id 1 -> 3 //$stmt->execute(array(1, 3)); // WHERE id >= ? AND id <= ? ORDER BY date DESC"; $stmt->execute(); //$row = $stmt->fetchAll(PDO::FETCH_ASSOC); //_pr($result); //echo '

' . gettext('Reading added photos') . ':

'; $up_or_down = str_replace(array('ASC','DESC'), array('up','down'), $sort_order); $asc_or_desc = $sort_order == 'ASC' ? 'desc' : 'asc'; $add_class = ' class="highlight"'; /* ' . gettext('Date') . ' ' . gettext('Lens') . ' ' . gettext('Iso') . ' ' . gettext('Model') . ' ' . gettext('Latitude') . ' */ echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']); $full = host() . $row['filename']; echo ''; } echo '
' . gettext('Id') . '' . gettext('Thumb') . '' . gettext('Filename') . '' . gettext('Date') . ' ' . gettext('Lens') . ' ' . gettext('Speed') . '' . gettext('Iso') . ' ' . gettext('Width') . '' . gettext('Height') . '' . gettext('Html') . '' . gettext('Aperture') . '' . gettext('Model') . ' ' . gettext('Latitude') . ' ' . gettext('Longitude') . '' . gettext('Alttitude') . '' . gettext('Legende') . '' . gettext('Copyright') . '' . gettext('Title') . '' . gettext('Creator') . '' . gettext('Keywords') . '' . gettext('Metering') . '' . gettext('Flash') . '' . gettext('Focal') . '' . gettext('Wb') . '' . gettext('Program') . '
' . $row['id'] . '' . '' . '' . $row['filename'] . '' . $row['date'] . '' . $row['lens'] . '' . $row['speed'] . '' . $row['iso'] . '' . $row['width'] . '' . $row['height'] . '' . $row['html'] . '' . $row['aperture'] . '' . $row['model'] . '' . $row['lat'] . '' . $row['long'] . '' . $row['alt'] . '' . $row['legende'] . '' . $row['copyright'] . '' . $row['title'] . '' . $row['creator'] . '' . $row['keywords'] . '' . $row['metering'] . '' . $row['flash'] . '' . $row['focal'] . '' . $row['wb'] . '' . $row['program'] . '
'; echo '
'; $conn = null; } catch(PDOException $e) { echo $e->getMessage(); } ?> prepare($query4); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); $numRows = $result['count']; $conn4 = null; } catch(PDOException $e) { echo $e->getMessage(); } // calcul du nombre de pages (arrondi a l'entier supérieur) $nbpages = ceil($numRows / $perpage); $prec = $page - 1; $suiv = $page + 1; echo ''; ?>

© 2013- sur-le-sentier.fr