* * $Id$ * $Source$ * * 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. * */ require("./pre.inc.php3"); require("../lib/functions.inc.php3"); require("../../www/lib/company.class.php3"); /* * */ llxHeader(); $db = new Db(); if ($sortorder == "") { $sortfield="lower(s.nom)"; $sortorder="ASC"; } $active["1"] = "Offres en ligne"; $active["-1"] = "Moderation"; $active["-2"] = "Refusées"; $active["0"] = "Rédaction"; $active["-3"] = "Désactivées"; $active["-4"] = "Supprimées"; $yn["t"] = "oui"; $yn["f"] = "non"; if ($action == 'stcomm') { $sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid"; $result = $db->query($sql); $sql = "INSERT INTO socstatutlog (datel, fk_soc, fk_statut, author) VALUES (now(),$socid,$stcommid,'" . $GLOBALS["REMOTE_USER"] . "')"; $result = $db->query($sql); if ($actioncommid) { $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc) VALUES (now(),$actioncommid,$socid)"; $result = $db->query($sql); } } if ($socid > 0) { $soc = new Company($db, $socid); $soc->fetch(); /* * */ $sql = "SELECT s.idp, s.nom,".$db->pdate("s.datec")." as dc,".$db->pdate("s.datem")." as dm,".$db->pdate("s.datea")." as da, s.intern, s.cjn, s.c_nom, s.c_prenom, s.c_tel, s.c_mail, s.tel, s.fax, s.fplus, s.cjn, s.viewed, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM societe as s, c_stcomm as st "; $sql .= " WHERE s.fk_stcomm=st.id"; $sql .= " AND s.idp = $socid"; $result = $db->query($sql); if ($result) { $objsoc = $db->fetch_object($result , 0); print "\n"; print "" ; print ""; print "\n"; print "\n"; print "
N° $objsoc->idp - $soc->nom - [$soc->stcomm]
"; print "tel : $soc->tel
"; print "fax : $soc->fax
"; print "$soc->cp $soc->ville
"; if ($objsoc->url) { print "url\">$soc->url
"; } print "
Contact :
$soc->c_nom $soc->c_prenom"; print "
tel : $soc->c_tel"; print "
email : $soc->c_mail"; print "
"; print ""; print ""; print "" ; print "" ; print ""; print ""; print "\n"; print ""; print "
Créée le" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "
Dernière modif le" . strftime("%d %b %Y %H:%M", $objsoc->dm) . "
Fiche société".$yn[$objsoc->fplus]."
Cojonet".$yn["$objsoc->cjn"]."
Consult Fiche$objsoc->viewed
Offres"; print "
"; $sql = "SELECT count(idp) as cc, active FROM offre WHERE fk_soc = $objsoc->idp GROUP by active ORDER BY active DESC"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); while ($i < $num) { $obj = $db->fetch_object( $i); print ""; $i++; } print "
".$active["$obj->active"] . ":$obj->cc
Divers
"; print ""; $sql = "SELECT count(idp) as cc FROM abo_soc WHERE fksoc = $objsoc->idp GROUP by active"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); while ($i < $num) { $obj = $db->fetch_object( $i); print ""; $i++; } $sql = "SELECT count(idp) as cc FROM socfollowresume WHERE fk_soc = $objsoc->idp"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); while ($i < $num) { $obj = $db->fetch_object( $i); print ""; $i++; } $sql = "SELECT count(idp) as cc FROM soccontact WHERE fk_soc = $objsoc->idp"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); while ($i < $num) { $obj = $db->fetch_object( $i); print ""; $i++; } print "
Abonnements :$obj->cc
Cand. suivis :$obj->cc
Contacts :$obj->cc
"; print "
"; /* * * */ print ""; /* * * */ print "
"; print ""; $sql = "SELECT a.id,".$db->pdate("a.datel")." as da, c.libelle, a.author FROM socstatutlog as a, c_stcomm as c WHERE a.fk_soc = $objsoc->idp AND c.id=a.fk_statut ORDER by a.datel DESC"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { $obj = $db->fetch_object( $i); if ($tag) { print ""; } else { print ""; } print ""; print ""; print ""; print "\n"; $i++; $tag = !$tag; } print "
". strftime("%d %b %Y %H:%M", $obj->da) ."$obj->libelle$obj->author
"; print "
"; print ""; $sql = "SELECT a.id,".$db->pdate("a.datea")." as da, c.libelle, a.author FROM actioncomm as a, c_actioncomm as c WHERE a.fk_soc = $objsoc->idp AND c.id=a.fk_action ORDER by a.datea DESC"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { $obj = $db->fetch_object( $i); if ($tag) { print ""; } else { print ""; } print ""; print ""; print ""; print "\n"; $i++; $tag = !$tag; } print "
". strftime("%d %b %Y %H:%M", $obj->da) ."$obj->libelle$obj->author
"; print "
"; print ""; print ""; print ""; print "
"; print "
"; print ""; print "
"; print ""; print "
".nl2br($objsoc->note)."
"; } else { print $db->error(); } } $db->free(); $db->close(); llxFooter(); ?>