1
|
|
|
<div class="row"> |
2
|
|
|
<div class="col-lg-12"> |
3
|
|
|
<h1 class="page-header"> |
4
|
|
|
<?php echo $lang['navDashboard']; ?> |
5
|
|
|
</h1> |
6
|
|
|
</div> |
7
|
|
|
</div> |
8
|
|
|
<?php if (isset($message)) { |
9
|
|
|
echo '<div class="alert alert-info" role="alert">' . $message . '</div>'; |
10
|
|
|
} |
11
|
|
|
?> |
12
|
|
|
|
13
|
|
|
<div class="row mt mb"> |
14
|
|
|
<div class="col-md-12"> |
15
|
|
|
<section class="task-panel tasks-widget"> |
16
|
|
|
<div class="panel-heading"> |
17
|
|
|
<div class="pull-left"><h5><i class="fa fa-tasks"></i> Your Servers</h5></div> |
18
|
|
|
<br> |
19
|
|
|
</div> |
20
|
|
|
<div class="panel-body"> |
21
|
|
|
<div class="task-content"> |
22
|
|
|
<ul id="sortable" class="task-list ui-sortable"> |
23
|
|
|
<?php |
24
|
|
|
$sql = "SELECT `sid`,`dbid`,`type`,`name` FROM `servers`;"; |
25
|
|
|
$result_of_query = $db_connection->query($sql); |
26
|
|
|
|
27
|
|
View Code Duplication |
if ($result_of_query->num_rows >= 1) { |
|
|
|
|
28
|
|
|
while ($row = mysqli_fetch_assoc($result_of_query)) { |
29
|
|
|
if ($row['type'] == 'life'){ ?> |
30
|
|
|
<li class="list-primary"> |
31
|
|
|
<i class=" fa fa-ellipsis-v"></i> |
32
|
|
|
<div class="task-title"> |
33
|
|
|
<span class="task-title-sp"><?php echo $row['name']; ?></span> |
34
|
|
|
<span class="badge bg-theme">Life</span> |
35
|
|
|
<div style="float:right; padding-right: 15px;"> |
36
|
|
|
<form method="post" action="<?php echo $settings['url'] ?>dashboard"> |
37
|
|
|
<input type="hidden" name="type" value="<?php echo $row['type']; ?>"> |
38
|
|
|
<input type="hidden" name="dbid" value="<?php echo $row['dbid']; ?>"> |
39
|
|
|
<button class="btn btn-success btn-sm fa fa-eye" type="submit"></button> |
40
|
|
|
</form> |
41
|
|
|
</div> |
42
|
|
|
</div> |
43
|
|
|
</li> |
44
|
|
|
<?php }elseif ($row['type'] == 'waste') { ?> |
45
|
|
|
<li class="list-danger"> |
46
|
|
|
<i class=" fa fa-ellipsis-v"></i> |
47
|
|
|
<div class="task-title"> |
48
|
|
|
<span class="task-title-sp"><?php echo $row['name']; ?></span> |
49
|
|
|
<span class="badge bg-important">Wasteland</span> |
50
|
|
|
<div class="pull-right hidden-phone"> |
51
|
|
|
<form method="post" action="<?php echo $settings['url'] ?>dashboard"> |
52
|
|
|
<input type="hidden" name="type" value="<?php echo $row['type']; ?>"> |
53
|
|
|
<input type="hidden" name="dbid" value="<?php echo $row['dbid']; ?>"> |
54
|
|
|
<button class="btn btn-success btn-sm fa fa-eye" type="submit"></button> |
55
|
|
|
</form> |
56
|
|
|
</div> |
57
|
|
|
</li> |
58
|
|
|
<?php |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
echo '</select>'; |
62
|
|
|
} |
63
|
|
|
?> |
64
|
|
|
</ul> |
65
|
|
|
</div> |
66
|
|
|
</div> |
67
|
|
|
</section> |
68
|
|
|
</div> |
69
|
|
|
</div> |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.