<?php
#################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 ##
## --------------------------------------------------------------------------- ##
##  Filename       : delAli.tpl 		                                       ##
##  Type           : Admin Panel Frontend                                      ##
## --------------------------------------------------------------------------- ##
##  Developed by   : Dzoki (Original)                                          ##
##  Refactored by  : Shadow                                                    ##
##  Redesign by    : Shadow                                                    ##
## --------------------------------------------------------------------------- ##
##  Contact        : cata7007@gmail.com                                        ##
##  Project        : TravianZ                                                  ##
##  GitHub         : https://github.com/Shadowss/TravianZ                      ##
## --------------------------------------------------------------------------- ##
##  License        : TravianZ Project                                          ##
##  Copyright      : TravianZ (c) 2010-2025. All rights reserved.              ##
## --------------------------------------------------------------------------- ##
#################################################################################
$aid = (int)$_GET['aid'];
$alidata = $database->getAlliance($aid);
if(!$alidata){ echo "<div class='card'><div class='body'>Alliance not found</div></div>"; return; }
$members = $database->getAllMember($aid);
?>
<style>
.del-wrap{max-width:600px;margin:30px auto;font-family:Verdana;}
.del-card{background:#fff;border:1px solid #c00;border-radius:5px;overflow:hidden;}
.del-card h3{margin:0;padding:10px 14px;background:#ffe5e5;color:#900;border-bottom:1px solid #c00;font-size:14px;}
.del-card.body{padding:16px;font-size:13px;line-height:1.5;}
.del-card.warn{background:#fff3cd;border:1px solid #ffc107;padding:8px;margin:10px 0;border-radius:3px;color:#664d03;}
.btn{padding:8px 14px;border-radius:3px;text-decoration:none;font-size:13px;border:1px solid #bbb;display:inline-block;}
.btn.del{background:#c00;color:#fff;border-color:#900;}
.btn.cancel{background:#f5f5f5;color:#333;margin-left:8px;}
</style>

<div class="del-wrap">
<div class="del-card">
    <h3><?php echo ADM_DELETE_ALLIANCE; ?></h3>
    <div class="body">
        <p><?php echo ADM_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE; ?></p>
        <p style="font-size:16px;margin:10px 0;"><b>[<?php echo htmlspecialchars($alidata['tag']);?>] <?php echo htmlspecialchars($alidata['name']);?></b></p>
        <p><?php echo ADM_MEMBERS_2; ?><b><?php echo count($members);?></b><?php echo ADM_POINTS_3; ?><b><?php echo number_format($database->getVSumField(array_column($members,'id'),'pop')[0]['Total']?? 0);?></b></p>

        <div class="warn"><?php echo ADM_ALL_MEMBERS_WILL_BE_REMOVED_FROM_THE_ALLIANC; ?></div>

        <form method="POST" action="../GameEngine/Admin/Mods/delAli.php" onsubmit="return confirm('Last warning: DELETE PERMANENTLY?');">
            <?php echo csrf_field(); ?>
            <input type="hidden" name="aid" value="<?php echo $aid;?>">
            <input type="hidden" name="admid" value="<?php echo $_SESSION['id'];?>">
            <button type="submit" class="btn del"><?php echo ADM_YES_DELETE; ?></button>
            <a href="admin.php?p=alliance&aid=<?php echo $aid;?>" class="btn cancel"><?php echo ADM_CANCEL; ?></a>
        </form>
    </div>
</div>
</div>