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

Legend:

Unmodified
Added
Removed
  • trunk/Application/UpdateTrace.php

    r870 r873  
    203203  $ServiceCategoryHire = $Manager->Database->insert_id;
    204204  $DbResult = $Manager->Execute("SELECT * FROM Member WHERE Hire>0");
    205   while($Member = $DbResult->fetch_assoc())
     205  while ($Member = $DbResult->fetch_assoc())
    206206  {
    207207    $Manager->Execute("INSERT INTO `Service` (
     
    308308  // Set all string collation to utf8 general
    309309  $DbResult = $Manager->Execute("SHOW TABLES");
    310   while($DbRow = $DbResult->fetch_row())
     310  while ($DbRow = $DbResult->fetch_row())
    311311  {
    312312    $Manager->Execute("ALTER TABLE `".$DbRow[0]."` CONVERT TO CHARACTER SET utf8");
     
    871871  $ActionId = $Manager->Database->insert_id;
    872872  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Nabídky"');
    873   if($DbResult->num_rows > 0)
     873  if ($DbResult->num_rows > 0)
    874874  {
    875875    $DbRow = $DbResult->fetch_assoc();
     
    889889  // Convert monthly plus payment for consumption to regular service
    890890  $DbResult = $Manager->Execute('SELECT `MonthlyPlus`, `Member` FROM `MemberPayment` WHERE `MonthlyPlus` > 0');
    891   while($DbRow = $DbResult->fetch_assoc)
     891  while ($DbRow = $DbResult->fetch_assoc)
    892892  {
    893893    $Manager->Execute("INSERT INTO `Service` (`Id` ,`Name` ,`Category` ,`Price` ,`VAT`) ".
     
    987987  $ActionId = $Manager->Database->insert_id;
    988988  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Sklad"');
    989   if($DbResult->num_rows > 0)
     989  if ($DbResult->num_rows > 0)
    990990  {
    991991    $DbRow = $DbResult->fetch_assoc();
     
    10251025  $ActionId = $Manager->Database->insert_id;
    10261026  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Finance"');
    1027   if($DbResult->num_rows > 0)
     1027  if ($DbResult->num_rows > 0)
    10281028  {
    10291029    $DbRow = $DbResult->fetch_assoc();
     
    10471047  // IS menu item
    10481048  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Příjmy a výdaje"');
    1049   if($DbResult->num_rows > 0)
     1049  if ($DbResult->num_rows > 0)
    10501050  {
    10511051    $DbRow = $DbResult->fetch_assoc();
     
    10891089  // IS menu item
    10901090  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Závazky a pohledávky"');
    1091   if($DbResult->num_rows > 0)
     1091  if ($DbResult->num_rows > 0)
    10921092  {
    10931093    $DbRow = $DbResult->fetch_assoc();
     
    11201120  $SearchText = 'Připojení k síti';
    11211121  $DbResult = $Manager->Execute('SELECT * FROM `FinanceInvoiceItem` WHERE `Description` LIKE "'.$SearchText.' za období%";');
    1122   while($DbRow = $DbResult->fetch_assoc())
     1122  while ($DbRow = $DbResult->fetch_assoc())
    11231123  {
    11241124    $Text = trim(substr($DbRow['Description'], strlen($SearchText.' za období') + 1));
     
    11341134  $SearchText = 'Připojení k Internetu';
    11351135  $DbResult = $Manager->Execute('SELECT * FROM `FinanceInvoiceItem` WHERE `Description` LIKE "'.$SearchText.' za období%";');
    1136   while($DbRow = $DbResult->fetch_assoc())
     1136  while ($DbRow = $DbResult->fetch_assoc())
    11371137  {
    11381138    $Text = trim(substr($DbRow['Description'], strlen($SearchText.' za období') + 1));
     
    11411141    $PeriodFrom = $PeriodFrom[2].'-'.$PeriodFrom[1].'-'.$PeriodFrom[0];
    11421142    $Text[1] = trim($Text[1]);
    1143     if(strpos($Text[1], ' ') !== false) $Text[1] = substr($Text[1], 0, strpos($Text[1], ' '));
     1143    if (strpos($Text[1], ' ') !== false) $Text[1] = substr($Text[1], 0, strpos($Text[1], ' '));
    11441144    $PeriodTo = explode('.', trim($Text[1]));
    11451145    $PeriodTo = $PeriodTo[2].'-'.$PeriodTo[1].'-'.$PeriodTo[0];
     
    11991199  $ActionId = $Manager->Database->insert_id;
    12001200  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Systém"');
    1201   if($DbResult->num_rows > 0)
     1201  if ($DbResult->num_rows > 0)
    12021202  {
    12031203    $DbRow = $DbResult->fetch_assoc();
     
    12501250  $ActionId = $Manager->Database->insert_id;
    12511251  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"');
    1252   if($DbResult->num_rows > 0)
     1252  if ($DbResult->num_rows > 0)
    12531253  {
    12541254    $DbRow = $DbResult->fetch_assoc();
     
    14571457    'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '.
    14581458    'WHERE `FinanceOperation`.`BillCodeText`!=""');
    1459   while($DbRow = $DbResult->fetch_assoc())
     1459  while ($DbRow = $DbResult->fetch_assoc())
    14601460  {
    1461     if($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
     1461    if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
    14621462    $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '.
    14631463      'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");');
     
    14751475    'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id` = `FinanceInvoice`.`Group` '.
    14761476    'WHERE `FinanceInvoice`.`BillCodeText`!=""');
    1477   while($DbRow = $DbResult->fetch_assoc())
     1477  while ($DbRow = $DbResult->fetch_assoc())
    14781478  {
    1479     if($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
     1479    if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
    14801480        $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '.
    14811481      'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");');
     
    15121512{
    15131513  $DbResult = $Manager->Database->query('SELECT * FROM (SELECT `FinanceInvoice`.`Id`, ((SELECT SUM(`Price` * `Quantity`) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=`FinanceInvoice`.`Id`) * `FinanceInvoiceGroup`.`ValueSign`) AS `Sum`,`FinanceInvoice`.`Value` FROM `FinanceInvoice` LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group`) AS `T` WHERE `Sum` != `Value`');
    1514   while($DbRow = $DbResult->fetch_assoc())
     1514  while ($DbRow = $DbResult->fetch_assoc())
    15151515  {
    15161516    $Manager->Database->query('UPDATE `FinanceInvoiceItem` SET `Price` = -`Price` WHERE `FinanceInvoice`='.$DbRow['Id']);
     
    16241624  $ActionId = $Manager->Database->insert_id;
    16251625  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Zákazníci"');
    1626   if($DbResult->num_rows > 0)
     1626  if ($DbResult->num_rows > 0)
    16271627  {
    16281628    $DbRow = $DbResult->fetch_assoc();
     
    18121812    'FROM `Contract` '.
    18131813    'WHERE `Contract`.`BillCodeText`!=""');
    1814   while($DbRow = $DbResult->fetch_assoc())
     1814  while ($DbRow = $DbResult->fetch_assoc())
    18151815  {
    1816     if($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
     1816    if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
    18171817    $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '.
    18181818      'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");');
     
    18771877    'LEFT JOIN `StockMoveGroup` ON `StockMoveGroup`.`Id` = `StockMove`.`Group` '.
    18781878    'WHERE `StockMove`.`BillCodeText`!=""');
    1879   while($DbRow = $DbResult->fetch_assoc())
     1879  while ($DbRow = $DbResult->fetch_assoc())
    18801880  {
    1881    if($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
     1881   if ($DbRow['DocumentLine'] == '') $DbRow['DocumentLine'] = 'NULL';
    18821882   $Manager->Execute('INSERT INTO `DocumentLineCode` (`Id` ,`DocumentLine` ,`Name`) '.
    18831883     'VALUES (NULL , '.$DbRow['DocumentLine'].', "'.$DbRow['BillCodeText'].'");');
     
    19401940  $ActionId = $Manager->Database->insert_id;
    19411941  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Pokladny"');
    1942   if($DbResult->num_rows > 0)
     1942  if ($DbResult->num_rows > 0)
    19431943  {
    19441944    $DbRow = $DbResult->fetch_assoc();
     
    20962096  $ActionId = $Manager->Database->insert_id;
    20972097  $DbResult = $Manager->Execute('SELECT `Id` FROM `MenuItem` WHERE `Name`="Síť"');
    2098   if($DbResult->num_rows > 0)
     2098  if ($DbResult->num_rows > 0)
    20992099  {
    21002100    $DbRow = $DbResult->fetch_assoc();
     
    21152115  function Get()
    21162116  {
    2117     return(array(
     2117    return (array(
    21182118      491 => array('Revision' => 493, 'Function' => 'UpdateTo493'),
    21192119      493 => array('Revision' => 494, 'Function' => 'UpdateTo494'),
Note: See TracChangeset for help on using the changeset viewer.