* * $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"); $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"; $deacmeth["b"] = "robots"; if ($action == 'add') { $email = trim($email); if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { $sql = "INSERT INTO socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) "; $sql .= " VALUES (now(),$socid,'$name','$firstname','$poste','$phone','$fax','$email')"; $result = $db->query($sql); if ($result) { Header("Location: fiche.php3?socid=$socid"); } } } if ($action == 'update') { if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { $email = trim($email); $sql = "UPDATE socpeople set name='$name', firstname='$firstname', poste='$poste', phone='$phone',fax='$fax',email='$email', note='$note'"; $sql .= " WHERE idp=$contactid"; $result = $db->query($sql); if ($result) { Header("Location: fiche.php3?socid=$socid"); } } } llxHeader(); if ($page == -1) { $page = 0 ; } $limit = 26; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; if ($socid > 0) { $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, 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"; if ($to == 'next') { $sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; } else { $sql .= " AND s.idp = $socid"; } $result = $db->query($sql); if ($result) { $objsoc = $db->fetch_object( 0); /* * * */ print "
Contacts pour la société : idp\">$objsoc->nom | ";
print "[Ajouter un contact] | "; print '
| ";
print "tel : $objsoc->tel "; print "fax : $objsoc->fax "; print "$objsoc->cp $objsoc->ville "; if ($objsoc->url) { print "url\">$objsoc->url "; } print " | \n";
print "
|
| ".nl2br($objsoc->note)." |
| Prénom Nom | "; print "Poste | Tel | "; print "Fax | |
| $obj->firstname $obj->name | "; print "$obj->poste | "; print "$obj->phone | "; print "$obj->fax | "; print "email\">$obj->email | "; print "
| Action | "; print "Fax | ||
| ". strftime("%d %b %Y %H:%M", $obj->da) ." | "; if ($obj->propalrowid) { print "propalrowid\">$obj->libelle | "; } else { print "$obj->libelle | "; } print "$obj->code | "; print "
| ' . $db->error() . ' |