Correction erreur
This commit is contained in:
parent
3226ec1c17
commit
0f22358cdd
@ -22,31 +22,37 @@ require("./pre.inc.php3");
|
||||
|
||||
llxHeader();
|
||||
|
||||
$mesg = "";
|
||||
|
||||
$upload_dir = SOCIETE_OUTPUTDIR . "/" . $socid ;
|
||||
|
||||
if (! is_dir($upload_dir))
|
||||
{
|
||||
umask(0);
|
||||
mkdir($upload_dir, 0755);
|
||||
if (! mkdir($upload_dir, 0755))
|
||||
{
|
||||
print "Impossible de créer $upload_dir";
|
||||
}
|
||||
}
|
||||
|
||||
function do_upload ($socid)
|
||||
if ( $sendit )
|
||||
{
|
||||
global $upload_dir;
|
||||
global $local_file, $error_msg;
|
||||
|
||||
if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']))
|
||||
if (is_dir($upload_dir))
|
||||
{
|
||||
print "Le fichier est valide, et a été téléchargé
|
||||
|
||||
if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']))
|
||||
{
|
||||
$mesg = "Le fichier est valide, et a été téléchargé
|
||||
avec succès.\n";
|
||||
//print_r($_FILES);
|
||||
//print_r($_FILES);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "Le fichier n'a pas été téléchargé";
|
||||
// print_r($_FILES);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Le fichier n'a pas été téléchargé";
|
||||
// print_r($_FILES);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( $error_msg )
|
||||
@ -57,14 +63,9 @@ if ($action=='delete')
|
||||
{
|
||||
$file = $upload_dir . "/" . urldecode($urlfile);
|
||||
dol_delete_file($file);
|
||||
$mesg = "Le fichier a été supprimé";
|
||||
}
|
||||
|
||||
if ( $sendit )
|
||||
{
|
||||
do_upload ($socid);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Mode fiche
|
||||
@ -73,70 +74,22 @@ if ( $sendit )
|
||||
*/
|
||||
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 .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id";
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
$societe = new Societe($db);
|
||||
if ($societe->fetch($socid))
|
||||
{
|
||||
$objsoc = $db->fetch_object(0);
|
||||
|
||||
$dac = strftime("%Y-%m-%d %H:%M", time());
|
||||
if ($errmesg)
|
||||
{
|
||||
print "<b>$errmesg</b><br>";
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
|
||||
|
||||
print "<tr><td><div class=\"titre\">Documents associés à l'entreprise : $objsoc->nom</div></td>";
|
||||
print "<td align=\"center\"><a href=\"fiche.php3?socid=$objsoc->idp\">Commercial</a></td>";
|
||||
print "<td align=\"center\"><a href=\"../compta/fiche.php3?socid=$objsoc->idp\">Compta</a></td>";
|
||||
print "<td><a href=\"socnote.php3?socid=$objsoc->idp\">Notes</a></td>";
|
||||
print "<td align=\"center\">[<a href=\"../soc.php3?socid=$objsoc->idp&action=edit\">Editer</a>]</td>";
|
||||
print "<tr><td><div class=\"titre\">Documents associés à l'entreprise : $societe->nom</div></td>";
|
||||
print "<td align=\"center\"><a href=\"fiche.php3?socid=$societe->id\">Commercial</a></td>";
|
||||
print "<td align=\"center\"><a href=\"../compta/fiche.php3?socid=$societe->id\">Compta</a></td>";
|
||||
print "</tr></table>";
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
print "<table width=\"100%\" border=0><tr>\n";
|
||||
print "<td valign=\"top\">";
|
||||
print "<table cellspacing=\"0\" border=\"1\" width=\"100%\">";
|
||||
|
||||
print "<tr><td>Type</td><td> $objsoc->typent</td><td>Effectif</td><td>$objsoc->effectif</td></tr>";
|
||||
print "<tr><td>Tel</td><td> $objsoc->tel </td><td>fax</td><td>$objsoc->fax </td></tr>";
|
||||
print "<tr><td>Ville</td><td colspan=\"3\">".nl2br($objsoc->address)."<br>$objsoc->cp $objsoc->ville</td></tr>";
|
||||
|
||||
print "<tr><td>siren</td><td><a href=\"http://www.societe.com/cgi-bin/recherche?rncs=$objsoc->siren\">$objsoc->siren</a> </td>";
|
||||
print "<td>prefix</td><td>";
|
||||
if ($objsoc->prefix_comm)
|
||||
{
|
||||
print $objsoc->prefix_comm;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "[<a href=\"$PHP_SELF?socid=$objsoc->idp&action=attribute_prefix\">Attribuer</a>]";
|
||||
}
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
print "</td>\n";
|
||||
|
||||
print "</table>";
|
||||
|
||||
echo '<FORM NAME="userfile" ACTION="docsoc.php?socid='.$socid.'" ENCTYPE="multipart/form-data" METHOD="POST">';
|
||||
print '<input type="hidden" name="max_file_size" value="2000000">';
|
||||
@ -146,6 +99,8 @@ if ($socid > 0)
|
||||
print '<input type="submit" value="Cancel" name="cancelit"><BR>';
|
||||
print '</FORM>';
|
||||
|
||||
print $mesg;
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$handle=opendir($upload_dir);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user