*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-12-12 16:42:08 +00:00
parent 5e47c3f791
commit 66b02671a5
2 changed files with 62 additions and 45 deletions

View File

@ -48,36 +48,45 @@ print_barre_liste("Liste des contacts",$page, $PHP_SELF);
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone "; $sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc"; $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)) { if (strlen($stcomm)) // statut commercial
{
$sql .= " AND s.fk_stcomm=$stcomm"; $sql .= " AND s.fk_stcomm=$stcomm";
} }
if (strlen($begin)) { if (strlen($begin)) // filtre sur la premiere lettre du nom
{
$sql .= " AND upper(p.name) like '$begin%'"; $sql .= " AND upper(p.name) like '$begin%'";
} }
if ($contactname) { if ($contactname) // acces a partir du module de recherche
$sql .= " AND lower(p.name) like '%".strtolower($contactname)."%'"; {
$sql .= " AND ( lower(p.name) like '%".strtolower($contactname)."%' OR lower(p.firstname) like '%".strtolower($contactname)."%') ";
$sortfield = "lower(p.name)"; $sortfield = "lower(p.name)";
$sortorder = "ASC"; $sortorder = "ASC";
} }
if ($socid) { if ($socid)
{
$sql .= " AND s.idp = $socid"; $sql .= " AND s.idp = $socid";
} }
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) {
if ($result)
{
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
if ($sortorder == "DESC") { if ($sortorder == "DESC")
$sortorder="ASC"; {
} else { $sortorder="ASC";
$sortorder="DESC"; }
} else
{
$sortorder="DESC";
}
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<TD>Nom</TD>"; print "<TD>Nom</TD>";
@ -87,27 +96,28 @@ if ($result) {
print '<TD>Téléphone</TD><td>&nbsp;</td>'; print '<TD>Téléphone</TD><td>&nbsp;</td>';
print "</TR>\n"; print "</TR>\n";
$var=True; $var=True;
while ($i < $num) { while ($i < $num)
$obj = $db->fetch_object( $i); {
$obj = $db->fetch_object( $i);
$var=!$var; $var=!$var;
print "<TR $bc[$var]>"; print "<TR $bc[$var]>";
print "<TD>$obj->name</TD>"; print "<TD>$obj->name</TD>";
print "<TD>$obj->firstname</TD>"; print "<TD>$obj->firstname</TD>";
print '<TD><a href="contact.php3?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;'; print '<TD><a href="contact.php3?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;';
print "<a href=\"fiche.php3?socid=$obj->idp\">$obj->nom</A></td>\n"; print "<a href=\"fiche.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
print '<td><a href="action/fiche.php3?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php3?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a>&nbsp;</td>';
print '<td><a href="action/fiche.php3?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a>&nbsp;</td>'; print '<td><a href="action/fiche.php3?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a>&nbsp;</td>';
print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&setcontact=$obj->cidp&action=create\">[Propal]</A></td>\n"; print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&setcontact=$obj->cidp&action=create\">[Propal]</A></td>\n";
print "</TR>\n"; print "</TR>\n";
$i++; $i++;
} }
print "</TABLE>"; print "</TABLE>";
$db->free(); $db->free();
} else { } else {

View File

@ -93,11 +93,14 @@ function top_menu($head) {
} }
print '<TD width="15%" class="menu" align="center">'; print '<TD width="15%" class="menu" align="center">';
if ($user->compta > 0) { if ($user->compta > 0)
print '<A class="menu" href="/compta/">Compta</A></TD>'; {
} else { print '<A class="menu" href="/compta/">Compta</A></TD>';
print '-'; }
} else
{
print '-';
}
print '<TD width="15%" class="menu" align="center">'; print '<TD width="15%" class="menu" align="center">';
@ -123,7 +126,8 @@ function top_menu($head) {
print "<TR><TD valign=\"top\" align=\"right\">"; print "<TR><TD valign=\"top\" align=\"right\">";
} }
function left_menu($menu) { function left_menu($menu)
{
global $conf; global $conf;
/* /*
* Colonne de gauche * Colonne de gauche
@ -134,21 +138,23 @@ function left_menu($menu) {
print '<TABLE border="0" width="100%" cellspacing="1" cellpadding="4">'; print '<TABLE border="0" width="100%" cellspacing="1" cellpadding="4">';
for ($i = 0 ; $i < sizeof($menu) ; $i++) { for ($i = 0 ; $i < sizeof($menu) ; $i++)
{
print "<TR><TD class=\"barre\" valign=\"top\">"; print "<TR><TD class=\"barre\" valign=\"top\">";
print '<A class="menu" href="'.$menu[$i][0].'">'.$menu[$i][1].'</a>'; print '<A class="menu" href="'.$menu[$i][0].'">'.$menu[$i][1].'</a>';
for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2) { for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2)
print '<br>&nbsp;-&nbsp;<a class="submenu" href="'.$menu[$i][$j].'">'.$menu[$i][$j+1].'</A>'; {
print '<br>&nbsp;-&nbsp;<a class="submenu" href="'.$menu[$i][$j].'">'.$menu[$i][$j+1].'</A>';
}
print '</td></tr>';
} }
print '</td></tr>';
}
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">"; print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print '<A class="menu" href="/comm/clients.php3">Societes</A>'; print '<A class="menu" href="/comm/clients.php3">Societes</A>';
print '<form action="/comm/index.php3">'; print '<form action="/comm/clients.php3">';
print '<input type="hidden" name="mode" value="search">'; print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">'; print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;'; print '<input type="text" name="socname" size="8">&nbsp;';
@ -174,7 +180,8 @@ function left_menu($menu) {
} }
function llxFooter($foot='') { function llxFooter($foot='')
{
print "</TD></TR>"; print "</TD></TR>";
/* /*
* *