diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php new file mode 100644 index 00000000000..7f69fd80748 --- /dev/null +++ b/htdocs/contact/fiche.php @@ -0,0 +1,223 @@ + + * + * 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"); +require("../contact.class.php"); + +if ($sortorder == "") +{ + $sortfield="lower(s.nom)"; + $sortorder="ASC"; +} + +if ($HTTP_POST_VARS["action"] == 'add') +{ + $contact = new Contact($db); + + $contact->name = $HTTP_POST_VARS["name"]; + $contact->firstname = $HTTP_POST_VARS["firstname"]; + + $contact->poste = $HTTP_POST_VARS["poste"]; + + $contact->fax = $HTTP_POST_VARS["fax"]; + $contact->note = $HTTP_POST_VARS["note"]; + $contact->email = $HTTP_POST_VARS["email"]; + $contact->phone_pro = $HTTP_POST_VARS["phone_pro"]; + $contact->phone_perso = $HTTP_POST_VARS["phone_perso"]; + $contact->phone_mobile = $HTTP_POST_VARS["phone_mobile"]; + + $_GET["id"] = $contact->create($user); +} + +if ($_GET["action"] == 'delete') +{ + $contact = new Contact($db); + + $contact->old_name = $HTTP_POST_VARS["old_name"]; + $contact->old_firstname = $HTTP_POST_VARS["old_firstname"]; + + $result = $contact->delete($_GET["id"]); + + Header("Location: index.php"); + +} + + +if ($action == 'update') +{ + $contact = new Contact($db); + + $contact->old_name = $HTTP_POST_VARS["old_name"]; + $contact->old_firstname = $HTTP_POST_VARS["old_firstname"]; + + $contact->name = $HTTP_POST_VARS["name"]; + $contact->firstname = $HTTP_POST_VARS["firstname"]; + $contact->poste = $poste; + + $contact->phone_pro = $HTTP_POST_VARS["phone_pro"]; + $contact->phone_perso = $HTTP_POST_VARS["phone_perso"]; + $contact->phone_mobile = $HTTP_POST_VARS["phone_mobile"]; + $contact->fax = $HTTP_POST_VARS["fax"]; + $contact->note = $note; + $contact->email = $HTTP_POST_VARS["email"]; + + $result = $contact->update($HTTP_POST_VARS["contactid"]); + +} + +if ($action == 'create_user') +{ + $nuser = new User($db); + $contact = new Contact($db); + $nuser->nom = $contact->nom; + $nuser->prenom = $contact->prenom; + $result = $contact->fetch($contactid); + $nuser->create_from_contact($contact); +} + +/* + * + * + */ + +llxHeader(); + +if ($_GET["action"] == 'create') +{ + print_fiche_titre ("Création d'un nouveau contact"); + + print "
"; +} +elseif ($_GET["action"] == 'edit') +{ + + print_fiche_titre ("Edition d'un contact"); + + $contact = new Contact($db); + $contact->fetch($_GET["id"]); + + print '"; +} +else +{ + $contact = new Contact($db); + $contact->fetch($_GET["id"]); + + + print_fiche_titre ("Contact : ". $contact->firstname.' '.$contact->name); + + + print '| Nom : '.$contact->name.' '.$contact->firstname;
+
+ if ($contact->email)
+ print ' Email : '.$contact->email; + + print ' | ';
+
+ print 'Tel Pro : '.$contact->phone_pro;
+
+ if ($contact->phone_perso)
+ print ' Tel Perso : '.$contact->phone_perso; + + if($contact->phone_mobile) + print ' Portable : '.$contact->phone_mobile; + + print ' |
| Editer | '; + + print '- | '; + print '- | '; + print '- | '; + + print 'Supprimer | '; + print "
\n";
+
+}
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php
new file mode 100644
index 00000000000..afb4d84ed34
--- /dev/null
+++ b/htdocs/contact/index.php
@@ -0,0 +1,160 @@
+
+ * Copyright (C) 2003 Éric Seigne ";
+ print "
";
+ $db->free();
+} else {
+ print $db->error();
+ print "";
+ print " \n";
+ $var=True;
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object( $i);
+
+ $var=!$var;
+
+ print "";
+ print_liste_field_titre("Nom",$PHP_SELF,"lower(p.name)", $begin);
+ print " ";
+ print_liste_field_titre("Prénom",$PHP_SELF,"lower(p.firstname)", $begin);
+ print " ";
+ print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin);
+ print " email ";
+ print 'Téléphone ';
+ print "";
+
+ print ' \n";
+ $i++;
+ }
+ print "';
+ print '';
+ print img_file();
+ print ''.$obj->name.' ';
+ print "$obj->firstname ";
+
+ print '';
+ if ($obj->nom)
+ {
+ print ' \n";
+
+ print '
';
+ }
+ print "idp\">$obj->nom'.$obj->email.' ';
+
+ print ''.$obj->phone.' ';
+
+ print "
".$sql;
+}
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>