Skip to content

Commit

Permalink
redesign 3.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
machine62 committed Mar 22, 2024
1 parent 26d868c commit 735c609
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 208 deletions.
219 changes: 109 additions & 110 deletions cdr_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,126 +4,124 @@
<script src='./mod/cdr/js/sorts/tablesort.number.min.js'></script>
<script src='./mod/cdr/js/sorts/tablesort.date.min.js'></script>

<table style="width: 60%">
<tr>
<td class='c' id='GAll'><span onclick="document.location.href='index.php?action=cdr&galaxy=all'"><b>ALL</b></td>
<?php
for ($i = 1; $i <= $server_config['num_of_galaxies']; $i++) {
echo "<td class='c' id='G{$i}'><span onclick=\"document.location.href='index.php?action=cdr&galaxy={$i}'\"><b>G{$i}</b></span></td>";
}
?>
<?php
//tag active
$pub_galaxy = (isset($pub_galaxy)) ? $pub_galaxy : "all";

$activecdrgall = ($pub_galaxy == "all") ? "active" : "";
$activecdrg= array();
for ($i = 1; $i <= $server_config['num_of_galaxies']; $i++) {
$activecdrg[$i] = ($pub_galaxy == $i) ? "active" : "";
}
?>

<div class="nav-page-menu">
<div class="nav-page-menu-item <?php echo $activecdrgall; ?> ">
<a class="nav-page-menu-link" href="index.php?action=cdr&amp;galaxy=all">
<?php echo $lang['menu_cdr']; ?>
</a>
</div>
<?php for ($i = 1; $i <= $server_config['num_of_galaxies']; $i++) :?>
<div class="nav-page-menu-item <?php echo $activecdrg[$i]; ?> ">
<a class="nav-page-menu-link" href="index.php?action=cdr&amp;galaxy=<?php echo $i;?>">
G<?php echo $i; ?>
</a>
</div>
<?php endfor;?>

</div>

</tr>
</table>

<?php
// On récupère les technos pourle Fret
$user_empire = user_get_empire($user_data['user_id']);
$user_technology = $user_empire["technology"];
$fret_recycleur = (20000 * (1 + 0.05 * $user_technology['Hyp']));
// On surligne la G Sélectionnée
$galaxy = (isset($pub_galaxy)) ? $pub_galaxy : "all";
if($galaxy === 'all'){
echo "<script>$(\"#GAll\").css( \"color\", \"yellow\" );</script>";
} else {
echo "<script>$(\"#G{$galaxy}\").css( \"color\", \"yellow\" );</script>";
}

?>
<br>

<table id="trier" style="background: #2C2C2C; width: 80%">
<table id="trier" class="og-table og-medium-table">
<thead>
<tr>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['coord']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['nb_recy']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['total']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['metal']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['crystal']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['date']; ?></th>
</tr>
<tr>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['coord']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['nb_recy']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['total']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['metal']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['crystal']; ?></th>
<th class='' data-sort-method='' style="text-align:center"><?php echo $lang['date']; ?></th>
</tr>
</thead>
<tbody style="text-align:center">
<?php
if (isset($pub_galaxy) && $pub_galaxy != "") {
if ($pub_galaxy == "all")
{
<?php
if (isset($pub_galaxy) && $pub_galaxy != "") {
if ($pub_galaxy == "all") {
$galax = "";
} else {
$galax = " AND gal = '" . $pub_galaxy . "'";
}
} elseif (!empty($tc['galaxy'])) {
$galax = " AND gal = '" . $tc['galaxy'] . "'";
} else {
$galax = "";
}
else {
$galax = " AND gal = '" . $pub_galaxy . "'";
}
} elseif (!empty($tc['galaxy'])) {
$galax = " AND gal = '" . $tc['galaxy'] . "'";
}
else {
$galax = "";
}

$sql = "SELECT * FROM " . T_CDR . " WHERE `total` > '" . $tc['taille'] . "'" . $galax . " ORDER BY " . $tc['tri1'] . " " . $tc['tri2'];
$result = $db->sql_query($sql);
$i = 1;

while ($val = $db->sql_fetch_assoc($result)) {
$cdr_total = $val['total'];
$cdr_tot = number_format($val['total'], 0, '', ' ');
$cdr_metal = $val['metal'];
$cdr_met = number_format($val['metal'], 0, '', ' ');
$cdr_cristal = $val['cristal'];
$cdr_cri = number_format($val['cristal'], 0, '', ' ');

$sql = "SELECT * FROM " . T_CDR . " WHERE `total` > '" . $tc['taille'] . "'" . $galax . " ORDER BY " . $tc['tri1'] . " " . $tc['tri2'];
$result = $db->sql_query($sql);
$i = 1;

while ($val = $db->sql_fetch_assoc($result)) {
$cdr_total = $val['total'];
$cdr_tot = number_format($val['total'], 0, '', ' ');
$cdr_metal = $val['metal'];
$cdr_met = number_format($val['metal'], 0, '', ' ');
$cdr_cristal = $val['cristal'];
$cdr_cri = number_format($val['cristal'], 0, '', ' ');
?>

<tr>
<td class='' ><?php echo $val['gal'] . $val['coord']; ?></td>
<td class='' ><?php echo floor($val['total'] / $fret_recycleur); ?></td>
<td class='' ><?php
if ($val['total'] >= $tc['big']) {
echo "<span style='text-color:\#" . $tc['big_color'] . "'>" . $cdr_tot . "</span>";
}
elseif ($cdr_total >= $tc['medium']) {
echo "<span style='color:\#" . $tc['medium_color'] . "'>" . $cdr_tot . "</span>";
}
elseif ($cdr_total > $tc['small']) {
echo "<span style='color:\#" . $tc['small_color'] . "'>" . $cdr_tot . "</span>";
}
else {
echo $cdr_tot;
}
?></td>
<td class='' ><?php
if ($val['metal'] >= $tc['big']) {
echo "<span style='color:#" . $tc['big_color'] . "'>" . $cdr_met . "</span>";
}
elseif ($cdr_metal >= $tc['medium']) {
echo "<span style='color:#" . $tc['medium_color'] . "'>" . $cdr_met . "</span>";
}
elseif ($cdr_metal > $tc['small']) {
echo "<span style='color:#" . $tc['small_color'] . "'>" . $cdr_met . "</span>";
}
else {
echo $cdr_met;
}
?></td>
<td class='' ><?php
if ($val['cristal'] >= $tc['big']) {
echo "<span style='color:#" . $tc['big_color'] . "'>" . $cdr_cri . "</span>";
}
elseif ($cdr_cristal >= $tc['medium']) {
echo "<span style='color:#" . $tc['medium_color'] . "'>" . $cdr_cri . "</span>";
}
elseif ($cdr_cristal > $tc['small']){
echo "<span style='color:#" . $tc['small_color'] . "'>" . $cdr_cri . "</span>";
}
else{
echo $cdr_cri;
}

?></td>
<td class='' ><?php echo date($lang['date_format'], $val['date']); ?></td>
</tr>
<tr>
<td class=''><?php echo $val['gal'] . $val['coord']; ?></td>
<td class=''><?php echo floor($val['total'] / $fret_recycleur); ?></td>
<td class=''><?php
if ($val['total'] >= $tc['big']) {
echo "<span style='text-color:\#" . $tc['big_color'] . "'>" . $cdr_tot . "</span>";
} elseif ($cdr_total >= $tc['medium']) {
echo "<span style='color:\#" . $tc['medium_color'] . "'>" . $cdr_tot . "</span>";
} elseif ($cdr_total > $tc['small']) {
echo "<span style='color:\#" . $tc['small_color'] . "'>" . $cdr_tot . "</span>";
} else {
echo $cdr_tot;
}
?></td>
<td class=''><?php
if ($val['metal'] >= $tc['big']) {
echo "<span style='color:#" . $tc['big_color'] . "'>" . $cdr_met . "</span>";
} elseif ($cdr_metal >= $tc['medium']) {
echo "<span style='color:#" . $tc['medium_color'] . "'>" . $cdr_met . "</span>";
} elseif ($cdr_metal > $tc['small']) {
echo "<span style='color:#" . $tc['small_color'] . "'>" . $cdr_met . "</span>";
} else {
echo $cdr_met;
}
?></td>
<td class=''><?php
if ($val['cristal'] >= $tc['big']) {
echo "<span style='color:#" . $tc['big_color'] . "'>" . $cdr_cri . "</span>";
} elseif ($cdr_cristal >= $tc['medium']) {
echo "<span style='color:#" . $tc['medium_color'] . "'>" . $cdr_cri . "</span>";
} elseif ($cdr_cristal > $tc['small']) {
echo "<span style='color:#" . $tc['small_color'] . "'>" . $cdr_cri . "</span>";
} else {
echo $cdr_cri;
}

?></td>
<td class=''><?php echo date($lang['date_format'], $val['date']); ?></td>
</tr>

<?php
}
?>
}
?>
</tbody>
</table>
<script>
Expand All @@ -132,14 +130,15 @@

<br>

<table style="background: #2C2C2C">
<table class="og-table og-small-table" style="background: #2C2C2C">
<tbody>
<tr>
<td style="width: 2%; background: <?= "#".$tc['small_color']; ?>;"></td>
<td style="width: 10%;">&nbsp;<?= $lang['more_than'] . " ". number_format($tc['small'], 0, '', ' '); ?></td>
<td style="width: 2%; background-color: <?= "#".$tc['medium_color']; ?>" ></td>
<td style="width: 10%;">&nbsp;<?= $lang['more_than'] . " ". number_format($tc['medium'], 0, '', ' '); ?></td>
<td style="width: 2%; background-color: <?= "#".$tc['big_color']; ?>"></td>
<td style="width: 10%;">&nbsp;<?= $lang['more_than'] . " ". number_format($tc['big'], 0, '', ' '); ?></td>
<td style="width: 2%; background: <?= "#" . $tc['small_color']; ?>;"></td>
<td style="width: 10%;">&nbsp;<?= $lang['more_than'] . " " . number_format($tc['small'], 0, '', ' '); ?></td>
<td style="width: 2%; background-color: <?= "#" . $tc['medium_color']; ?>"></td>
<td style="width: 10%;">&nbsp;<?= $lang['more_than'] . " " . number_format($tc['medium'], 0, '', ' '); ?></td>
<td style="width: 2%; background-color: <?= "#" . $tc['big_color']; ?>"></td>
<td style="width: 10%;">&nbsp;<?= $lang['more_than'] . " " . number_format($tc['big'], 0, '', ' '); ?></td>
</tr>
</table>

</tbody>
</table>
45 changes: 23 additions & 22 deletions cdr_menu.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
<div class="ogspy-mod-header">
<h2><?php echo $lang['title']; ?></h2>
</div>

<?php
// Barre menu
// nouvelle barre menu
if (!isset($pub_subaction)) {
$subaction = "cdr";
$pub_subaction = "cdr";
} else $subaction = $pub_subaction;

if ($subaction != "cdr") {
$bouton1 = "\t\t\t<td class='c' style='text-align: center; width: 150pt' onclick=\"window.location = 'index.php?action=cdr&subaction=cdr';\">";
$bouton1 .= "<a style='cursor:pointer'><span style=\"color: lime; \">" . $lang['menu_cdr'] . "</span></a>";
$bouton1 .= "</td>";
} else {
$bouton1 = "\t\t\t<th width='150'>";
$bouton1 .= "<a>" . $lang['menu_cdr'] . "</a>";
$bouton1 .= "</th>";
}

if ($subaction != "option") {
$bouton2 = "\t\t\t<td class='c' style='text-align: center; width: 150pt' onclick=\"window.location = 'index.php?action=cdr&subaction=option';\">";
$bouton2 .= "<a style='cursor:pointer'><span style=\"color: lime; \">" . $lang['menu_option'] . "</span></a>";
$bouton2 .= "</td>";
} else {
$bouton2 = "\t\t\t<th style='width:150pt'>";
$bouton2 .= "<a>" . $lang['menu_option'] . "</a>";
$bouton2 .= "</th>";
}
echo "<br><br><table>\n";
echo $bouton1 . $bouton2;
echo "</table>\n";
//tag active
$activecdr = ($pub_subaction == "cdr") ? "active" : "";
$activeoption = ($pub_subaction == "option") ? "active" : "";

?>

<div class="nav-page-menu">
<div class="nav-page-menu-item <?php echo $activecdr; ?> ">
<a class="nav-page-menu-link" href="index.php?action=cdr&amp;subaction=cdr">
<?php echo $lang['menu_cdr']; ?>
</a>
</div>
<div class="nav-page-menu-item <?php echo $activeoption; ?> ">
<a class="nav-page-menu-link" href="index.php?action=cdr&amp;subaction=option">
<?php echo $lang['menu_option']; ?>
</a>
</div>
</div>
Loading

0 comments on commit 735c609

Please sign in to comment.