3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Lisbon'); $picagemnr=$_REQUEST['turno']; $msg=$_REQUEST['msg']; $idmsg = $_REQUEST['idmsg']; $action=$_REQUEST['action']; $userid = $_REQUEST['userid']; $insert = $_REQUEST['insert']; $refeicao=$_REQUEST['refeicao']; SESSION_START(); include "db_connect.php"; $year = date("Y"); $month = date("m"); $day = date("d"); $hour = date("H"); $minute = date("i"); $seconds = date("s"); $ip = $_SERVER['REMOTE_ADDR']; $time = time(); $datacompleta = date("Y-m-d"); $horacompleta = date("H:i:s"); //upload foto $file_path = "uploads/"; $file_path = $file_path . basename( $_FILES['uploaded_file']['name']); // *** Include the class include("resize-class.php"); // *** 1) Initialise / load image $resizeObj = new resize('uploads/image.jpg'); // *** 2) Resize image (options: exact, portrait, landscape, auto, crop) $resizeObj -> resizeImage(300, 220, 'auto'); // *** 3) Save image $resizeObj -> saveImage('uploads/sample-resized.jpg', 100); $img_src = "uploads/sample-resized.jpg"; $imgbinary = fread(fopen($img_src, "r"), filesize($img_src)); $img_str = base64_encode($imgbinary); $im='data:image/jpg;base64,'.$img_str.''; //end foto switch ($refeicao){ case almoco: $almoco='1'; break; case jantar: $jantar='1'; break; default: $refeicao=''; break; } // Dias Horas turno_manha turno_tarde total_dia switch ($picagemnr){ case '1': $picagemnr = '1.1'; $picagem = '1º Turno decisão almoço dia seguinte'; $turno_manha = '1'; $turno_tarde = '0'; break; case '2': $picagemnr = '1.2'; $picagem = 'Saída 1º turno'; $turno_manha = '1'; $turno_tarde = '0'; break; case '3': $picagemnr = '2.1'; $picagem = 'Segundo turno Entrada decisão Jantar dia seguinte'; $turno_tarde = '1'; $turno_manha = '0'; break; case '4': $picagemnr = '2.2'; $picagem = '2º turno Saída'; $turno_tarde = '1'; $turno_manha = '0'; break; } /*ver conteudo das vars. echo $userid; echo '<br />'; echo $picagemnr;echo '<br />'; echo $year;echo '<br />'; echo $month;echo '<br />'; echo $day;echo '<br />'; echo $hour;echo '<br />'; echo $minute;echo '<br />'; echo $seconds;echo '<br />'; echo $time;echo '<br />'; echo $ip;echo '<br />'; echo '<br />almoco';echo $almoco;echo '<br />jantar'; echo $jantar;echo '<br />'; echo $Dias;echo '<br />'; echo $Horas;echo '<br />'; echo $picagem;echo '<br />'; echo $turno_manha;echo '<br />'; echo $turno_tarde;echo '<br />'; echo $total_dia;echo '<br />'; echo $im;*/ If ($action == 'picagem'){ mysql_query("INSERT INTO `picagens`(`userid`, `picagemnr`, `ano`, `mes`, `dia`, `hora`, `minuto`, `segundo`, `time`, `ip`, `almoco`, `jantar`, `Dias`, `Horas`, `Picagem`, `turno_manha`, `turno_tarde`, `total_dia`, `foto_code`) VALUES ('$userid','$picagemnr','$year','$month','$day','$hour','$minute','$seconds','$time','$ip', '$almoco','$jantar','$Dias','$Horas','$picagem','$turno_manha','$turno_tarde', '$total_dia','$im')"); if ($msg == '1'){ mysql_query("UPDATE `mensagens` SET `data_lida` = '$datacompleta' ,`hora_lida`= '$horacompleta' WHERE `id` = '$idmsg'"); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 111, Position 2 = 115
Branch analysis from position: 111
2 jumps found. (Code = 44) Position 1 = 114, Position 2 = 117
Branch analysis from position: 114
1 jumps found. (Code = 42) Position 1 = 119
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
2 jumps found. (Code = 44) Position 1 = 123, Position 2 = 130
Branch analysis from position: 123
2 jumps found. (Code = 44) Position 1 = 125, Position 2 = 135
Branch analysis from position: 125
2 jumps found. (Code = 44) Position 1 = 127, Position 2 = 140
Branch analysis from position: 127
2 jumps found. (Code = 44) Position 1 = 129, Position 2 = 145
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
2 jumps found. (Code = 43) Position 1 = 152, Position 2 = 206
Branch analysis from position: 152
2 jumps found. (Code = 43) Position 1 = 196, Position 2 = 206
Branch analysis from position: 196
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 206
Branch analysis from position: 206
Branch analysis from position: 145
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 135
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 130
1 jumps found. (Code = 42) Position 1 = 150
Branch analysis from position: 150
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 115
1 jumps found. (Code = 42) Position 1 = 121
Branch analysis from position: 121
filename:       /in/Ogq2H
function name:  (null)
number of ops:  207
compiled vars:  !0 = $picagemnr, !1 = $msg, !2 = $idmsg, !3 = $action, !4 = $userid, !5 = $insert, !6 = $refeicao, !7 = $year, !8 = $month, !9 = $day, !10 = $hour, !11 = $minute, !12 = $seconds, !13 = $ip, !14 = $time, !15 = $datacompleta, !16 = $horacompleta, !17 = $file_path, !18 = $resizeObj, !19 = $img_src, !20 = $imgbinary, !21 = $img_str, !22 = $im, !23 = $almoco, !24 = $jantar, !25 = $picagem, !26 = $turno_manha, !27 = $turno_tarde, !28 = $Dias, !29 = $Horas, !30 = $total_dia
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FLisbon'
          2        DO_ICALL                                                 
    3     3        FETCH_R                      global              ~32     '_REQUEST'
          4        FETCH_DIM_R                                      ~33     ~32, 'turno'
          5        ASSIGN                                                   !0, ~33
    4     6        FETCH_R                      global              ~35     '_REQUEST'
          7        FETCH_DIM_R                                      ~36     ~35, 'msg'
          8        ASSIGN                                                   !1, ~36
    5     9        FETCH_R                      global              ~38     '_REQUEST'
         10        FETCH_DIM_R                                      ~39     ~38, 'idmsg'
         11        ASSIGN                                                   !2, ~39
    6    12        FETCH_R                      global              ~41     '_REQUEST'
         13        FETCH_DIM_R                                      ~42     ~41, 'action'
         14        ASSIGN                                                   !3, ~42
    7    15        FETCH_R                      global              ~44     '_REQUEST'
         16        FETCH_DIM_R                                      ~45     ~44, 'userid'
         17        ASSIGN                                                   !4, ~45
    8    18        FETCH_R                      global              ~47     '_REQUEST'
         19        FETCH_DIM_R                                      ~48     ~47, 'insert'
         20        ASSIGN                                                   !5, ~48
    9    21        FETCH_R                      global              ~50     '_REQUEST'
         22        FETCH_DIM_R                                      ~51     ~50, 'refeicao'
         23        ASSIGN                                                   !6, ~51
   11    24        INIT_FCALL                                               'session_start'
         25        DO_ICALL                                                 
   12    26        INCLUDE_OR_EVAL                                          'db_connect.php', INCLUDE
   13    27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'Y'
         29        DO_ICALL                                         $55     
         30        ASSIGN                                                   !7, $55
   14    31        INIT_FCALL                                               'date'
         32        SEND_VAL                                                 'm'
         33        DO_ICALL                                         $57     
         34        ASSIGN                                                   !8, $57
   15    35        INIT_FCALL                                               'date'
         36        SEND_VAL                                                 'd'
         37        DO_ICALL                                         $59     
         38        ASSIGN                                                   !9, $59
   16    39        INIT_FCALL                                               'date'
         40        SEND_VAL                                                 'H'
         41        DO_ICALL                                         $61     
         42        ASSIGN                                                   !10, $61
   17    43        INIT_FCALL                                               'date'
         44        SEND_VAL                                                 'i'
         45        DO_ICALL                                         $63     
         46        ASSIGN                                                   !11, $63
   18    47        INIT_FCALL                                               'date'
         48        SEND_VAL                                                 's'
         49        DO_ICALL                                         $65     
         50        ASSIGN                                                   !12, $65
   19    51        FETCH_R                      global              ~67     '_SERVER'
         52        FETCH_DIM_R                                      ~68     ~67, 'REMOTE_ADDR'
         53        ASSIGN                                                   !13, ~68
   20    54        INIT_FCALL                                               'time'
         55        DO_ICALL                                         $70     
         56        ASSIGN                                                   !14, $70
   21    57        INIT_FCALL                                               'date'
         58        SEND_VAL                                                 'Y-m-d'
         59        DO_ICALL                                         $72     
         60        ASSIGN                                                   !15, $72
   22    61        INIT_FCALL                                               'date'
         62        SEND_VAL                                                 'H%3Ai%3As'
         63        DO_ICALL                                         $74     
         64        ASSIGN                                                   !16, $74
   26    65        ASSIGN                                                   !17, 'uploads%2F'
   28    66        INIT_FCALL                                               'basename'
         67        FETCH_R                      global              ~77     '_FILES'
         68        FETCH_DIM_R                                      ~78     ~77, 'uploaded_file'
         69        FETCH_DIM_R                                      ~79     ~78, 'name'
         70        SEND_VAL                                                 ~79
         71        DO_ICALL                                         $80     
         72        CONCAT                                           ~81     !17, $80
         73        ASSIGN                                                   !17, ~81
   31    74        INCLUDE_OR_EVAL                                          'resize-class.php', INCLUDE
   34    75        NEW                                              $84     'resize'
         76        SEND_VAL_EX                                              'uploads%2Fimage.jpg'
         77        DO_FCALL                                      0          
         78        ASSIGN                                                   !18, $84
   37    79        INIT_METHOD_CALL                                         !18, 'resizeImage'
         80        SEND_VAL_EX                                              300
         81        SEND_VAL_EX                                              220
         82        SEND_VAL_EX                                              'auto'
         83        DO_FCALL                                      0          
   40    84        INIT_METHOD_CALL                                         !18, 'saveImage'
         85        SEND_VAL_EX                                              'uploads%2Fsample-resized.jpg'
         86        SEND_VAL_EX                                              100
         87        DO_FCALL                                      0          
   43    88        ASSIGN                                                   !19, 'uploads%2Fsample-resized.jpg'
   44    89        INIT_FCALL                                               'fread'
         90        INIT_FCALL                                               'fopen'
         91        SEND_VAR                                                 !19
         92        SEND_VAL                                                 'r'
         93        DO_ICALL                                         $90     
         94        SEND_VAR                                                 $90
         95        INIT_FCALL                                               'filesize'
         96        SEND_VAR                                                 !19
         97        DO_ICALL                                         $91     
         98        SEND_VAR                                                 $91
         99        DO_ICALL                                         $92     
        100        ASSIGN                                                   !20, $92
   45   101        INIT_FCALL                                               'base64_encode'
        102        SEND_VAR                                                 !20
        103        DO_ICALL                                         $94     
        104        ASSIGN                                                   !21, $94
   46   105        CONCAT                                           ~96     'data%3Aimage%2Fjpg%3Bbase64%2C', !21
        106        CONCAT                                           ~97     ~96, ''
        107        ASSIGN                                                   !22, ~97
   50   108        FETCH_CONSTANT                                   ~100    'almoco'
        109        IS_EQUAL                                                 !6, ~100
        110      > JMPNZ                                                    ~99, ->115
   53   111    >   FETCH_CONSTANT                                   ~101    'jantar'
        112        IS_EQUAL                                                 !6, ~101
        113      > JMPNZ                                                    ~99, ->117
        114    > > JMP                                                      ->119
   51   115    >   ASSIGN                                                   !23, '1'
   52   116      > JMP                                                      ->121
   54   117    >   ASSIGN                                                   !24, '1'
   55   118      > JMP                                                      ->121
   57   119    >   ASSIGN                                                   !6, ''
   58   120      > JMP                                                      ->121
   63   121    >   IS_EQUAL                                                 !0, '1'
        122      > JMPNZ                                                    ~105, ->130
   69   123    >   IS_EQUAL                                                 !0, '2'
        124      > JMPNZ                                                    ~105, ->135
   75   125    >   IS_EQUAL                                                 !0, '3'
        126      > JMPNZ                                                    ~105, ->140
   82   127    >   IS_EQUAL                                                 !0, '4'
        128      > JMPNZ                                                    ~105, ->145
        129    > > JMP                                                      ->150
   64   130    >   ASSIGN                                                   !0, '1.1'
   65   131        ASSIGN                                                   !25, '1%C2%BA+Turno+decis%C3%A3o+almo%C3%A7o+dia+seguinte'
   66   132        ASSIGN                                                   !26, '1'
   67   133        ASSIGN                                                   !27, '0'
   68   134      > JMP                                                      ->150
   70   135    >   ASSIGN                                                   !0, '1.2'
   71   136        ASSIGN                                                   !25, 'Sa%C3%ADda+1%C2%BA+turno'
   72   137        ASSIGN                                                   !26, '1'
   73   138        ASSIGN                                                   !27, '0'
   74   139      > JMP                                                      ->150
   76   140    >   ASSIGN                                                   !0, '2.1'
   77   141        ASSIGN                                                   !25, 'Segundo+turno+Entrada+decis%C3%A3o+Jantar+dia+seguinte'
   78   142        ASSIGN                                                   !27, '1'
   79   143        ASSIGN                                                   !26, '0'
   80   144      > JMP                                                      ->150
   83   145    >   ASSIGN                                                   !0, '2.2'
   84   146        ASSIGN                                                   !25, '2%C2%BA+turno+Sa%C3%ADda'
   85   147        ASSIGN                                                   !27, '1'
   86   148        ASSIGN                                                   !26, '0'
   87   149      > JMP                                                      ->150
  109   150    >   IS_EQUAL                                                 !3, 'picagem'
        151      > JMPZ                                                     ~122, ->206
  110   152    >   INIT_FCALL_BY_NAME                                       'mysql_query'
        153        ROPE_INIT                                    39  ~124    'INSERT+INTO+%60picagens%60%28%60userid%60%2C+%60picagemnr%60%2C+%60ano%60%2C+%60mes%60%2C+%60dia%60%2C+%60hora%60%2C+%60minuto%60%2C+%60segundo%60%2C+%60time%60%2C+%60ip%60%2C+%60almoco%60%2C+%60jantar%60%2C+%60Dias%60%2C+%60Horas%60%2C+%60Picagem%60%2C+%60turno_manha%60%2C+%60turno_tarde%60%2C+%60total_dia%60%2C+%60foto_code%60%29+VALUES+%28%27'
        154        ROPE_ADD                                      1  ~124    ~124, !4
        155        ROPE_ADD                                      2  ~124    ~124, '%27%2C%27'
        156        ROPE_ADD                                      3  ~124    ~124, !0
        157        ROPE_ADD                                      4  ~124    ~124, '%27%2C%27'
        158        ROPE_ADD                                      5  ~124    ~124, !7
        159        ROPE_ADD                                      6  ~124    ~124, '%27%2C%27'
        160        ROPE_ADD                                      7  ~124    ~124, !8
        161        ROPE_ADD                                      8  ~124    ~124, '%27%2C%27'
        162        ROPE_ADD                                      9  ~124    ~124, !9
        163        ROPE_ADD                                     10  ~124    ~124, '%27%2C%27'
        164        ROPE_ADD                                     11  ~124    ~124, !10
        165        ROPE_ADD                                     12  ~124    ~124, '%27%2C%27'
        166        ROPE_ADD                                     13  ~124    ~124, !11
        167        ROPE_ADD                                     14  ~124    ~124, '%27%2C%27'
        168        ROPE_ADD                                     15  ~124    ~124, !12
        169        ROPE_ADD                                     16  ~124    ~124, '%27%2C%27'
        170        ROPE_ADD                                     17  ~124    ~124, !14
        171        ROPE_ADD                                     18  ~124    ~124, '%27%2C%27'
        172        ROPE_ADD                                     19  ~124    ~124, !13
        173        ROPE_ADD                                     20  ~124    ~124, '%27%2C+%27'
        174        ROPE_ADD                                     21  ~124    ~124, !23
        175        ROPE_ADD                                     22  ~124    ~124, '%27%2C%27'
        176        ROPE_ADD                                     23  ~124    ~124, !24
        177        ROPE_ADD                                     24  ~124    ~124, '%27%2C%27'
        178        ROPE_ADD                                     25  ~124    ~124, !28
        179        ROPE_ADD                                     26  ~124    ~124, '%27%2C%27'
        180        ROPE_ADD                                     27  ~124    ~124, !29
        181        ROPE_ADD                                     28  ~124    ~124, '%27%2C%27'
        182        ROPE_ADD                                     29  ~124    ~124, !25
        183        ROPE_ADD                                     30  ~124    ~124, '%27%2C%27'
        184        ROPE_ADD                                     31  ~124    ~124, !26
        185        ROPE_ADD                                     32  ~124    ~124, '%27%2C%27'
        186        ROPE_ADD                                     33  ~124    ~124, !27
        187        ROPE_ADD                                     34  ~124    ~124, '%27%2C+%27'
        188        ROPE_ADD                                     35  ~124    ~124, !30
        189        ROPE_ADD                                     36  ~124    ~124, '%27%2C%27'
        190        ROPE_ADD                                     37  ~124    ~124, !22
        191        ROPE_END                                     38  ~123    ~124, '%27%29'
        192        SEND_VAL_EX                                              ~123
        193        DO_FCALL                                      0          
  111   194        IS_EQUAL                                                 !1, '1'
        195      > JMPZ                                                     ~145, ->206
  112   196    >   INIT_FCALL_BY_NAME                                       'mysql_query'
        197        ROPE_INIT                                     7  ~147    'UPDATE+%60mensagens%60+SET+%60data_lida%60+%3D+%27'
        198        ROPE_ADD                                      1  ~147    ~147, !15
        199        ROPE_ADD                                      2  ~147    ~147, '%27+%2C%60hora_lida%60%3D+%27'
        200        ROPE_ADD                                      3  ~147    ~147, !16
        201        ROPE_ADD                                      4  ~147    ~147, '%27+WHERE+%60id%60+%3D+%27'
        202        ROPE_ADD                                      5  ~147    ~147, !2
        203        ROPE_END                                      6  ~146    ~147, '%27'
        204        SEND_VAL_EX                                              ~146
        205        DO_FCALL                                      0          
  115   206    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.19 ms | 964 KiB | 33 Q