3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function OdeberZKosiku($id_polozka) { global $session_user; $id_polozka=intval($id_polozka); $query = mysql_query(" DELETE FROM ".TBL_PREFIX."kosik_polozky WHERE id_polozka='$id_polozka' and id_user='$session_user' ") or die(err(1)); } function PridejDoKosikuHromadne($id_produkty, $pocet) { $pridano=false; for ($f=0;$f<count($id_produkty);$f++) { if ($pocet[$f]>0) { $vystup=PridejDoKosiku($id_produkty[$f],$pocet[$f]); if ($vystup) $pridano=true; } } return $pridano; } function PridejDoKosiku($add_id, $pocet) { global $session_user; //vypoÄ?Ă­tĂĄm cenu a zjistĂ­m zda produkt existuje, kvĹŻli POST podvrĹženĂ­ $query = mysql_query(" SELECT p.id, p.cena1, m.id_poplatek FROM ".TBL_PREFIX."produkty p JOIN ".TBL_PREFIX."produkty_matky m ON p.id_matka=m.id_matka WHERE p.id='$add_id' and m.web='".__WEB__."' and m.aktivni=1 ") or die(err(1)); if (mysql_num_rows($query)==1) { $row = mysql_fetch_array($query); $cena=CenaProZakaznika($row['id']); //poÄ?et produktĹŻ v koĹĄĂ­ku $query_pocet = mysql_query("SELECT pocet FROM ".TBL_PREFIX."kosik_polozky WHERE id_produkt='$add_id' and id_user='$session_user' ") or die(err(1)); if (mysql_num_rows($query_pocet)==0) { //poplatek je bez DPH, pĹ?ed vloĹženĂ­m do koĹĄĂ­ku musĂ­m DPH pĹ?idat... if ($cena['druh_cena']==__BEZ_DPH__) { $cena['poplatek']=($cena['poplatek']*$cena['dph_sazba']/100)+$cena['poplatek']; // $cena['poplatek']=$cena['poplatek']*$cena['dph_sazba']/100)+$cena['poplatek']; } //nenĂ­ jeĹĄtÄ? v koĹĄĂ­ku........insert $vloz=mysql_query(" INSERT INTO ".TBL_PREFIX."kosik_polozky (id_polozka, id_user, id_produkt, cena_bez_dph, cena_s_dph, dph, cena_poplatek, id_poplatek, pocet, cas) VALUES ( '', '$session_user', '$add_id', '".$cena['cena_bez_dph']."', '".$cena['cena_s_dph']."', '".$cena['dph_sazba']."', '".$cena['poplatek']."', '".$row['id_poplatek']."', '$pocet', now() ) ") or die(err(1)); } else { //je v koĹĄĂ­ku........update $row_pocet = mysql_fetch_array($query_pocet); $pridat=$row_pocet['pocet']+$pocet; $vloz=mysql_query(" UPDATE ".TBL_PREFIX."kosik_polozky SET pocet='$pridat' WHERE id_produkt='$add_id' and id_user='$session_user' LIMIT 1 ") or die(err(1)); } return true; //header("Location: ".__URL__."kosik.html"); //exit(); } else return false; } function PrepocitejKosik($id,$pocet) { global $session_user; //mazĂĄnĂ­ vĹĄeho mysql_query(" DELETE FROM ".TBL_PREFIX."kosik_polozky WHERE id_user='$session_user' ") or die(err(1)); for ($f=0;$f<count($id);$f++) { //vypoÄ?Ă­tĂĄm cenu a zjistĂ­m zda produkt existuje, kvĹŻli POST podvrĹženĂ­ $query = mysql_query(" SELECT p.id, m.id_poplatek FROM ".TBL_PREFIX."produkty p JOIN ".TBL_PREFIX."produkty_matky m ON p.id_matka=m.id_matka WHERE p.id='$id[$f]' and m.web='".__WEB__."' ") or die(err(1)); if (mysql_num_rows($query)==1) { $row = mysql_fetch_array($query); $cena=CenaProZakaznika($row['id']); } if ($pocet[$f]>0) { //poplatek je bez DPH, pĹ?ed vloĹženĂ­m do koĹĄĂ­ku musĂ­m DPH pĹ?idat... if ($cena['druh_cena']==__BEZ_DPH__) { $cena['poplatek']=($cena['poplatek']*$cena['dph_sazba']/100)+$cena['poplatek']; // $cena['poplatek']=$cena['poplatek']*$cena['dph_sazba']/100)+$cena['poplatek']; } $vloz=mysql_query(" INSERT INTO ".TBL_PREFIX."kosik_polozky (id_polozka, id_user, id_produkt, cena_bez_dph, cena_s_dph, dph, cena_poplatek, id_poplatek, pocet, cas) VALUES ('','$session_user', '$id[$f]', '".$cena['cena_bez_dph']."', '".$cena['cena_s_dph']."', '".$cena['dph_sazba']."', '".$cena['poplatek']."', '".$row['id_poplatek']."', '$pocet[$f]', now() ) ") or die(err(1)); } } } //prepocita celkovou cenu v session v 1 kroku objednavky pri zadani slevoveho kuponu function NastavSessionCeny() { global $session_user; $usk = __UPLATNOVAT_SLEVOVE_KODY_NA_ZBOZI_KTERE_NENI_SKLADEM__ == 'Ano' ? 1: 0; $query_kosik = mysql_query(" SELECT k.*, IF (p.uplatnit_slevovy_kod = 1 AND ((p.kusu_skladem > 0 AND ".$usk." = 0) OR ".$usk."=1),1,0) AS uplatnit_slevovy_kod FROM ".TBL_PREFIX."kosik_polozky k JOIN ".TBL_PREFIX."produkty p ON p.id=k.id_produkt JOIN ".TBL_PREFIX."produkty_matky m ON p.id_matka=m.id_matka JOIN ".TBL_PREFIX."menu menu ON menu.id_matka=m.id_matka and vychozi=1 WHERE id_user='$session_user' and m.aktivni=1 and p.aktivni=1 and m.web='".__WEB__."' GROUP BY p.id ORDER BY k.id_polozka ") or die(mysql_error()); $soucet_s_dph = $soucet_bez_dph = 0; if (mysql_num_rows($query_kosik)==0) return false; while($kosik=mysql_fetch_array($query_kosik)) { $poplatek=$kosik['cena_poplatek']; //pokud je zadan slevovy kod, pak probehne odecteni slevy, je u produktu, ktere nemaji priznak "Na tento produkt lze uplatnit slevovĂ˝ kupĂłn" $sleva_koef = __MODUL_SLEVOVE_KODY__ && $kosik['uplatnit_slevovy_kod'] == 1 && isset($_SESSION['obj']['slevovy_kod_sleva']) && $_SESSION['obj']['slevovy_kod_sleva'] > 0 ? 1 - ($_SESSION['obj']['slevovy_kod_sleva'] / 100) : 1; $soucet_s_dph=$soucet_s_dph+((($kosik['cena_s_dph']*$sleva_koef)+$poplatek)*$kosik['pocet']); $soucet_bez_dph=$soucet_bez_dph+$kosik['cena_bez_dph']*$sleva_koef*$kosik['pocet']; } $_SESSION['obj']['celkova_cena']=$soucet_s_dph; $_SESSION['obj']['celkem_bez_dph']=$soucet_bez_dph; return true; } ?>
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/GhGNB
function name:  (null)
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  12     1        NOP                                                      
  29     2        NOP                                                      
  93     3        NOP                                                      
 143     4        NOP                                                      
 180     5      > RETURN                                                   1

Function odeberzkosiku:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
Jump found. Position 1 = -2
Branch analysis from position: 24
Jump found. Position 1 = -2
filename:       /in/GhGNB
function name:  OdeberZKosiku
number of ops:  26
compiled vars:  !0 = $id_polozka, !1 = $session_user, !2 = $query
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   RECV                                             !0      
   4     1        BIND_GLOBAL                                              !1, 'session_user'
   5     2        INIT_FCALL                                               'intval'
         3        SEND_VAR                                                 !0
         4        DO_ICALL                                         $3      
         5        ASSIGN                                                   !0, $3
   6     6        INIT_FCALL_BY_NAME                                       'mysql_query'
         7        FETCH_CONSTANT                                   ~5      'TBL_PREFIX'
         8        CONCAT                                           ~6      '++DELETE+FROM+', ~5
   7     9        ROPE_INIT                                     5  ~8      'kosik_polozky%0A++++++++++++++++++++++++++++WHERE+id_polozka%3D%27'
        10        ROPE_ADD                                      1  ~8      ~8, !0
        11        ROPE_ADD                                      2  ~8      ~8, '%27+and+id_user%3D%27'
        12        ROPE_ADD                                      3  ~8      ~8, !1
   8    13        ROPE_END                                      4  ~7      ~8, '%27%0A+++++++++++++++++++++++++++++'
        14        CONCAT                                           ~11     ~6, ~7
        15        SEND_VAL_EX                                              ~11
        16        DO_FCALL                                      0  $12     
        17        ASSIGN                                           $13     !2, $12
        18      > JMPNZ_EX                                         ~14     $13, ->24
        19    >   INIT_FCALL_BY_NAME                                       'err'
        20        SEND_VAL_EX                                              1
        21        DO_FCALL                                      0  $15     
        22      > EXIT                                                     $15
        23*       BOOL                                             ~14     <true>
        24    >   FREE                                                     ~14
  10    25      > RETURN                                                   null

End of function odeberzkosiku

Function pridejdokosikuhromadne:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 19
Branch analysis from position: 19
Jump found. Position 1 = 24, Position 2 = 5
Branch analysis from position: 24
Jump found. Position 1 = -2
Branch analysis from position: 5
Jump found. Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
Jump found. Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
Jump found. Position 1 = 24, Position 2 = 5
Branch analysis from position: 24
Branch analysis from position: 5
Branch analysis from position: 17
Branch analysis from position: 17
filename:       /in/GhGNB
function name:  PridejDoKosikuHromadne
number of ops:  26
compiled vars:  !0 = $id_produkty, !1 = $pocet, !2 = $pridano, !3 = $f, !4 = $vystup
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  12     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  14     2        ASSIGN                                                   !2, <false>
  15     3        ASSIGN                                                   !3, 0
         4      > JMP                                                      ->19
  17     5    >   FETCH_DIM_R                                      $7      !1, !3
         6        IS_SMALLER                                       ~8      0, $7
         7      > JMPZ                                                     ~8, ->17
  19     8    >   INIT_FCALL_BY_NAME                                       'PridejDoKosiku'
         9        FETCH_DIM_FUNC_ARG                               $9      !0, !3
        10        SEND_VAR_EX                                              $9
        11        FETCH_DIM_FUNC_ARG                               $10     !1, !3
        12        SEND_VAR_EX                                              $10
        13        DO_FCALL                                      0  $11     
        14        ASSIGN                                                   !4, $11
  20    15      > JMPZ                                                     !4, ->17
  21    16    >   ASSIGN                                                   !2, <true>
  15    17    >   POST_INC                                         ~14     !3
        18        FREE                                                     ~14
        19    >   INIT_FCALL                                               'count'
        20        SEND_VAR                                                 !0
        21        DO_ICALL                                         $15     
        22        IS_SMALLER                                       ~16     !3, $15
        23      > JMPNZ                                                    ~16, ->5
  24    24    > > RETURN                                                   !2
  25    25*     > RETURN                                                   null

End of function pridejdokosikuhromadne

Function pridejdokosiku:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
Jump found. Position 1 = -2
Branch analysis from position: 25
Jump found. Position 1 = 31, Position 2 = 144
Branch analysis from position: 31
Jump found. Position 1 = 53, Position 2 = 58
Branch analysis from position: 53
Jump found. Position 1 = -2
Branch analysis from position: 58
Jump found. Position 1 = 64, Position 2 = 114
Branch analysis from position: 64
Jump found. Position 1 = 68, Position 2 = 76
Branch analysis from position: 68
Jump found. Position 1 = 107, Position 2 = 112
Branch analysis from position: 107
Jump found. Position 1 = -2
Branch analysis from position: 112
Jump found. Position 1 = 142
Branch analysis from position: 142
Jump found. Position 1 = -2
Branch analysis from position: 76
Branch analysis from position: 114
Jump found. Position 1 = 136, Position 2 = 141
Branch analysis from position: 136
Jump found. Position 1 = -2
Branch analysis from position: 141
Jump found. Position 1 = -2
Branch analysis from position: 144
Jump found. Position 1 = -2
filename:       /in/GhGNB
function name:  PridejDoKosiku
number of ops:  146
compiled vars:  !0 = $add_id, !1 = $pocet, !2 = $session_user, !3 = $query, !4 = $row, !5 = $cena, !6 = $query_pocet, !7 = $vloz, !8 = $row_pocet, !9 = $pridat
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  29     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  31     2        BIND_GLOBAL                                              !2, 'session_user'
  33     3        INIT_FCALL_BY_NAME                                       'mysql_query'
  34     4        FETCH_CONSTANT                                   ~10     'TBL_PREFIX'
         5        CONCAT                                           ~11     '++SELECT+p.id%2C+p.cena1%2C+m.id_poplatek%0A++++++++++++++++++++++++++++FROM+', ~10
  35     6        CONCAT                                           ~12     ~11, 'produkty+p%0A++++++++++++++++++++++++++++JOIN+'
         7        FETCH_CONSTANT                                   ~13     'TBL_PREFIX'
         8        CONCAT                                           ~14     ~12, ~13
  36     9        ROPE_INIT                                     3  ~16     'produkty_matky+m+ON+p.id_matka%3Dm.id_matka%0A++++++++++++++++++++++++++++WHERE+p.id%3D%27'
        10        ROPE_ADD                                      1  ~16     ~16, !0
        11        ROPE_END                                      2  ~15     ~16, '%27+and+m.web%3D%27'
        12        CONCAT                                           ~18     ~14, ~15
        13        FETCH_CONSTANT                                   ~19     '__WEB__'
        14        CONCAT                                           ~20     ~18, ~19
  37    15        CONCAT                                           ~21     ~20, '%27+and+m.aktivni%3D1%0A+++++++++++++++++++++++++++++'
        16        SEND_VAL_EX                                              ~21
        17        DO_FCALL                                      0  $22     
        18        ASSIGN                                           $23     !3, $22
        19      > JMPNZ_EX                                         ~24     $23, ->25
        20    >   INIT_FCALL_BY_NAME                                       'err'
        21        SEND_VAL_EX                                              1
        22        DO_FCALL                                      0  $25     
        23      > EXIT                                                     $25
        24*       BOOL                                             ~24     <true>
        25    >   FREE                                                     ~24
  38    26        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
        27        SEND_VAR_EX                                              !3
        28        DO_FCALL                                      0  $26     
        29        IS_EQUAL                                         ~27     $26, 1
        30      > JMPZ                                                     ~27, ->144
  40    31    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        32        SEND_VAR_EX                                              !3
        33        DO_FCALL                                      0  $28     
        34        ASSIGN                                                   !4, $28
  41    35        INIT_FCALL_BY_NAME                                       'CenaProZakaznika'
        36        FETCH_DIM_FUNC_ARG                               $30     !4, 'id'
        37        SEND_VAR_EX                                              $30
        38        DO_FCALL                                      0  $31     
        39        ASSIGN                                                   !5, $31
  44    40        INIT_FCALL_BY_NAME                                       'mysql_query'
  45    41        FETCH_CONSTANT                                   ~33     'TBL_PREFIX'
        42        CONCAT                                           ~34     'SELECT+pocet%0A++++++++++++++++++++++++++++FROM+', ~33
  46    43        ROPE_INIT                                     5  ~36     'kosik_polozky%0A++++++++++++++++++++++++++++WHERE+id_produkt%3D%27'
        44        ROPE_ADD                                      1  ~36     ~36, !0
        45        ROPE_ADD                                      2  ~36     ~36, '%27+and+id_user%3D%27'
        46        ROPE_ADD                                      3  ~36     ~36, !2
  47    47        ROPE_END                                      4  ~35     ~36, '%27%0A+++++++++++++++++++++++++++++'
        48        CONCAT                                           ~39     ~34, ~35
        49        SEND_VAL_EX                                              ~39
        50        DO_FCALL                                      0  $40     
        51        ASSIGN                                           $41     !6, $40
        52      > JMPNZ_EX                                         ~42     $41, ->58
        53    >   INIT_FCALL_BY_NAME                                       'err'
        54        SEND_VAL_EX                                              1
        55        DO_FCALL                                      0  $43     
        56      > EXIT                                                     $43
        57*       BOOL                                             ~42     <true>
        58    >   FREE                                                     ~42
  48    59        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
        60        SEND_VAR_EX                                              !6
        61        DO_FCALL                                      0  $44     
        62        IS_EQUAL                                         ~45     $44, 0
        63      > JMPZ                                                     ~45, ->114
  51    64    >   FETCH_DIM_R                                      $46     !5, 'druh_cena'
        65        FETCH_CONSTANT                                   ~47     '__BEZ_DPH__'
        66        IS_EQUAL                                         ~48     $46, ~47
        67      > JMPZ                                                     ~48, ->76
  53    68    >   FETCH_DIM_R                                      $50     !5, 'poplatek'
        69        FETCH_DIM_R                                      $51     !5, 'dph_sazba'
        70        MUL                                              ~52     $50, $51
        71        DIV                                              ~53     ~52, 100
        72        FETCH_DIM_R                                      $54     !5, 'poplatek'
        73        ADD                                              ~55     ~53, $54
        74        ASSIGN_DIM                                               !5, 'poplatek'
        75        OP_DATA                                                  ~55
  58    76    >   INIT_FCALL_BY_NAME                                       'mysql_query'
        77        FETCH_CONSTANT                                   ~56     'TBL_PREFIX'
        78        CONCAT                                           ~57     '+INSERT+INTO+', ~56
  61    79        ROPE_INIT                                     5  ~59     'kosik_polozky%0A%09%09%09%09%28id_polozka%2C+id_user%2C+id_produkt%2C+cena_bez_dph%2C+cena_s_dph%2C+dph%2C+cena_poplatek%2C+id_poplatek%2C+pocet%2C+cas%29%0A++++++++++++++++++++++++VALUES+%28+++%27%27%2C%0A%09%09%09%09%09%09%09%09+++%27'
        80        ROPE_ADD                                      1  ~59     ~59, !2
  62    81        ROPE_ADD                                      2  ~59     ~59, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        82        ROPE_ADD                                      3  ~59     ~59, !0
  63    83        ROPE_END                                      4  ~58     ~59, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        84        CONCAT                                           ~62     ~57, ~58
        85        FETCH_DIM_R                                      $63     !5, 'cena_bez_dph'
        86        CONCAT                                           ~64     ~62, $63
  64    87        CONCAT                                           ~65     ~64, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        88        FETCH_DIM_R                                      $66     !5, 'cena_s_dph'
        89        CONCAT                                           ~67     ~65, $66
  65    90        CONCAT                                           ~68     ~67, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        91        FETCH_DIM_R                                      $69     !5, 'dph_sazba'
        92        CONCAT                                           ~70     ~68, $69
  66    93        CONCAT                                           ~71     ~70, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        94        FETCH_DIM_R                                      $72     !5, 'poplatek'
        95        CONCAT                                           ~73     ~71, $72
  67    96        CONCAT                                           ~74     ~73, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        97        FETCH_DIM_R                                      $75     !4, 'id_poplatek'
        98        CONCAT                                           ~76     ~74, $75
  68    99        ROPE_INIT                                     3  ~78     '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
       100        ROPE_ADD                                      1  ~78     ~78, !1
  71   101        ROPE_END                                      2  ~77     ~78, '%27%2C%0A++++++++++++++++++++++++++++++++++++now%28%29%0A++++++++++++++++++++++++++++++++%29%0A++++++++++++++++++++++++'
       102        CONCAT                                           ~80     ~76, ~77
       103        SEND_VAL_EX                                              ~80
       104        DO_FCALL                                      0  $81     
       105        ASSIGN                                           $82     !7, $81
       106      > JMPNZ_EX                                         ~83     $82, ->112
       107    >   INIT_FCALL_BY_NAME                                       'err'
       108        SEND_VAL_EX                                              1
       109        DO_FCALL                                      0  $84     
       110      > EXIT                                                     $84
       111*       BOOL                                             ~83     <true>
       112    >   FREE                                                     ~83
       113      > JMP                                                      ->142
  77   114    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
       115        SEND_VAR_EX                                              !6
       116        DO_FCALL                                      0  $85     
       117        ASSIGN                                                   !8, $85
  78   118        FETCH_DIM_R                                      $87     !8, 'pocet'
       119        ADD                                              ~88     $87, !1
       120        ASSIGN                                                   !9, ~88
  79   121        INIT_FCALL_BY_NAME                                       'mysql_query'
       122        FETCH_CONSTANT                                   ~90     'TBL_PREFIX'
       123        CONCAT                                           ~91     '+UPDATE+', ~90
  80   124        ROPE_INIT                                     7  ~93     'kosik_polozky%0A++++++++++++++++++++++++SET+pocet%3D%27'
       125        ROPE_ADD                                      1  ~93     ~93, !9
  81   126        ROPE_ADD                                      2  ~93     ~93, '%27%0A++++++++++++++++++++++++++++WHERE+id_produkt%3D%27'
       127        ROPE_ADD                                      3  ~93     ~93, !0
       128        ROPE_ADD                                      4  ~93     ~93, '%27+and+id_user%3D%27'
       129        ROPE_ADD                                      5  ~93     ~93, !2
  83   130        ROPE_END                                      6  ~92     ~93, '%27%0A++++++++++++++++++++++++LIMIT+1%0A++++++++++++++++++++++++'
       131        CONCAT                                           ~97     ~91, ~92
       132        SEND_VAL_EX                                              ~97
       133        DO_FCALL                                      0  $98     
       134        ASSIGN                                           $99     !7, $98
       135      > JMPNZ_EX                                         ~100    $99, ->141
       136    >   INIT_FCALL_BY_NAME                                       'err'
       137        SEND_VAL_EX                                              1
       138        DO_FCALL                                      0  $101    
       139      > EXIT                                                     $101
       140*       BOOL                                             ~100    <true>
       141    >   FREE                                                     ~100
  86   142    > > RETURN                                                   <true>
       143*       JMP                                                      ->145
  90   144    > > RETURN                                                   <false>
  91   145*     > RETURN                                                   null

End of function pridejdokosiku

Function prepocitejkosik:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
Jump found. Position 1 = -2
Branch analysis from position: 18
Jump found. Position 1 = 115
Branch analysis from position: 115
Jump found. Position 1 = 120, Position 2 = 21
Branch analysis from position: 120
Jump found. Position 1 = -2
Branch analysis from position: 21
Jump found. Position 1 = 39, Position 2 = 44
Branch analysis from position: 39
Jump found. Position 1 = -2
Branch analysis from position: 44
Jump found. Position 1 = 50, Position 2 = 59
Branch analysis from position: 50
Jump found. Position 1 = 62, Position 2 = 113
Branch analysis from position: 62
Jump found. Position 1 = 66, Position 2 = 74
Branch analysis from position: 66
Jump found. Position 1 = 107, Position 2 = 112
Branch analysis from position: 107
Jump found. Position 1 = -2
Branch analysis from position: 112
Jump found. Position 1 = 120, Position 2 = 21
Branch analysis from position: 120
Branch analysis from position: 21
Branch analysis from position: 74
Branch analysis from position: 113
Branch analysis from position: 59
filename:       /in/GhGNB
function name:  PrepocitejKosik
number of ops:  121
compiled vars:  !0 = $id, !1 = $pocet, !2 = $session_user, !3 = $f, !4 = $query, !5 = $row, !6 = $cena, !7 = $vloz
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  93     0  E >   RECV                                             !0      
         1        RECV                                             !1      
  95     2        BIND_GLOBAL                                              !2, 'session_user'
  97     3        INIT_FCALL_BY_NAME                                       'mysql_query'
         4        FETCH_CONSTANT                                   ~8      'TBL_PREFIX'
         5        CONCAT                                           ~9      '+DELETE+FROM+', ~8
  98     6        ROPE_INIT                                     3  ~11     'kosik_polozky%0A++++++++++++++++++WHERE+id_user%3D%27'
         7        ROPE_ADD                                      1  ~11     ~11, !2
  99     8        ROPE_END                                      2  ~10     ~11, '%27%0A++++++++++++++++++++'
         9        CONCAT                                           ~13     ~9, ~10
        10        SEND_VAL_EX                                              ~13
        11        DO_FCALL                                      0  $14     
        12      > JMPNZ_EX                                         ~15     $14, ->18
        13    >   INIT_FCALL_BY_NAME                                       'err'
        14        SEND_VAL_EX                                              1
        15        DO_FCALL                                      0  $16     
        16      > EXIT                                                     $16
        17*       BOOL                                             ~15     <true>
        18    >   FREE                                                     ~15
 101    19        ASSIGN                                                   !3, 0
        20      > JMP                                                      ->115
 104    21    >   INIT_FCALL_BY_NAME                                       'mysql_query'
 105    22        FETCH_CONSTANT                                   ~18     'TBL_PREFIX'
        23        CONCAT                                           ~19     '++SELECT+p.id%2C+m.id_poplatek%0A++++++++++++++++++++++++++++++++FROM+', ~18
 106    24        CONCAT                                           ~20     ~19, 'produkty+p%0A++++++++++++++++++++++++++++++++JOIN+'
        25        FETCH_CONSTANT                                   ~21     'TBL_PREFIX'
        26        CONCAT                                           ~22     ~20, ~21
 107    27        FETCH_DIM_R                                      $23     !0, !3
        28        ROPE_INIT                                     3  ~25     'produkty_matky+m+ON+p.id_matka%3Dm.id_matka%0A++++++++++++++++++++++++++++++++WHERE+p.id%3D%27'
        29        ROPE_ADD                                      1  ~25     ~25, $23
        30        ROPE_END                                      2  ~24     ~25, '%27+and+m.web%3D%27'
        31        CONCAT                                           ~27     ~22, ~24
        32        FETCH_CONSTANT                                   ~28     '__WEB__'
        33        CONCAT                                           ~29     ~27, ~28
 108    34        CONCAT                                           ~30     ~29, '%27%0A+++++++++++++++++++++++++++++++++'
        35        SEND_VAL_EX                                              ~30
        36        DO_FCALL                                      0  $31     
        37        ASSIGN                                           $32     !4, $31
        38      > JMPNZ_EX                                         ~33     $32, ->44
        39    >   INIT_FCALL_BY_NAME                                       'err'
        40        SEND_VAL_EX                                              1
        41        DO_FCALL                                      0  $34     
        42      > EXIT                                                     $34
        43*       BOOL                                             ~33     <true>
        44    >   FREE                                                     ~33
 109    45        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
        46        SEND_VAR_EX                                              !4
        47        DO_FCALL                                      0  $35     
        48        IS_EQUAL                                         ~36     $35, 1
        49      > JMPZ                                                     ~36, ->59
 111    50    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        51        SEND_VAR_EX                                              !4
        52        DO_FCALL                                      0  $37     
        53        ASSIGN                                                   !5, $37
 112    54        INIT_FCALL_BY_NAME                                       'CenaProZakaznika'
        55        FETCH_DIM_FUNC_ARG                               $39     !5, 'id'
        56        SEND_VAR_EX                                              $39
        57        DO_FCALL                                      0  $40     
        58        ASSIGN                                                   !6, $40
 115    59    >   FETCH_DIM_R                                      $42     !1, !3
        60        IS_SMALLER                                       ~43     0, $42
        61      > JMPZ                                                     ~43, ->113
 118    62    >   FETCH_DIM_R                                      $44     !6, 'druh_cena'
        63        FETCH_CONSTANT                                   ~45     '__BEZ_DPH__'
        64        IS_EQUAL                                         ~46     $44, ~45
        65      > JMPZ                                                     ~46, ->74
 120    66    >   FETCH_DIM_R                                      $48     !6, 'poplatek'
        67        FETCH_DIM_R                                      $49     !6, 'dph_sazba'
        68        MUL                                              ~50     $48, $49
        69        DIV                                              ~51     ~50, 100
        70        FETCH_DIM_R                                      $52     !6, 'poplatek'
        71        ADD                                              ~53     ~51, $52
        72        ASSIGN_DIM                                               !6, 'poplatek'
        73        OP_DATA                                                  ~53
 125    74    >   INIT_FCALL_BY_NAME                                       'mysql_query'
        75        FETCH_CONSTANT                                   ~54     'TBL_PREFIX'
        76        CONCAT                                           ~55     '+INSERT+INTO+', ~54
 127    77        ROPE_INIT                                     5  ~58     'kosik_polozky%0A%09%09%09%09%28id_polozka%2C+id_user%2C+id_produkt%2C+cena_bez_dph%2C+cena_s_dph%2C+dph%2C+cena_poplatek%2C+id_poplatek%2C+pocet%2C+cas%29%0A++++++++++++++++++++++++VALUES+%28%27%27%2C%27'
        78        ROPE_ADD                                      1  ~58     ~58, !2
 128    79        FETCH_DIM_R                                      $56     !0, !3
        80        ROPE_ADD                                      2  ~58     ~58, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        81        ROPE_ADD                                      3  ~58     ~58, $56
 129    82        ROPE_END                                      4  ~57     ~58, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        83        CONCAT                                           ~61     ~55, ~57
        84        FETCH_DIM_R                                      $62     !6, 'cena_bez_dph'
        85        CONCAT                                           ~63     ~61, $62
 130    86        CONCAT                                           ~64     ~63, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        87        FETCH_DIM_R                                      $65     !6, 'cena_s_dph'
        88        CONCAT                                           ~66     ~64, $65
 131    89        CONCAT                                           ~67     ~66, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        90        FETCH_DIM_R                                      $68     !6, 'dph_sazba'
        91        CONCAT                                           ~69     ~67, $68
 132    92        CONCAT                                           ~70     ~69, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        93        FETCH_DIM_R                                      $71     !6, 'poplatek'
        94        CONCAT                                           ~72     ~70, $71
 133    95        CONCAT                                           ~73     ~72, '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
        96        FETCH_DIM_R                                      $74     !5, 'id_poplatek'
        97        CONCAT                                           ~75     ~73, $74
 134    98        FETCH_DIM_R                                      $76     !1, !3
        99        ROPE_INIT                                     3  ~78     '%27%2C%0A+++++++++++++++++++++++++++++++++++%27'
       100        ROPE_ADD                                      1  ~78     ~78, $76
 137   101        ROPE_END                                      2  ~77     ~78, '%27%2C%0A+++++++++++++++++++++++++++++++

Generated using Vulcan Logic Dumper, using php 7.3.0