Nouveaux fichiers

This commit is contained in:
Rodolphe Quiedeville 2004-10-08 16:44:04 +00:00
parent 65f9e987b2
commit fa7b5f2b1c
7 changed files with 646 additions and 1 deletions

139
htdocs/lolix/index.php Normal file
View File

@ -0,0 +1,139 @@
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
$user->getrights('propale');
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
llxHeader("","","Lolix");
function valeur($sql)
{
global $db;
if ( $db->query($sql) )
{
if ( $db->num_rows() )
{
$valeur = $db->result(0,0);
}
$db->free();
}
return $valeur;
}
/*
*
*/
print_titre("Espace Lolix");
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="50%">';
/*
*
*
*/
$sql = "SELECT count(*) as cc, o.active";
$sql .= " FROM lolixfr.offre as o ";
$sql .= " GROUP BY o.active DESC";
$active[1] = "Active";
$active[0] = "Inactive";
$active[-2] = "Inactive";
$active[-3] = "Inactive (désactivée robots)";
$active[-4] = "Inactive (???)";
if ( $db->query($sql) )
{
$num = $db->num_rows();
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">Offres</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object($i);
$var=!$var;
print "<tr $bc[$var]><td><a href=\"liste.php?catid=".$obj->rowid."\">".$active[$obj->active]."</a></td>";
print '<td align="center">'.$obj->cc."</td></tr>";
$i++;
}
print "</table><br>";
}
}
/*
*
*
*/
print '</td><td valign="top" width="50%">';
/*
*
*
*/
$sql = "SELECT count(*) as cc, o.active";
$sql .= " FROM lolixfr.candidat as o ";
$sql .= " GROUP BY o.active DESC";
$active[1] = "Active";
$active[0] = "Inactive";
$active[-2] = "Inactive";
$active[-3] = "Inactive (désactivée robots)";
$active[-4] = "Inactive (???)";
if ( $db->query($sql) )
{
$num = $db->num_rows();
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">Candidats</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object($i);
$var=!$var;
print "<tr $bc[$var]><td><a href=\"liste.php?catid=".$obj->rowid."\">".$active[$obj->active]."</a></td>";
print '<td align="center">'.$obj->cc."</td></tr>";
$i++;
}
print "</table><br>";
}
}
print '</td></tr>';
print '</table>';
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -93,7 +93,7 @@ class LolixSociete {
{
$this->id = $socid;
$sql = "SELECT s.nom,s.siren,tel,url,fax";
$sql = "SELECT s.nom,s.active,s.siren,s.tel,s.url,s.fax,";
$sql .= $this->db->pdate("s.datec")." as dc";
$sql .= " FROM lolixfr.societe as s";
$sql .= " WHERE s.idp = ".$this->id;
@ -105,6 +105,7 @@ class LolixSociete {
$obj = $this->db->fetch_object(0);
$this->nom = $obj->nom;
$this->active = $obj->active;
$this->tel = $obj->tel;
$this->fax = $obj->fax;
$this->url = $obj->url;

76
htdocs/lolix/pre.inc.php Normal file
View File

@ -0,0 +1,76 @@
<?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("../main.inc.php");
require_once DOL_DOCUMENT_ROOT."/lolix/lolix.societe.class.php";
function llxHeader($head = "", $urlp = "", $title="")
{
global $user, $conf, $db;
/*
*
*
*/
top_menu($head, $title);
$menu = new Menu();
$menu->add(DOL_URL_ROOT."/lolix/index.php", "Lolix");
$menu->add_submenu(DOL_URL_ROOT."/lolix/liste.php", "Liste des offres");
$menu->add_submenu(DOL_URL_ROOT."/lolix/cv/liste.php", "Liste des CV");
$menu->add(DOL_URL_ROOT."/lolix/societe/", "Sociétés");
$menu->add_submenu(DOL_URL_ROOT."/lolix/societe/activation.php", "Activation");
$menu->add_submenu(DOL_URL_ROOT."/lolix/societe/liste.php", "Liste");
$menu->add(DOL_URL_ROOT."/lolix/tode.php", "Offres à désactiver");
$menu->add(DOL_URL_ROOT."/lolix/linuxmag.php", "Linux Mag");
left_menu($menu->liste);
}
Function fiche_header($id)
{
$h = 0;
$head[0][0] = DOL_URL_ROOT.'/lolix/offre.php?id='.$id;
$head[0][1] = "Offre";
$h++;
for($i = 0 ; $i < sizeof($head) ; $i++)
{
if (strstr($head[$i][0], $GLOBALS["SCRIPT_URL"]) )
{
$a = $i;
// sort de la boucle
$i = sizeof($head);
}
}
dolibarr_fiche_head($head, $a);
}
?>

View File

@ -0,0 +1,110 @@
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader("","","Lolix - Société a activer");
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
}
if ($page == -1) { $page = 0 ; }
$offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT s.idp,s.nom, s.ville,".$db->pdate("datec") ." as da";
$sql .= " FROM lolixfr.societe as s";
$sql .= " WHERE active = 0";
$sortfield = "s.datec";
$sortorder = "DESC";
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
print_barre_liste("Societe a activer", $page, "activation.php","",$sortfield,$sortorder,'',$num);
$i = 0;
if ($sortorder == "DESC")
{
$sortorder="ASC";
}
else
{
$sortorder="DESC";
}
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">';
print "<TD valign=\"center\">";
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
print "</td><td>";
print_liste_field_titre("Ville",$PHP_SELF,"s.ville");
print "</td><td>&nbsp;</td>";
print "</tr>\n";
$var=True;
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object( $i);
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="fiche.php?id='.$obj->idp.'">';
print img_file();
print "&nbsp;".$obj->nom.'</td>';
print "</a>&nbsp;<a href=\"offre.php?id=$obj->idp\">$obj->ref</A></td>\n";
print "<TD>".$obj->ville."&nbsp;</TD>\n";
print '<td align="center">'.strftime("%d/%m/%Y",$obj->da)."</td>\n";
print "</TR>\n";
$i++;
}
print "</TABLE>";
$db->free();
}
else
{
print $db->error() . ' ' . $sql;
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -0,0 +1,139 @@
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
$user->getrights('propale');
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
llxHeader("","","Lolix");
function valeur($sql)
{
global $db;
if ( $db->query($sql) )
{
if ( $db->num_rows() )
{
$valeur = $db->result(0,0);
}
$db->free();
}
return $valeur;
}
/*
*
*/
print_titre("Espace Lolix");
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="50%">';
/*
*
*
*/
$sql = "SELECT count(*) as cc, o.active";
$sql .= " FROM lolixfr.offre as o ";
$sql .= " GROUP BY o.active DESC";
$active[1] = "Active";
$active[0] = "Inactive";
$active[-2] = "Inactive";
$active[-3] = "Inactive (désactivée robots)";
$active[-4] = "Inactive (???)";
if ( $db->query($sql) )
{
$num = $db->num_rows();
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">Offres</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object($i);
$var=!$var;
print "<tr $bc[$var]><td><a href=\"liste.php?catid=".$obj->rowid."\">".$active[$obj->active]."</a></td>";
print '<td align="center">'.$obj->cc."</td></tr>";
$i++;
}
print "</table><br>";
}
}
/*
*
*
*/
print '</td><td valign="top" width="50%">';
/*
*
*
*/
$sql = "SELECT count(*) as cc, o.active";
$sql .= " FROM lolixfr.candidat as o ";
$sql .= " GROUP BY o.active DESC";
$active[1] = "Active";
$active[0] = "Inactive";
$active[-2] = "Inactive";
$active[-3] = "Inactive (désactivée robots)";
$active[-4] = "Inactive (???)";
if ( $db->query($sql) )
{
$num = $db->num_rows();
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">Candidats</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object($i);
$var=!$var;
print "<tr $bc[$var]><td><a href=\"liste.php?catid=".$obj->rowid."\">".$active[$obj->active]."</a></td>";
print '<td align="center">'.$obj->cc."</td></tr>";
$i++;
}
print "</table><br>";
}
}
print '</td></tr>';
print '</table>';
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -0,0 +1,110 @@
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("./pre.inc.php");
llxHeader("","","Lolix, liste des offres");
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
}
if ($page == -1) { $page = 0 ; }
$offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT s.nom, s.ville,".$db->pdate("datea") ." as da";
$sql .= " FROM lolixfr.societe as s";
$sortfield = "s.nom";
$sortorder = "DESC";
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
print_barre_liste("Liste des offres", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num);
$i = 0;
if ($sortorder == "DESC")
{
$sortorder="ASC";
}
else
{
$sortorder="DESC";
}
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">';
print "<TD valign=\"center\">";
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
print "</td><td>";
print_liste_field_titre("Ville",$PHP_SELF,"s.ville");
print "</td><td>&nbsp;</td>";
print "</tr>\n";
$var=True;
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object( $i);
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="fiche.php?id='.$obj->idp.'">';
print img_file();
print "&nbsp;".$obj->nom.'</td>';
print "</a>&nbsp;<a href=\"offre.php?id=$obj->idp\">$obj->ref</A></td>\n";
print "<TD>".$obj->ville."&nbsp;</TD>\n";
print '<td align="center">'.strftime("%d/%m/%Y",$obj->da)."</td>\n";
print "</TR>\n";
$i++;
}
print "</TABLE>";
$db->free();
}
else
{
print $db->error() . ' ' . $sql;
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -0,0 +1,70 @@
<?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
require("../../main.inc.php");
require_once DOL_DOCUMENT_ROOT."/lolix/lolix.societe.class.php";
function llxHeader($head = "", $urlp = "", $title="")
{
global $user, $conf, $db;
/*
*
*
*/
top_menu($head, $title);
$menu = new Menu();
$menu->add(DOL_URL_ROOT."/lolix/index.php", "Lolix");
$menu->add(DOL_URL_ROOT."/lolix/societe/", "Sociétés");
$menu->add_submenu(DOL_URL_ROOT."/lolix/societe/activation.php", "Activation");
$menu->add_submenu(DOL_URL_ROOT."/lolix/societe/liste.php", "Liste");
$menu->add(DOL_URL_ROOT."/lolix/tode.php", "Offres à désactiver");
$menu->add(DOL_URL_ROOT."/lolix/linuxmag.php", "Linux Mag");
left_menu($menu->liste);
}
Function fiche_header($id)
{
$h = 0;
$head[0][0] = DOL_URL_ROOT.'/lolix/societe/fiche.php?id='.$id;
$head[0][1] = "Societe";
$h++;
for($i = 0 ; $i < sizeof($head) ; $i++)
{
if (strstr($head[$i][0], $GLOBALS["SCRIPT_URL"]) )
{
$a = $i;
// sort de la boucle
$i = sizeof($head);
}
}
dolibarr_fiche_head($head, $a);
}
?>