require_once DOL_DOCUMENT_ROOT . "/lib/files.lib.php"; if ($object->fetch($id)) { $upload_dir = $conf->fournisseur->commande->dir_output . "/"; $file = $upload_dir . '/' . $_GET['file']; dol_delete_file($file); $mesg = '<div class="ok">' . $langs->trans("FileWasRemoved") . '</div>'; } } /* * Create an order */ if ($action == 'create') { $fourn = new Fournisseur($db); $result = $fourn->fetch($socid); $db->begin(); $orderid = $fourn->create_commande($user); if ($orderid > 0) { $idc = $fourn->single_open_commande; if ($comclientid != '') { $fourn->updateFromCommandeClient($user, $idc, $comclientid); } $id = $orderid; $db->commit(); } else { $db->rollback(); $mesg = $fourn->error; } } /* * Add file in email form */