[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/lolix/cv/ -> liste.php (source)

   1  <?PHP
   2  /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: liste.php,v 1.1 2005/03/04 16:41:55 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/lolix/cv/liste.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  llxHeader("","","Lolix, liste des candidats");
  25  
  26  if ($_GET["action"] == 'deac')
  27  {
  28    $cv = new Cv($db);
  29    $cv->id = $_GET["id"];
  30    $cv->fetch();
  31    $cv->deactivate();
  32  }
  33  
  34  
  35  /*
  36   * Sécurité accés client
  37   */
  38  if ($user->societe_id > 0) 
  39  {
  40    $action = '';
  41    $socidp = $user->societe_id;
  42  }
  43  
  44  if ($page == -1) { $page = 0 ; }
  45  
  46  $offset = $conf->liste_limit * $page ;
  47  $pageprev = $page - 1;
  48  $pagenext = $page + 1;
  49  
  50  $sql = "SELECT c.idp, c.nom, c.prenom";
  51  $sql .= ",".$db->pdate("c.datea")." as da";
  52  $sql .= " FROM lolixfr.candidat as c";
  53  $sql .= " WHERE c.active = 1";
  54  
  55  $sortfield = "c.datea";
  56  $sortorder = "ASC";
  57  
  58  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
  59  
  60  $result = $db->query($sql);
  61  if ($result)
  62  {
  63    $num = $db->num_rows();
  64  
  65  
  66    print_barre_liste("Liste des CV", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num);
  67  
  68    $i = 0;
  69    
  70    if ($sortorder == "DESC")
  71      {
  72        $sortorder="ASC";
  73      }
  74    else
  75      {
  76        $sortorder="DESC";
  77      }
  78    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  79    print '<TR class="liste_titre">';
  80    print "<td>id</td><TD valign=\"center\">";
  81    print_liste_field_titre("Nom",$PHP_SELF,"c.nom");
  82    print "</td><td>";
  83    print_liste_field_titre("Prénom",$PHP_SELF,"c.prenom");
  84    print "</td>";
  85    print "<td align=\"center\">";
  86    print_liste_field_titre("Activé le",$PHP_SELF,"s.fk_departement");
  87    print "</td>";
  88    print "</TR>\n";
  89    $var=True;
  90  
  91    while ($i < min($num,$conf->liste_limit))
  92      {
  93        $obj = $db->fetch_object( $i);
  94        
  95        $var=!$var;
  96  
  97        print "<tr $bc[$var]><td>".($i+1).'</td>';
  98        print '<td><a href="offre.php?id='.$obj->idp.'">';
  99        print img_file();
 100        print "</a>&nbsp;<a href=\"offre.php?id=$obj->idp\">$obj->nom</A></td>\n";      print "<TD>".$obj->prenom."&nbsp;</TD>\n";
 101  
 102        print '<td align="center">'.strftime("%d/%m/%Y",$obj->da)."</td>\n";
 103        print '<td align="center"><a href="liste.php?id='.$obj->idp.'&amp;action=deac">Deac</a></td>';
 104        print "</TR>\n";
 105        $i++;
 106      }
 107    print "</TABLE>";
 108    $db->free();
 109  }
 110  else
 111  {
 112    print $db->error() . ' ' . $sql;
 113  }
 114  
 115  $db->close();
 116  
 117  llxFooter("<em>Derni&egrave;re modification $Date: 2005/03/04 16:41:55 $ r&eacute;vision $Revision: 1.1 $</em>");
 118  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics