*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-12-12 15:22:40 +00:00
parent fafedbe2d3
commit 00b6716cfa

View File

@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,40 +15,58 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
require("../contact.class.php3");
$db = new Db(); $db = new Db();
if ($sortorder == "") { if ($sortorder == "")
{
$sortfield="lower(s.nom)"; $sortfield="lower(s.nom)";
$sortorder="ASC"; $sortorder="ASC";
} }
if ($action == 'add') { if ($action == 'add')
{
$email = trim($email); $email = trim($email);
if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { 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')"; $sql = "INSERT INTO socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) ";
$result = $db->query($sql); $sql .= " VALUES (now(),$socid,'$name','$firstname','$poste','$phone','$fax','$email')";
if ($result) { $result = $db->query($sql);
Header("Location: fiche.php3?socid=$socid"); if ($result)
{
Header("Location: fiche.php3?socid=$socid");
}
} }
}
} }
if ($action == 'update') { if ($action == 'update')
if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { {
if (strlen(trim($name)) + strlen(trim($firstname)) > 0)
{
$contact = new Contact($db);
$email = trim($email);
$sql = "UPDATE socpeople set name='$name', firstname='$firstname', poste='$poste', phone='$phone',fax='$fax',email='$email', note='$note'"; $contact->name = $name;
$sql .= " WHERE idp=$contactid"; $contact->firstname = $firstname;
$result = $db->query($sql); $contact->poste = $poste;
if ($result) { $contact->phone = $phone;
Header("Location: fiche.php3?socid=$socid"); $contact->fax = $fax;
$contact->note = $note;
$contact->email = $email;
$result = $contact->update($contactid);
if ($result)
{
Header("Location: fiche.php3?socid=$socid");
}
} }
}
} }
llxHeader(); llxHeader();
@ -170,7 +185,7 @@ if ($socid > 0) {
} }
print "<form method=\"post\" action=\"people.php3?socid=$socid\">"; print "<form method=\"post\" action=\"people.php3?socid=$socid\">";
print "<input type=\"hidden\" name=\"action\" value=\"update\">"; print '<input type="hidden" name="action" value="update">';
print "<input type=\"hidden\" name=\"contactid\" value=\"$contactid\">"; print "<input type=\"hidden\" name=\"contactid\" value=\"$contactid\">";
print "<table border=0>"; print "<table border=0>";
print "<tr><td>Numéro</td><td>$obj->idp</td>"; print "<tr><td>Numéro</td><td>$obj->idp</td>";