Plugins  LAST
 All Data Structures Files Functions Variables Pages
imd_operation.inc.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 /* $Revision$ */
21 
22 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
23 
24 /**
25  * @file
26  * @brief upload operation
27  *
28  */
29 require_once 'class_impdol_operation.php';
30 
31 // step 1, select a file
32 if ( ! isset ($_POST['upload']) && ! isset ($_POST['check']) && ! isset($_POST['transfer']))
33 {
34  require_once 'template/upload_operation.php';
35 
36  return;
37 }
38 // step 2 save file into impdol.operation
39 if ( isset ($_POST['upload']))
40 {
41  // save the file
42  $io=new Impdol_Operation();
43  $io->save_file();
44 
45  // record the file into the table operation
46  $io->record();
47 
48  // show the data
49  $io->check();
50 
51  // show the result
52  $io->result();
53  echo '<div style="margin-left:20%">';
54  echo '<form method="POST">';
55  echo "<p class=\"notice\">Les opérations qui ne sont pas marquées comme correctes ne seront pas transfèrées </p>";
56  echo HtmlInput::hidden("impid",$io->impid);
57  $l=new ISelect("p_jrn");
58  $l->value=$cn->make_array("select jrn_def_id, jrn_def_name ||' ['||jrn_def_type||']' from jrn_def
59  where
60  jrn_def_type in ('ACH','VEN')
61  order by jrn_def_name");
62  echo "Vers le journal ".$l->input();
63  echo '<p>';
64  echo HtmlInput::submit("transfer","Transfert des opérations");
65  echo '</p>';
66  echo "</FORM>";
67  echo '</div>';
68 
69 }
70 // step 3, insert data into the target ledger
71 if ( isset ($_POST['transfer']))
72 {
73  $io=new Impdol_Operation();
74  $io->impid=$_POST['impid'];
75  $io->transfer();
76  $io->result_transfer();
77 }
78 
79 ?>
global $cn