| [ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 #!/usr/bin/php 2 <?php 3 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 4 * Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 20 * $Id: candidat-desactive.php,v 1.7 2005/10/18 14:03:06 eldy Exp $ 21 * $Source: /cvsroot/dolibarr/dolibarr/scripts/lolix/candidat-desactive.php,v $ 22 * 23 * Désactivation des CV 24 * 25 */ 26 27 // Test si mode batch 28 $sapi_type = php_sapi_name(); 29 if (substr($sapi_type, 0, 3) == 'cgi') 30 { 31 echo "Erreur: Vous utilisez l'interpreteur PHP pour le mode CGI. Pour executer ce script en ligne de commande, vous devez utiliser l'interpreteur PHP pour le mode CLI.\n"; 32 exit; 33 } 34 35 require_once ("../../htdocs/master.inc.php"); 36 require_once(DOL_DOCUMENT_ROOT."/lolix/cv/cv.class.php"); 37 38 39 $error = 0; 40 41 $now = time(); 42 $tlimit = $now - (86400 * 3 * 31); // 3 mois approximatifs 43 44 $sql = "SELECT c.idp"; 45 $sql .= " FROM lolixfr.candidat as c"; 46 $sql .= " WHERE c.active = 1"; 47 $sql .= " AND datea < ".$db->idate($tlimit); 48 $sql .= " ORDER BY c.datea ASC"; 49 $sql .= " LIMIT 3"; 50 51 if ( $db->query($sql) ) 52 { 53 $num = $db->num_rows(); 54 $i = 0; 55 56 dolibarr_syslog("candidat-desactive: ".$num." CV "); 57 58 while ($i < $num) 59 { 60 $obj = $db->fetch_object(); 61 62 dolibarr_syslog("candidat-desactive: desactivation CV ".$obj->idp); 63 64 $cv = new Cv($db); 65 $cv->id = $obj->idp; 66 $cv->fetch(); 67 $cv->deactivate(); 68 $i++; 69 } 70 } 71 else 72 { 73 print "Error"; 74 } 75 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
|