From b4dbf9478b68d37626ce183b55e9de4003237431 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 8 Jul 2003 20:03:08 +0000 Subject: [PATCH] Correction noms de tables --- htdocs/fourn/fiche.php3 | 178 ++++++++++++++++++++++------------------ 1 file changed, 98 insertions(+), 80 deletions(-) diff --git a/htdocs/fourn/fiche.php3 b/htdocs/fourn/fiche.php3 index b113f8c1a25..9e97330b188 100644 --- a/htdocs/fourn/fiche.php3 +++ b/htdocs/fourn/fiche.php3 @@ -76,14 +76,16 @@ if ($action == 'stcomm') { } } - if ($actioncommid) { - $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; - $result = @$db->query($sql); - - if (!$result) { - $errmesg = "ERREUR DE DATE !"; + if ($actioncommid) + { + $sql = "INSERT INTO llx_actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; + $result = @$db->query($sql); + + if (!$result) + { + $errmesg = "ERREUR DE DATE !"; + } } - } } /* @@ -114,26 +116,33 @@ if ($mode == 'search') { if ($socid > 0) { $societe = new Societe($db, $socid); - $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.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM llx_societe as s, c_stcomm as st, c_typent as t, c_effectif as e "; + $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.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description"; + $sql .= " FROM llx_societe as s, c_stcomm as st, c_typent as t, c_effectif as e "; $sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id"; - if ($to == 'next') { - $sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; - } elseif ($to == 'prev') { - $sql .= " AND s.idp < $socid ORDER BY idp DESC LIMIT 1"; - } else { - $sql .= " AND s.idp = $socid"; - } - + if ($to == 'next') + { + $sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; + } + elseif ($to == 'prev') + { + $sql .= " AND s.idp < $socid ORDER BY idp DESC LIMIT 1"; + } + else + { + $sql .= " AND s.idp = $socid"; + } + $result = $db->query($sql); - if ($result) { - $objsoc = $db->fetch_object(0); + if ($result) + { + $objsoc = $db->fetch_object(0); - $dac = strftime("%Y-%m-%d %H:%M", time()); - if ($errmesg) { - print "$errmesg
"; - } + $dac = strftime("%Y-%m-%d %H:%M", time()); + if ($errmesg) { + print "$errmesg
"; + } /* * @@ -263,7 +272,8 @@ if ($socid > 0) { print "FaxEmail"; print "idp&action=addcontact\">Ajouter"; - $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; + $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; + $sql .= " FROM llx_socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; $result = $db->query($sql); $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { @@ -302,71 +312,79 @@ if ($socid > 0) { * */ $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u "; $sql .= " WHERE a.fk_soc = $objsoc->idp "; $sql .= " AND u.rowid = a.fk_user_author"; $sql .= " AND c.id=a.fk_action "; $sql .= " ORDER BY a.datea DESC, a.id DESC"; - if ( $db->query($sql) ) { - print "\n"; - print ''; + if ( $db->query($sql) ) + { + print "
Actions
\n"; + print ''; - $i = 0 ; $num = $db->num_rows(); $tag = True; - while ($i < $num) { - $obj = $db->fetch_object( $i); - if ($tag) { - print ""; - } else { - print ""; - } - - if ($oldyear == strftime("%Y",$obj->da) ) { - print ''; - } else { - print "\n"; - $oldyear = strftime("%Y",$obj->da); - } - - if ($oldmonth == strftime("%Y%b",$obj->da) ) { - print ''; - } else { - print "\n"; - $oldmonth = strftime("%Y%b",$obj->da); - } + $i = 0 ; $num = $db->num_rows(); $tag = True; + while ($i < $num) + { + $obj = $db->fetch_object( $i); + if ($tag) + { + print ""; + } + else + { + print ""; + } + + if ($oldyear == strftime("%Y",$obj->da) ) + { + print ''; + } + else + { + print "\n"; + $oldyear = strftime("%Y",$obj->da); + } + + if ($oldmonth == strftime("%Y%b",$obj->da) ) { + print ''; + } else { + print "\n"; + $oldmonth = strftime("%Y%b",$obj->da); + } + + print "\n"; + print "\n"; + + if ($obj->propalrowid) { + print ''; + } else { + print ''; + } + /* + * Contact pour cette action + * + */ + if ($obj->fk_contact) { + $contact = new Contact($db); + $contact->fetch($obj->fk_contact); + print ''; + } else { + print ''; + } + /* + */ + print ''; + print "\n"; + $i++; + $tag = !$tag; + } + print "
Actions
|" .strftime("%Y",$obj->da)."|" .strftime("%b",$obj->da)."
|" .strftime("%Y",$obj->da)."|" .strftime("%b",$obj->da)."" .strftime("%d",$obj->da)."" .strftime("%H:%M",$obj->da)."'.$obj->libelle.''.$obj->libelle.''.$contact->fullname.' '.$obj->code.'
"; - print "" .strftime("%d",$obj->da)."\n"; - print "" .strftime("%H:%M",$obj->da)."\n"; - - if ($obj->propalrowid) { - print ''.$obj->libelle.''; - } else { - print ''.$obj->libelle.''; - } - /* - * Contact pour cette action - * - */ - if ($obj->fk_contact) { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''.$contact->fullname.''; - } else { - print ' '; - } - /* - */ - print ''.$obj->code.''; - print "\n"; - $i++; - $tag = !$tag; + $db->free(); + } else { + print $db->error() . "
" . $sql; } - print ""; - - $db->free(); - } else { - print $db->error(); - } print ""; /* *