[ 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/ -> cv.class.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: cv.class.php,v 1.1 2005/03/04 16:41:55 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/lolix/cv/cv.class.php,v $
  20   *
  21   */
  22  
  23  class Cv {
  24    var $db;
  25    var $id;
  26   
  27    Function Cv($DB, $id=0)
  28    {
  29      $this->db = $DB;
  30      $this->id = $id;
  31  
  32      return 1;
  33    }
  34  
  35    /*
  36     *
  37     *
  38     */
  39    Function fetch()
  40      {
  41        $sql = "SELECT c.idp, c.nom, c.prenom, c.email";
  42        $sql .= " FROM lolixfr.candidat as c";
  43        $sql .= " WHERE c.idp = ".$this->id;
  44  
  45        $result = $this->db->query($sql);
  46  
  47        if ($result)
  48      {
  49        if ($this->db->num_rows())
  50          {
  51            $obj = $this->db->fetch_object(0);
  52  
  53            $this->id = $obj->idp;
  54            $this->active = $obj->active;
  55            $this->date_activation = $obj->da;
  56            $this->nom    = stripslashes($obj->nom);
  57            $this->prenom = stripslashes($obj->prenom);
  58            $this->email  = stripslashes($obj->email);
  59  
  60            return 1;
  61            
  62          }
  63        $this->db->free();
  64      }
  65        else
  66      {
  67        print $this->db->error();
  68      }
  69    }
  70    
  71  
  72    Function deactivate()
  73    {
  74      $sql = "UPDATE lolixfr.candidat SET active=0,deacmeth='b',pubkey='$digest' WHERE idp=" . $this->id;    
  75      $result = $this->db->query($sql);
  76      
  77      $sql = "INSERT INTO lolixfr.res_statutlog (datel, fk_cand, fk_statut,author)";
  78      $sql .= " VALUES (now(),$this->id,0,'bots')";
  79      $result = $this->db->query($sql);
  80    
  81      $header = "From: webmaster@lolix.org\r\nReply-To: webmaster@lolix.org\r\nX-Mailer: Dolibarr";
  82  
  83      $email = $this->email;
  84  
  85      $message = '  Bonjour,
  86  
  87     Le CV que vous avez déposé sur http://fr.lolix.org est arrivé à expiration, 
  88  celui-ci n\'est plus consultable en ligne, nous vous invitons à le réactiver si
  89  vous êtes toujours à la recherche d\'un emploi.
  90  
  91  
  92  Cordialement,
  93  
  94  ---
  95  L\'équipe Lolix - http://fr.lolix.org/
  96  Le guide des prestataires logiciels libres - http://www.support-libre.com
  97  ';
  98  
  99  
 100      mail($email, "Desactivation de votre CV sur Lolix", $message, $header);
 101  
 102      print "mail sent to : $email";
 103  
 104    }  
 105  }
 106  
 107  ?>


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