From bb9d839a90fbcfb8025c7cfd49f79a792c2ba9ef Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 27 Apr 2007 12:33:27 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/admin/import/index.php | 87 +++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 htdocs/admin/import/index.php diff --git a/htdocs/admin/import/index.php b/htdocs/admin/import/index.php new file mode 100644 index 00000000000..438504dff34 --- /dev/null +++ b/htdocs/admin/import/index.php @@ -0,0 +1,87 @@ + + * + * 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$ + */ + +/** + \file htdocs/admin/index.php + \brief Page d'import de donnee + \version $Revision$ +*/ + +require("./pre.inc.php"); + +require(DOL_DOCUMENT_ROOT.'/admin/import/dolibarrimport.class.php'); + +$langs->load("admin"); +$langs->load("companies"); + +if (!$user->admin) + accessforbidden(); + +/* + * Affichage page + */ +llxHeader(); + +$form = new Form($db); + +print_fiche_titre($langs->trans("ImportArea"),'','setup'); + +print "
"; + +print '
'; +print ''; + +print ''; +print ''; + +print "\n"; +print '
Importer un fichier clients
"; +print '
'; +print '   '; +print '
'; + +print "
'; + + +if ( $_POST["sendit"] && $conf->upload != 0) +{ + $imp = new DolibarrImport($db); + $imp->CreateBackupDir(); + if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $imp->upload_dir . "/" . $_FILES['userfile']['name'])) + { + + $imp->ImportClients($imp->upload_dir . "/" . $_FILES['userfile']['name']); + + print "Imports : ".$imp->nb_import."
"; + print "Imports corrects : ".$imp->nb_import_ok."
"; + print "Imports erreurs : ".$imp->nb_import_ko."
"; + + } + else + { + $mesg = "Le fichier n'a pas été téléchargé"; + } +} + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?>