Changeset 500 for trunk/Modules/FinanceBankAPI
- Timestamp:
- Mar 10, 2013, 10:08:23 AM (12 years ago)
- Location:
- trunk/Modules/FinanceBankAPI
- Files:
-
- 2 added
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/FileImport.php
r499 r500 1 1 <?php 2 2 3 include_once( '../Common/Global.php');3 include_once(dirname(__FILE__).'/../Common/Global.php'); 4 4 5 class FinanceImportPayment extends Page5 class PageFileImport extends Page 6 6 { 7 7 var $FullTitle = 'Import plateb'; … … 10 10 function Show() 11 11 { 12 $Output = ''; 12 13 if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění'); 13 14 if(array_key_exists('Operation', $_GET)) 14 15 { 15 if($_GET['Operation'] == 'prepare') return($this->Prepare()); 16 else if($_GET['Operation'] == 'insert') return($this->Insert()); 17 else echo('Neplatná akce'); 18 } else 19 { 20 $Output = 'Vložte CSV data z SYLK exportu Poštovní spořitelny'; 21 $Output .= '<form action="?Operation=prepare" method="post">'; 22 $Output .= '<textarea name="Source" cols="80" rows="20"></textarea><br/>'; 23 $Output .= '<input type="submit" value="Analyzovat"/>'; 24 $Output .= '</form>'; 25 return($Output); 26 } 16 if($_GET['Operation'] == 'prepare') $Output .= $this->Prepare(); 17 else if($_GET['Operation'] == 'insert') $Output .= $this->Insert(); 18 else $Output .= 'Neplatná akce'; 19 } else $Output .= $this->ShowForm(); 20 return($Output); 21 } 22 23 function ShowForm() 24 { 25 $FormImport = new Form('ImportBankFile'); 26 $FormImport->OnSubmit = '?Operation=prepare'; 27 $Output = $FormImport->ShowEditForm(); 28 return($Output); 27 29 } 28 30 29 31 function Prepare() 30 32 { 33 $FormImport = new Form('ImportBankFile'); 34 $FormImport->LoadValuesFromForm(); 35 $Output = $FormImport->ShowEditForm(); 36 31 37 $Finance = $this->System->Modules['Finance']; 32 $Data = explode("\n", $_POST['Source']); 38 $Output = $FormImport->Values['File']; 39 return($Output); 40 41 $Data = $FormImport->Values['File']; 33 42 foreach($Data as $Key => $Value) 34 43 { … … 146 155 } 147 156 148 $System->AddModule(new FinanceImportPayment());149 $System->Modules['FinanceImportPayment']->GetOutput();150 151 157 ?>
Note:
See TracChangeset
for help on using the changeset viewer.