3v4l.org

run code in 300+ PHP versions simultaneously
<?php include "./classes.php"; include "./texts.php"; $db = new Db(); // TASK PROCCESSING $tasks_proccessing = $db->select("SELECT t.id as idt, c.name as namec, m.name as namem, c.id as idc, DATE_FORMAT(t.start, '%d %b - %H:%i') as start, DATE_FORMAT(t.finish, '%d %b - %H:%i:%s') as finish, timediff(curtime(),date_format(t.finish,'%H:%i:%s')) as diferencia FROM clients c, tasks t, machines m WHERE t.machine_id = m.id AND t.client_id = c.id AND c.id = t.client_id AND (t.finish is NULL or (DATE(t.finish) = CURDATE())) ORDER BY t.id desc"); // START TASKS PROCCESSING--> if (empty($tasks_proccessing)) { echo '<div class="alert alert-warning text-center" role="alert"><strong>'.$tnotasks.'</strong></div>'; }else{ ?> <table class="table"> <thead> <tr class="active"> <th>#</th> <th>Client</th> <th>Machine</th> <th>Start</th> <th>State</th> </tr> </thead> <tbod> <?php foreach ($tasks_proccessing as $thetask) { if (empty($thetask["finish"])){ $classtouse="warning"; $content = "Work in Progress"; }else{ $classtouse="success"; $content = $thetask["finish"]; if ($thetask["diferencia"]<'00:00:06'){ $content .= '<audio autoplay="autoplay"> <source src="ding.ogg" type="audio/ogg"><source src="ding.mp3" type="audio/mpeg"> Your browser does not support the audio element.</audio>'; $content .= '&nbsp;&nbsp;<span class="glyphicon glyphicon-thumbs-up text-warning" aria-hidden="true"></span>'; } } ?> <tr class="<?php echo $classtouse; ?>"> <th scope="row"><?php echo $thetask["idt"]; ?></th> <td><?php echo $thetask["namec"]; ?></td> <td><?php echo $thetask["namem"]; ?></td> <td><?php echo $thetask["start"]; ?></td> <td><?php echo $content; ?></td> </tr> <?php } //END FOREACH?> </tbody> </table> <?php } // START SCARTO PROCCESSING--> /*if (empty($scarto_proccessing)) { echo '<div class="alert alert-warning text-center" role="alert"><strong>'.$tnoscarto.'</strong></div>'; }else{ */?> <table class="table"> <thead> <tr class="active"> <th>#</th> <th>Client</th> <th class="text-center">Scarto</th> </tr> </thead> <tbod> <?php $clients = $db->select("SELECT DISTINCT c.name as namec, c.id as idc FROM clients c, scarto s WHERE s.client_id = c.id AND (DATE(s.created) = CURDATE()) ORDER BY c.name desc"); foreach ($clients as $client) { ?> <tr class="danger"> <th scope="row"></th> <td><?php echo $client["namec"]; ?></td> <td> <table class="table"> <thead> <tr class="active"> <th>Sporco</th> <th>Rotto</th> </tr> </thead> <tbod> <?php $scarto_proccessing = $db->select("SELECT a.name as namea, c.name as namec, c.id as idc, sum(s.quantity_sporco) as qs, sum(s.quantity_rotto) as qr, DATE_FORMAT(s.created, '%d %b - %H:%i') as created FROM clients c, scarto s, articles a WHERE a.id = s.article_id AND s.client_id = c.id AND c.id = ".$client["idc"]." AND (DATE(s.created) = CURDATE()) GROUP BY a.id ORDER BY a.name desc"); foreach ($scarto_proccessing as $thescarto) { ?> <tr> <td><?php echo $thescarto["namea"]." - ".$thescarto["qs"]; ?></td> <td><?php echo $thescarto["namea"]." - ".$thescarto["qr"]; ?></td> </tr> <?php } ?> </tbod> </table> </td> </tr> <?php } //END FOREACH?> </tbody> </table> <?php //} ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 77) Position 1 = 57, Position 2 = 88
Branch analysis from position: 57
2 jumps found. (Code = 78) Position 1 = 58, Position 2 = 88
Branch analysis from position: 58
2 jumps found. (Code = 77) Position 1 = 70, Position 2 = 85
Branch analysis from position: 70
2 jumps found. (Code = 78) Position 1 = 71, Position 2 = 85
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 85
Branch analysis from position: 88
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 88
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 49
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 49
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 31
Branch analysis from position: 49
2 jumps found. (Code = 77) Position 1 = 57, Position 2 = 88
Branch analysis from position: 57
Branch analysis from position: 88
Branch analysis from position: 49
filename:       /in/nIoEC
function name:  (null)
number of ops:  91
compiled vars:  !0 = $db, !1 = $tasks_proccessing, !2 = $tnotasks, !3 = $thetask, !4 = $classtouse, !5 = $content, !6 = $clients, !7 = $client, !8 = $scarto_proccessing, !9 = $thescarto
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INCLUDE_OR_EVAL                                          '.%2Fclasses.php', INCLUDE
    4     1        INCLUDE_OR_EVAL                                          '.%2Ftexts.php', INCLUDE
    5     2        NEW                                              $12     'Db'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $12
    7     5        INIT_METHOD_CALL                                         !0, 'select'
          6        SEND_VAL_EX                                              'SELECT+%0A++++++++++++++++++++++++++++++++++++t.id+as+idt%2C+%0A++++++++++++++++++++++++++++++++++++c.name+as+namec%2C+%0A++++++++++++++++++++++++++++++++++++m.name+as+namem%2C%0A++++++++++++++++++++++++++++++++++++c.id+as+idc%2C+%0A++++++++++++++++++++++++++++++++++++DATE_FORMAT%28t.start%2C+%27%25d+%25b+-+%25H%3A%25i%27%29+as+start%2C+%0A++++++++++++++++++++++++++++++++++++DATE_FORMAT%28t.finish%2C+%27%25d+%25b+-+%25H%3A%25i%3A%25s%27%29+as+finish%2C%0A++++++++++++++++++++++++++++++++++++timediff%28curtime%28%29%2Cdate_format%28t.finish%2C%27%25H%3A%25i%3A%25s%27%29%29+as+diferencia%0A++++++++++++++++++++++++++++++++++++FROM+clients+c%2C+tasks+t%2C+machines+m+%0A++++++++++++++++++++++++++++++++++++WHERE+%0A++++++++++++++++++++++++++++++++++++++t.machine_id+%3D+m.id+AND%0A++++++++++++++++++++++++++++++++++++++t.client_id+%3D+c.id+AND+%0A++++++++++++++++++++++++++++++++++++++c.id+%3D+t.client_id+AND+%0A++++++++++++++++++++++++++++++++++++++%28t.finish+is+NULL+or+%28DATE%28t.finish%29+%3D+CURDATE%28%29%29%29+%0A++++++++++++++++++++++++++++++++++++ORDER+BY+t.id+desc'
          7        DO_FCALL                                      0  $15     
          8        ASSIGN                                                   !1, $15
   24     9        ISSET_ISEMPTY_CV                                         !1
         10      > JMPZ                                                     ~17, ->15
   25    11    >   CONCAT                                           ~18     '%3Cdiv+class%3D%22alert+alert-warning+text-center%22+role%3D%22alert%22%3E%3Cstrong%3E', !2
         12        CONCAT                                           ~19     ~18, '%3C%2Fstrong%3E%3C%2Fdiv%3E'
         13        ECHO                                                     ~19
         14      > JMP                                                      ->51
   27    15    >   ECHO                                                     '%09%3Ctable+class%3D%22table%22%3E%0A%09++%3Cthead%3E%0A%09++++%3Ctr+class%3D%22active%22%3E%0A%09++++++%3Cth%3E%23%3C%2Fth%3E%0A%09++++++%3Cth%3EClient%3C%2Fth%3E%0A%09++++++%3Cth%3EMachine%3C%2Fth%3E%0A%09++++++%3Cth%3EStart%3C%2Fth%3E%0A%09++++++%3Cth%3EState%3C%2Fth%3E%0A%09++++%3C%2Ftr%3E%0A%09++%3C%2Fthead%3E%0A%09++%3Ctbod%3E%0A%0A%09++'
   39    16      > FE_RESET_R                                       $20     !1, ->49
         17    > > FE_FETCH_R                                               $20, !3, ->49
   40    18    >   ISSET_ISEMPTY_DIM_OBJ                         1          !3, 'finish'
         19      > JMPZ                                                     ~21, ->23
   41    20    >   ASSIGN                                                   !4, 'warning'
   42    21        ASSIGN                                                   !5, 'Work+in+Progress'
         22      > JMP                                                      ->31
   44    23    >   ASSIGN                                                   !4, 'success'
   45    24        FETCH_DIM_R                                      ~25     !3, 'finish'
         25        ASSIGN                                                   !5, ~25
   46    26        FETCH_DIM_R                                      ~27     !3, 'diferencia'
         27        IS_SMALLER                                               ~27, '00%3A00%3A06'
         28      > JMPZ                                                     ~28, ->31
   48    29    >   ASSIGN_OP                                     8          !5, '%3Caudio+autoplay%3D%22autoplay%22%3E+%3Csource+src%3D%22ding.ogg%22+type%3D%22audio%2Fogg%22%3E%3Csource+src%3D%22ding.mp3%22+type%3D%22audio%2Fmpeg%22%3E%0AYour+browser+does+not+support+the+audio+element.%3C%2Faudio%3E'
   50    30        ASSIGN_OP                                     8          !5, '%26nbsp%3B%26nbsp%3B%3Cspan+class%3D%22glyphicon+glyphicon-thumbs-up+text-warning%22+aria-hidden%3D%22true%22%3E%3C%2Fspan%3E'
   54    31    >   ECHO                                                     '%0A%09++++%3Ctr+class%3D%22'
   55    32        ECHO                                                     !4
         33        ECHO                                                     '%22%3E%0A%09++++++%3Cth+scope%3D%22row%22%3E'
   56    34        FETCH_DIM_R                                      ~31     !3, 'idt'
         35        ECHO                                                     ~31
         36        ECHO                                                     '%3C%2Fth%3E%0A%09++++++%3Ctd%3E'
   57    37        FETCH_DIM_R                                      ~32     !3, 'namec'
         38        ECHO                                                     ~32
         39        ECHO                                                     '%3C%2Ftd%3E%0A%09++++++%3Ctd%3E'
   58    40        FETCH_DIM_R                                      ~33     !3, 'namem'
         41        ECHO                                                     ~33
         42        ECHO                                                     '%3C%2Ftd%3E%0A%09++++++%3Ctd%3E'
   59    43        FETCH_DIM_R                                      ~34     !3, 'start'
         44        ECHO                                                     ~34
         45        ECHO                                                     '%3C%2Ftd%3E%0A%09++++++%3Ctd%3E'
   60    46        ECHO                                                     !5
         47        ECHO                                                     '%3C%2Ftd%3E%0A%0A%09++++%3C%2Ftr%3E%0A%0A%09++++'
   39    48      > JMP                                                      ->17
         49    >   FE_FREE                                                  $20
   65    50        ECHO                                                     '%09++%0A%09++%3C%2Ftbody%3E%0A%09%3C%2Ftable%3E%0A%09'
   75    51    >   ECHO                                                     '%09%3Ctable+class%3D%22table%22%3E%0A%09++%3Cthead%3E%0A%09++++%3Ctr+class%3D%22active%22%3E%0A%09++++++%3Cth%3E%23%3C%2Fth%3E%0A%09++++++%3Cth%3EClient%3C%2Fth%3E%0A%09++++++%3Cth+class%3D%22text-center%22%3EScarto%3C%2Fth%3E%0A%09++++%3C%2Ftr%3E%0A%09++%3C%2Fthead%3E%0A%09++%3Ctbod%3E%0A%0A%09++'
   86    52        INIT_METHOD_CALL                                         !0, 'select'
         53        SEND_VAL_EX                                              'SELECT+DISTINCT+c.name+as+namec%2C+%0A++++++++++++++++++++++++++++++++++++c.id+as+idc%0A++++++++++++++++++++++++++++++++++++FROM+clients+c%2C+scarto+s+%0A++++++++++++++++++++++++++++++++++++WHERE+%0A++++++++++++++++++++++++++++++++++++++s.client_id+%3D+c.id+AND+%0A++++++++++++++++++++++++++++++++++++++%28DATE%28s.created%29+%3D+CURDATE%28%29%29%0A++++++++++++++++++++++++++++++++++++ORDER+BY+c.name+desc'
         54        DO_FCALL                                      0  $35     
         55        ASSIGN                                                   !6, $35
   93    56      > FE_RESET_R                                       $37     !6, ->88
         57    > > FE_FETCH_R                                               $37, !7, ->88
   94    58    >   ECHO                                                     '%0A%09++++%3Ctr+class%3D%22danger%22%3E%0A%09++++++%3Cth+scope%3D%22row%22%3E%3C%2Fth%3E%0A%09++++++%3Ctd%3E'
   97    59        FETCH_DIM_R                                      ~38     !7, 'namec'
         60        ECHO                                                     ~38
         61        ECHO                                                     '%3C%2Ftd%3E%0A%0A%09++++++%3Ctd%3E%0A%09++++++%09%3Ctable+class%3D%22table%22%3E%0A%09%09%09++%3Cthead%3E%0A%09%09%09++++%3Ctr+class%3D%22active%22%3E%0A%09%09%09++++++%3Cth%3ESporco%3C%2Fth%3E%0A%09%09%09++++++%3Cth%3ERotto%3C%2Fth%3E%0A%09%09%09++++%3C%2Ftr%3E%0A%09%09%09++%3C%2Fthead%3E%0A%09%09%09++%3Ctbod%3E%0A%09++++++%09%09'
  109    62        INIT_METHOD_CALL                                         !0, 'select'
  120    63        FETCH_DIM_R                                      ~39     !7, 'idc'
         64        CONCAT                                           ~40     'SELECT+%0A%09++++++%09%09%09%09%09%09%09a.name+as+namea%2C%0A++++++++++++++++++++++++++++++++++++c.name+as+namec%2C+%0A++++++++++++++++++++++++++++++++++++c.id+as+idc%2C+%0A++++++++++++++++++++++++++++++++++++sum%28s.quantity_sporco%29+as+qs%2C%0A++++++++++++++++++++++++++++++++++++sum%28s.quantity_rotto%29+as+qr%2C%0A++++++++++++++++++++++++++++++++++++DATE_FORMAT%28s.created%2C+%27%25d+%25b+-+%25H%3A%25i%27%29+as+created%0A++++++++++++++++++++++++++++++++++++FROM+clients+c%2C+scarto+s%2C+articles+a%0A++++++++++++++++++++++++++++++++++++WHERE+%0A++++++++++++++++++++++++++++++++++++++a.id+%3D+s.article_id+AND%0A++++++++++++++++++++++++++++++++++++++s.client_id+%3D+c.id+AND+%0A++++++++++++++++++++++++++++++++++++++c.id+%3D+', ~39
         65        CONCAT                                           ~41     ~40, '+AND+%0A++++++++++++++++++++++++++++++++++++++%28DATE%28s.created%29+%3D+CURDATE%28%29%29+%0A++++++++++++++++++++++++++++++++++++++GROUP+BY+a.id+%0A++++++++++++++++++++++++++++++++++++ORDER+BY+a.name+desc'
         66        SEND_VAL_EX                                              ~41
         67        DO_FCALL                                      0  $42     
  109    68        ASSIGN                                                   !8, $42
  124    69      > FE_RESET_R                                       $44     !8, ->85
         70    > > FE_FETCH_R                                               $44, !9, ->85
  125    71    >   ECHO                                                     '%09++++++%09%09%09%3Ctr%3E%0A%09++++++%09%09%09%09%3Ctd%3E'
  126    72        FETCH_DIM_R                                      ~45     !9, 'namea'
         73        CONCAT                                           ~46     ~45, '+-+'
         74        FETCH_DIM_R                                      ~47     !9, 'qs'
         75        CONCAT                                           ~48     ~46, ~47
         76        ECHO                                                     ~48
         77        ECHO                                                     '%3C%2Ftd%3E%0A%09++++++%09%09%09%09%3Ctd%3E'
  127    78        FETCH_DIM_R                                      ~49     !9, 'namea'
         79        CONCAT                                           ~50     ~49, '+-+'
         80        FETCH_DIM_R                                      ~51     !9, 'qr'
         81        CONCAT                                           ~52     ~50, ~51
         82        ECHO                                                     ~52
         83        ECHO                                                     '%3C%2Ftd%3E%0A%09++++++%09%09%09%3C%2Ftr%3E%0A%09++++++%09%09'
  124    84      > JMP                                                      ->70
         85    >   FE_FREE                                                  $44
  132    86        ECHO                                                     '%09++++++%09%09%3C%2Ftbod%3E%0A%09++++++%09%3C%2Ftable%3E%0A%09++++++%3C%2Ftd%3E%0A%09++++%3C%2Ftr%3E%0A%0A%09++++'
   93    87      > JMP                                                      ->57
         88    >   FE_FREE                                                  $37
  138    89        ECHO                                                     '%09++%0A%09++%3C%2Ftbody%3E%0A%09%3C%2Ftable%3E%0A%09'
  143    90      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.81 ms | 1407 KiB | 13 Q