[ 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/ -> index.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: index.php,v 1.3 2004/10/23 17:35:45 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/lolix/index.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  $user->getrights('propale');
  25  
  26  if ($user->societe_id > 0)
  27  {
  28    $socidp = $user->societe_id;
  29  }
  30  
  31  llxHeader("","","Lolix");
  32  
  33  function valeur($sql) 
  34  {
  35    global $db;
  36    if ( $db->query($sql) ) 
  37      {
  38        if ( $db->num_rows() ) 
  39      {
  40        $valeur = $db->result(0,0);
  41      }
  42        $db->free();
  43      }
  44    return $valeur;
  45  }
  46  /*
  47   *
  48   */
  49  
  50  print_titre("Espace Lolix");
  51  
  52  print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
  53  print '<tr><td valign="top" width="50%">';
  54  /*
  55   *
  56   *
  57   */
  58  $sql = "SELECT count(*) as cc, o.active";
  59  $sql .= " FROM lolixfr.offre as o ";
  60  $sql .= " GROUP BY o.active DESC";
  61  
  62  $active[1] = "Active";
  63  $active[0] = "Inactive";
  64  $active[-2] = "Inactive";
  65  $active[-3] = "Inactive (désactivée robots)";
  66  $active[-4] = "Inactive (???)";
  67  
  68  if ( $db->query($sql) )
  69  {
  70    $num = $db->num_rows();
  71    $i = 0;
  72    if ($num > 0 )
  73      {
  74        print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
  75        print '<tr class="liste_titre">';
  76        print '<td colspan="2">Offres</td></tr>';
  77        
  78        while ($i < $num)
  79      {
  80        $obj = $db->fetch_object();
  81        $var=!$var;
  82        print "<tr $bc[$var]><td><a href=\"liste.php?catid=".$obj->rowid."\">".$active[$obj->active]."</a></td>";
  83        print '<td align="center">'.$obj->cc."</td></tr>";
  84        $i++;
  85      }
  86        print "</table><br>";
  87      }
  88  }
  89  
  90  /*
  91   *
  92   *
  93   */
  94  print '</td><td valign="top" width="50%">';
  95  /*
  96   *
  97   *
  98   */
  99  $sql = "SELECT count(*) as cc, o.active";
 100  $sql .= " FROM lolixfr.candidat as o ";
 101  $sql .= " GROUP BY o.active DESC";
 102  
 103  $active[1] = "Active";
 104  $active[0] = "Inactive";
 105  $active[-2] = "Inactive";
 106  $active[-3] = "Inactive (désactivée robots)";
 107  $active[-4] = "Inactive (???)";
 108  
 109  if ( $db->query($sql) )
 110  {
 111    $num = $db->num_rows();
 112    $i = 0;
 113    if ($num > 0 )
 114      {
 115        print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
 116        print '<tr class="liste_titre">';
 117        print '<td colspan="2">Candidats</td></tr>';
 118        
 119        while ($i < $num)
 120      {
 121        $obj = $db->fetch_object();
 122        $var=!$var;
 123        print "<tr $bc[$var]><td><a href=\"liste.php?catid=".$obj->rowid."\">".$active[$obj->active]."</a></td>";
 124        print '<td align="center">'.$obj->cc."</td></tr>";
 125        $i++;
 126      }
 127        print "</table><br>";
 128      }
 129  }
 130  
 131  
 132  print '</td></tr>';
 133  print '</table>';
 134  
 135  $db->close();
 136   
 137  
 138  llxFooter("<em>Derni&egrave;re modification $Date: 2004/10/23 17:35:45 $ r&eacute;vision $Revision: 1.3 $</em>");
 139  ?>


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