prepare($sql)){ if($stmt->execute()){ if($stmt->rowCount() > 0){ while($row = $stmt->fetch()){ array_push($years_avail, $row['year']); } } } } } catch(PDOException $e){ die('ERROR: Could not able to execute $sql. ' . $e->getMessage()); } $publications = array('publications' => array()); // Attempt select query execution try{ $sql = 'SELECT id, authors, title, journal, year, doi, ministerial_pts, special_graphics FROM publications WHERE year = :year ORDER BY date_time DESC'; if($stmt = $pdo->prepare($sql)){ $stmt->bindParam(":year", $param_year, PDO::PARAM_STR); $param_year = $year; if($stmt->execute()){ if($stmt->rowCount() > 0){ $index_nr = $stmt->rowCount()+1; while($row = $stmt->fetch()){ $index_nr -= 1; $special_graphics = $row['special_graphics']; if($special_graphics != ''){ $thumb = '/files/publications/'.pathinfo($special_graphics,PATHINFO_FILENAME).'_thumb.jpg'; $special_graphics = '/files/publications/'.$special_graphics; } else { $thumb = ''; } $article_data = array( 'id' => $row['id'], 'authors' => $row['authors'], 'title' => $row['title'], 'journal' => $row['journal'], 'year' => $row['year'], 'doi' => $row['doi'], 'ministerial_pts' => $row['ministerial_pts'], 'special_graphics' => $special_graphics, 'thumb' => $thumb, 'can_edit' => $can_edit, 'index_nr' => $index_nr ); array_push($publications['publications'], $article_data); } } } // Free result set unset($stmt); } else{ unset($pdo); http_response_code(404); include('/pl/404.html'); die(); } } catch(PDOException $e){ die('ERROR: Could not able to execute $sql. ' . $e->getMessage()); } #publication template $publication = $twig->load('publication_pl.html'); ?>
Zakład Fizyki Nanostruktur i Nanotechnologii
Publikacje z roku
Szukaj
Rok
'.$tmp_year.''; } ?>
Sortuj wg. daty dodania
'; } ?>
render($publications); ?>