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 ( isset ($_POST['trashit'])) {
00084 DropRecord($cn,$_POST['code']);
00085 echo '<DIV class="u_redcontent">';
00086 VerifImport($cn);
00087 echo "</DIV>";
00088 exit();
00089 }
00090 if ($action == "verif" ) {
00091 if(isset($_POST['count'])) {
00092 UpdateCSV($cn);
00093 }
00094
00095 echo '<DIV class="u_redcontent">';
00096 VerifImport($cn);
00097 echo "</DIV>";
00098 }
00099 if ($action == "transfer" ) {
00100
00101 echo '<DIV class="u_redcontent">';
00102
00103 ConfirmTransfert($cn,$User->GetPeriode());
00104 echo "</DIV>";
00105 }
00106 }
00107
00108
00109
00110
00111 if ( isset ($_POST['action'])) {
00112 $action=$_POST['action'];
00113 if ($action == "transfer" ) {
00114 echo '<DIV class="u_redcontent">';
00115 TransferCSV($cn, $User->GetPeriode());
00116 echo "</DIV>";
00117 }
00118
00119 if ($action == "remove" ) {
00120 echo '<DIV class="u_redcontent">';
00121 RemoveCSV($cn);
00122 ConfirmTransfert($cn,$User->GetPeriode());
00123 echo "</DIV>";
00124 }
00125
00126 }
00127 html_page_stop();
00128 ?>