Code Duplication    Length = 14-15 lines in 3 locations

views/steam/life/player.php 3 locations

@@ 141-154 (lines=14) @@
138
                    <div class="tab-pane fade in active well" id="civ_lic">
139
                        <h4 style="centred"><?php echo $lang['civ'] . " " . $lang['licenses']; ?> </h4>
140
                        <?php
141
                            if ($player->civ_licenses !== '"[]"') {
142
                                $return = stripArray($player->civ_licenses, 0);
143
                                foreach ($return as $value) {
144
                                    if (strpos($value, "1") == TRUE) {
145
                                        $name = before(',', $value);
146
                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
147
                                    } else {
148
                                        $name = before(',', $value);
149
                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
150
                                    }
151
                                }
152
                            } else {
153
                                    echo errorMessage(37,$lang);
154
                            }?>
155
                    </div>
156
                    <div class="tab-pane well fade" id="medic_lic">
157
                        <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['licenses']; ?> </h4>
@@ 159-173 (lines=15) @@
156
                    <div class="tab-pane well fade" id="medic_lic">
157
                        <h4 style="centred"><?php echo $lang['medic'] . " " . $lang['licenses']; ?> </h4>
158
                        <?php
159
                            if ($player->med_licenses !== '"[]"') {
160
                                $return = stripArray($player->med_licenses,0);
161
162
                                foreach ($return as $value) {
163
                                    if (strpos($value, "1") == TRUE) {
164
                                        $name = before(',', $value);
165
                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
166
                                    } else {
167
                                        $name = before(',', $value);
168
                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
169
                                    }
170
                                }
171
                            } else {
172
                                    echo errorMessage(37,$lang);
173
                            } ?>
174
                    </div>
175
                    <div class="tab-pane well fade" id="police_lic">
176
                        <h4 style="centred"><?php echo $lang['cop'] . " " . $lang['licenses']; ?> </h4>
@@ 178-192 (lines=15) @@
175
                    <div class="tab-pane well fade" id="police_lic">
176
                        <h4 style="centred"><?php echo $lang['cop'] . " " . $lang['licenses']; ?> </h4>
177
                        <?php
178
                            if ($player->cop_licenses !== '"[]"') {
179
                                $return = stripArray($player->cop_licenses,0);
180
181
                                foreach ($return as $value) {
182
                                    if (strpos($value, "1") == TRUE) {
183
                                        $name = before(',', $value);
184
                                        echo "<button class='license btn btn-xs btn-success' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
185
                                    } else {
186
                                        $name = before(',', $value);
187
                                        echo "<button class='license btn btn-xs btn-theme01' style='margin-bottom: 3px;'>" . licName($name, $license) . "</button> ";
188
                                    }
189
                                }
190
                            } else {
191
                                    echo errorMessage(37,$lang);
192
                            }
193
                        ?>
194
                    </div>
195
                <?php } ?>