Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

import.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   PhpCompta is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /* $Revision$ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00021 // Author Olivier Dzwoniarkiewicz
00026 include_once("ac_common.php");
00027 include_once("user_menu.php");
00028 include_once ("constant.php");
00029 include_once ("postgres.php");
00030 include_once ("check_priv.php");
00031 include_once ("class_widget.php");
00032 if ( ! isset ( $_SESSION['g_dossier'] ) ) {
00033   echo "You must choose a Dossier ";
00034   exit -2;
00035 }
00036 $cn=DbConnect($_SESSION['g_dossier']);
00037 include ('class_user.php');
00038 $User=new cl_user($cn);
00039 $User->Check();
00040 
00041 html_page_start($User->theme);
00042 
00043 
00044 /* Admin. Dossier */
00045 
00046 include_once("import_inc.php");
00047 
00048 include_once ("user_menu.php");
00049 echo '<div class="u_tmenu">';
00050 echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
00051 echo '</div>';
00052 $cn=DbConnect($_SESSION['g_dossier']);
00053 if ( $User->CheckAction($cn,IMP_BQE)==0){
00054   /* Cannot Access */
00055   NoAccess();
00056  }
00057 echo ShowMenuAdvanced("import.php");
00058 
00059 echo '<div class="lmenu">';
00060 ShowMenuImport();
00061 echo '</div>';
00062 if ( isset( $_REQUEST['PHPSESSID'])) {
00063         $sessid = $_REQUEST['PHPSESSID'];
00064 }
00065 echo JS_SEARCH_POSTE;
00066 
00067 // if action is set proceed to it
00068 if ( isset ($_GET["action"]) ) {
00069   $action=$_GET["action"];
00070 // menu = import cvs
00071   if ($action == "import" ) {
00072     if(isset($_FILES['fupload'])) {
00073         // load the table with the cvs' content
00074       echo '<DIV class="u_redcontent">';
00075       ImportCSV($cn,$_FILES['fupload']['tmp_name'],$_POST['import_bq'],$_POST['format_csv'],$_POST['import_jrn']);
00076       echo "</DIV>";
00077     } else {
00078       echo '<DIV class="u_redcontent">';
00079       ShowFormTransfert($cn);
00080       echo "</DIV>";
00081     }
00082   }
00083   if ($action == "verif" ) {
00084     if(isset($_POST['poste'])) {
00085       UpdateCSV($cn, $_POST['code'], $_POST['poste']);
00086     }
00087     echo '<DIV class="u_redcontent">';
00088     VerifImport($cn);
00089     echo "</DIV>";
00090   }
00091   if ($action == "transfer" ) {
00092     echo '<DIV class="u_redcontent">';
00093     TransferCSV($cn, $User->GetPeriode());
00094     echo "</DIV>";
00095   }
00096 } 
00097 
00098 html_page_stop();
00099 ?>

Generated on Fri Jun 23 00:12:45 2006 for phpcompta by  doxygen 1.4.4