Code Duplication    Length = 15-15 lines in 3 locations

views/life/editPlayer.php 3 locations

@@ 271-285 (lines=15) @@
268
            <?php if ($_SESSION['permissions']['view']['licences'] || $player->playerid == $_SESSION['playerid']) { ?>
269
              <div class="tab-pane fade in active well" id="civ_lic">
270
                  <?php
271
                  if ($player->civ_licenses !== '"[]"' && $player->civ_licenses !== '') {
272
                      echo '<h4 style="centred">' . $lang['civil'] . ' ' . $lang['licenses'] . '</h4>';
273
                      $return = stripArray($player->civ_licenses, 0);
274
                      foreach ($return as $value) {
275
                          if (strpos($value, "1") == TRUE) {
276
                              $name = before(',', $value);
277
                              echo "<button type='button' id=" . $name . " class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
278
                          } else {
279
                              $name = before(',', $value);
280
                              echo "<button type='button' id=" . $name . " class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
281
                          }
282
                      }
283
                  } else {
284
                      echo '<h4>' . errorMessage(371, $lang) . '</h4>';
285
                  } ?>
286
              </div>
287
              <div class="tab-pane well fade" id="medic_lic">
288
                  <?php
@@ 289-303 (lines=15) @@
286
              </div>
287
              <div class="tab-pane well fade" id="medic_lic">
288
                  <?php
289
                  if ($player->med_licenses !== '"[]"' && $player->med_licenses !== '') {
290
                      echo '<h4 style="centred">' . $lang['medic'] . ' ' . $lang['licenses'] . '</h4>';
291
                      $return = stripArray($player->med_licenses, 0);
292
                      foreach ($return as $value) {
293
                          if (strpos($value, "1") == TRUE) {
294
                              $name = before(',', $value);
295
                              echo "<button type='button' id=" . $name . " class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
296
                          } else {
297
                              $name = before(',', $value);
298
                              echo "<button type='button' id=" . $name . " class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
299
                          }
300
                      }
301
                  } else {
302
                      echo '<h4>' . errorMessage(372, $lang) . '</h4>';
303
                  } ?>
304
              </div>
305
              <div class="tab-pane well fade" id="police_lic">
306
                  <?php
@@ 307-321 (lines=15) @@
304
              </div>
305
              <div class="tab-pane well fade" id="police_lic">
306
                  <?php
307
                  if ($player->cop_licenses !== '"[]"' && $player->cop_licenses !== '') {
308
                      $return = stripArray($player->cop_licenses, 0);
309
                      echo '<h4 style="centred">' . $lang['cop'] . ' ' . $lang['licenses'] . '</h4>';
310
                      foreach ($return as $value) {
311
                          if (strpos($value, "1") == TRUE) {
312
                              $name = before(',', $value);
313
                              echo "<button type='button' id=" . $name . " class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
314
                          } else {
315
                              $name = before(',', $value);
316
                              echo "<button type='button' id=" . $name . " class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
317
                          }
318
                      }
319
                  } else {
320
                      echo '<h4>' . errorMessage(373, $lang) . '</h4>';
321
                  }
322
                  ?>
323
              </div>
324
            <?php }