diff --git a/htdocs/comm/docsoc.php b/htdocs/comm/docsoc.php new file mode 100644 index 00000000000..167898a189e --- /dev/null +++ b/htdocs/comm/docsoc.php @@ -0,0 +1,176 @@ + + * + * 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.php3"); + +llxHeader(); + +$db = new Db(); + + +function do_upload () { + global $uploadfile, $uploadfile_size; + global $local_file, $error_msg; + + if ( $uploadfile == "none" ) + { + $error_msg = "You did not specify a file for uploading."; + return; + } + if ( $uploadfile_size > 2000000 ) + { + $error_msg = "Sorry, your file is too large."; + return; + } + global $HTTP_POST_FILES; + $realname = $HTTP_POST_FILES['userfile']['name']; + + print "$realname"; + + $upload_dir = "/tmp"; + $local_file = "$upload_dir/TOTO"; + + if ( file_exists ( '$local_file' ) ) + { + $seq = 1; + while ( file_exists ( "$upload_dir/$the_time$seq" ) ) + { + $seq++; + } + $local_file = "$upload_dir/$the_time$seq"; + }; + + print "$local_file"; + + rename ( $uploadfile, $local_file ); + +} + +if ( $error_msg ) +{ + echo "$error_msg

"; +} +if ( $sendit ) +{ + do_upload (); +} + + +/* + * + * Mode fiche + * + * + */ +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 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"; + } + + $result = $db->query($sql); + + if ($result) { + $objsoc = $db->fetch_object(0); + + $dac = strftime("%Y-%m-%d %H:%M", time()); + if ($errmesg) { + print "$errmesg
"; + } + + /* + * + */ + print "\n"; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
Fiche client : $objsoc->nom
idp&action=add_bookmark\">[Bookmark]idp&action=create\">[Projet]idp&action=create\">[Propal]idp\">Notes[idp&action=edit\">Editer]
"; + /* + * + * + */ + + + print "\n"; + print "\n"; + + print "
"; + print ""; + + print ""; + print ""; + print ""; + + print ""; + print ""; + + print ""; + + print "
Type $objsoc->typentEffectif$objsoc->effectif
Tel $objsoc->tel fax$objsoc->fax 
Ville".nl2br($objsoc->address)."
$objsoc->cp $objsoc->ville
sirensiren\">$objsoc->siren prefix"; + if ($objsoc->prefix_comm) { + print $objsoc->prefix_comm; + } else { + print "[idp&action=attribute_prefix\">Attribuer]"; + } + + print "
Siteurl\">$objsoc->url 
"; + + /* + * + */ + print "
"; + + echo '
'; + +?> + + + + +

+ +
+
+error() . "
" . $sql; + } +} else { + print "Erreur"; +} +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>