Login   Register  
PHP Classes
elePHPant
Icontem

File: pages/p_publications.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Javier AP  >  Pergamus Publication Manager  >  pages/p_publications.php  >  Download  
File: pages/p_publications.php
Role: Application script
Content type: text/plain
Description: This script shows the collection items
Class: Pergamus Publication Manager
Web based manager for scientific publications
Author: By
Last change: New version 1.0.
Date: 9 years ago
Size: 2,224 bytes
 

Contents

Class file image Download
<?php
include '../class/class_collection.php';
include 
'../class/class_publication.php';
include 
'../class/autentification.php';
if(
$action == 'remove') {
 
$bib =& new Collection('publications');
 
$bib->remove_by_attr('title',urldecode($title));
 
$bib =& new Collection('publications');
 
$bib->save();
 if(
$file != ''unlink('../pubs/'.$file);
} else if (
$accion == 'modify') {
}
?>
<html>
<head>
<title>Pergamus Publication Manager</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html" charset="iso-8859-1">
</head>
<body>
 <div class="main">
  <h1>Publication list</h1>  
  <?php include 'p_session_bar.php'?>
  <table width="100%" border="0">
  <form action="p_publications.php" method="get">
  <tr><td><i>Author:</i> <input type="text" name="f_author"></td><td><i>Title:</i> <input type="text" name="f_title"></td><td><input type="submit" value="Search"></td><td><font size="1"><a href="p_search.php">Advanced<br>search</a></font></td></tr>
  </form>
  </table>
  <?php 
  $last_year 
'';  
  
$filters = array();
  if(
$f_author != ''$filters['author'] = trim($f_author);
  if(
$f_title != ''$filters['title'] = trim($f_title);
  if(
$f_year != ''$filters['year'] = trim($f_year);
  if(
$f_type != ''$filters['type'] = trim($f_type);
  if(
count($filters) == && $mode != 'edit'){
      include(
'last_pubs.inc');  
  }else{
        
$bib =& new Collection('publications');
    print 
"<ul>\n";
    foreach(
$bib->build_all_pubs($filters) as $id => $pub){
    
$year substr($id,0,4);
        if(
$year != $last_year) print '<h2>'.$year."</h2><br>\n";
        print 
'<li>'.$pub->print_data();
        if(
$mode == 'edit'){
        print(
' [ <a href="p_publications.php?mode=edit&action=remove');
        if(
$pub->metadata['file'] != '') print('&file='.$pub->metadata['file']);
        print(
'&title='.urlencode($pub->metadata['title']).'"><i><u>remove</u></i></a> |');
        print(
' <a href="p_pubform.php?modify=true&bibtex_id='.urlencode($id).'"><i><u>modify</u></i></a> ]');
        }  
        print 
"</li><br>\n"
        
$last_year substr($id,0,4);
    }
    print 
"</ul>\n";
  }
  
?>
  <?php include 'p_banner.php'?>
  <p>&nbsp;</p>  
</div>    
</body>
</html>