diff --git a/htdocs/comm/contact.php3 b/htdocs/comm/contact.php3 new file mode 100644 index 00000000000..c4306dec0d2 --- /dev/null +++ b/htdocs/comm/contact.php3 @@ -0,0 +1,135 @@ + + * + * $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"); + + +llxHeader(); +$db = new Db(); +if ($sortorder == "") { + $sortorder="ASC"; +} +if ($sortfield == "") { + $sortfield="p.name"; +} + +if ($page == -1) { $page = 0 ; } +$limit = 26; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +print "
"; + +print "<- Prev\n| "; +print "*\n| "; +for ($i = 65 ; $i < 91; $i++) { + print ""; + + if ($begin == chr($i) ) { + print "->" . chr($i) . "<-" ; + } else { + print chr($i) ; + } + print " | "; +} +print " Next ->\n"; +print "

"; + + +/* + * Mode liste + * + * + * + */ + +$bc[1]="bgcolor=\"#90c090\""; +$bc[0]="bgcolor=\"#b0e0b0\""; + +$sql = "SELECT s.idp, s.nom, cabrecrut, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email "; +$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc"; + +if (strlen($stcomm)) { + $sql .= " AND s.fk_stcomm=$stcomm"; +} + +if (strlen($begin)) { + $sql .= " AND upper(p.name) like '$begin%'"; +} + +if ($contactname) { + $sql .= " AND lower(p.name) like '%".strtolower($contactname)."%'"; + $sortfield = "lower(p.name)"; + $sortorder = "ASC"; +} + +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); + +$result = $db->query($sql); +if ($result) { + $num = $db->num_rows(); + $i = 0; + + if ($sortorder == "DESC") { + $sortorder="ASC"; + } else { + $sortorder="DESC"; + } + print "

"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ''; + print "\n"; + $var=True; + while ($i < $num) { + $obj = $db->fetch_object( $i); + + $var=!$var; + + print ""; + + print ""; + print ""; + print "\n"; + print "\n"; + print ''; + print "\n"; + print "\n"; + $i++; + } + print "
ActionNomPrénomemailSocieteStatut 
idp\">T | "; + print "idp\">E | "; + print "idp\">F ]"; + + print "$obj->name$obj->firstname$obj->emailidp\">$obj->nom'.$obj->stcomm.'idp&setcontact=$obj->cidp&action=create\">[Propal]
"; + $db->free(); +} else { + print $db->error(); +} + +$db->close(); + +llxFooter(); +?>