Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/FinanceBankAPI/ImportPS.php

    r738 r873  
    55  function ImportFile($Content, $Ext)
    66  {
    7     if($Ext == 'txt') $this->ImportTxt($Content);
    8       else if($Ext == 'cvs') $this->ImportCVS($Content);
     7    if ($Ext == 'txt') $this->ImportTxt($Content);
     8      else if ($Ext == 'cvs') $this->ImportCVS($Content);
    99  }
    1010
     
    2020
    2121    $Data = explode("\n", $Content);
    22     foreach($Data as $Key => $Value)
     22    foreach ($Data as $Key => $Value)
    2323    {
    2424      $Value = str_replace('\"', '"', $Value);
    2525      $Data[$Key] = str_getcsv($Value, ',', '"', "\\");
    2626      //print_r($Data[$Key]);
    27       foreach($Data[$Key] as $Key2 => $Value2)
     27      foreach ($Data[$Key] as $Key2 => $Value2)
    2828      {
    29         if(substr($Data[$Key][$Key2], 0, 2) == '\"')
     29        if (substr($Data[$Key][$Key2], 0, 2) == '\"')
    3030          $Data[$Key][$Key2] = substr($Data[$Key][$Key2], 2, -2);
    3131      }
     
    4646    );
    4747
    48     if($Header != $Data[0]) $Output = 'Nekompatibilní struktura CSV';
     48    if ($Header != $Data[0]) $Output = 'Nekompatibilní struktura CSV';
    4949    else
    5050    {
     
    5454      $Output = '<form action="?Operation=insert" method="post">';
    5555      $I = 0;
    56       foreach($Data as $Key => $Value)
     56      foreach ($Data as $Key => $Value)
    5757      {
    58         if(count($Value) <= 1) continue;
    59         if($Value[9] == '') $Value[5] = 128; // Žádný účet => Poštovní spořitelna
     58        if (count($Value) <= 1) continue;
     59        if ($Value[9] == '') $Value[5] = 128; // Žádný účet => Poštovní spořitelna
    6060        $Time = explode('.', $Value[0]);
    6161        $Time = $Time[2].'-'.$Time[1].'-'.$Time[0];
    6262        $Money = $Value[1];
    63         if(is_numeric($Value[5]))
     63        if (is_numeric($Value[5]))
    6464        {
    6565          $Subject = $Value[5] * 1;
    6666          $DbResult = $this->Database->query('SELECT Id FROM Subject WHERE Id='.$this->Database->real_escape_string($Subject));
    67           if($DbResult->num_rows == 0) $Subject = '? ('.($Value[5] * 1).')';
     67          if ($DbResult->num_rows == 0) $Subject = '? ('.($Value[5] * 1).')';
    6868        } else
    6969        {
    7070          $Subject = '? ('.$Value[5].')';
    7171        }
    72         if(!is_numeric($Subject))
     72        if (!is_numeric($Subject))
    7373        {
    7474          $Mode = 'Ručně';
     
    8080        }
    8181
    82         if($Money < 0) $Text = 'Platba převodem';
     82        if ($Money < 0) $Text = 'Platba převodem';
    8383        else $Text = 'Přijatá platba';
    8484        $Automatic .= '<tr>'.
Note: See TracChangeset for help on using the changeset viewer.