00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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
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
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
00066
00067
00068 if ( isset ($_GET["action"]) ) {
00069 $action=$_GET["action"];
00070
00071 if ($action == "import" ) {
00072 if(isset($_FILES['fupload'])) {
00073
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['count'])) {
00085 UpdateCSV($cn);
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
00094 ConfirmTransfert($cn,$User->GetPeriode());
00095 echo "</DIV>";
00096 }
00097 }
00098
00099
00100
00101
00102 if ( isset ($_POST['action'])) {
00103 $action=$_POST['action'];
00104 if ($action == "transfer" ) {
00105 echo '<DIV class="u_redcontent">';
00106 TransferCSV($cn, $User->GetPeriode());
00107 echo "</DIV>";
00108 }
00109
00110 if ($action == "remove" ) {
00111 echo '<DIV class="u_redcontent">';
00112 RemoveCSV($cn);
00113 ConfirmTransfert($cn,$User->GetPeriode());
00114 echo "</DIV>";
00115 }
00116
00117 }
00118 html_page_stop();
00119 ?>