<?php
$userobj = new adminuser();
$adminUserId = $_SESSION['ADMINUSERID'] ?? null;
?>

<table border="0" align="center" cellpadding="0" cellspacing="0" width="900">
    <tr>
        <td height="25" colspan="3">

            <div style="width:18px; float:right; position:relative;">&nbsp;</div>

            <div style="width:86px; float:right; position:relative; text-align:center;">
                <a href="admin_quit.php"><img src="images/quit.jpg" width="84" height="25" border="0" /></a>
            </div>

            <!-- Program Status -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php if ($userobj->GetAdminUserLink('PGM Status', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=status">
                        <img src="<?php echo ($Act == "status" ? "images/pgmstatus-h.jpg" : "images/pgmstatus.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/pgmstatus.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

            <!-- Options -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php
                $optionsActs = [
                    "options", "payments", "setpayments", "terms", "bulkmail", "languages",
                    "currency", "ip_country", "ip_country_update", "event", "category",
                    "mailsettings", "email", "merchantevent", "fraudsettings",
                    "adminusers", "adminuser_privilege", "adminuser_edit"
                ];
                ?>
                <?php if ($userobj->GetAdminUserLink('Options', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=options">
                        <img src="<?php echo (in_array($Act, $optionsActs) ? "images/options-h.jpg" : "images/options.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/options.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

            <!-- Reports -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php
                $reportsActs = [
                    "daily", "forperiod", "transaction", "product_report", "link_report",
                    "referer_report", "recurring", "ViewRecurringDetails", "ViewTransactionDetails",
                    "graph_return", "graph_affiliate", "graph_distribution", "graph_bubble",
                    "AffiliateGroup"
                ];
                ?>
                <?php if ($userobj->GetAdminUserLink('Reports', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=reports">
                        <img src="<?php echo (in_array($Act, $reportsActs) ? "images/reports-h.jpg" : "images/reports.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/reports.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

            <!-- Payments -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php
                $paymentsActs = ["request", "mer_requests", "reverse_payments", "invoice", "view_transactions", "export_invoice"];
                ?>
                <?php if ($userobj->GetAdminUserLink('Payments', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=linkpayment">
                        <img src="<?php echo (in_array($Act, $paymentsActs) ? "images/payments-h.jpg" : "images/payments.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/payments.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

            <!-- Programs -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php
                $programsActs = ["programs", "products", "add_text", "add_text1", "add_html", "add_banner", "add_popup", "add_flash"];
                ?>
                <?php if ($userobj->GetAdminUserLink('Programs', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=programs&amp;status=all">
                        <img src="<?php echo (in_array($Act, $programsActs) ? "images/programs-h.jpg" : "images/programs.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/programs.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

            <!-- Affiliates -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php
                $affiliatesActs = ["affiliates", "payment_affiliate", "transaction_affiliate", "adjust_affiliate"];
                ?>
                <?php if ($userobj->GetAdminUserLink('Affiliates', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=affiliates&amp;status=all">
                        <img src="<?php echo (in_array($Act, $affiliatesActs) ? "images/affiliates-h.jpg" : "images/affiliates.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/affiliates.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

            <!-- Merchants -->
            <div style="width:86px; float:right; position:relative; text-align:center;">
                <?php
                $merchantsActs = ["merchants", "adjust_merchant", "payment_merchant", "transaction_merchant"];
                ?>
                <?php if ($userobj->GetAdminUserLink('Merchants', $adminUserId, 0)) { ?>
                    <a href="index.php?Act=merchants&amp;status=all">
                        <img src="<?php echo (in_array($Act, $merchantsActs) ? "images/merchants-h.jpg" : "images/merchants.jpg"); ?>" width="84" height="25" border="0" />
                    </a>
                <?php } else { ?>
                    <img src="images/merchants.jpg" width="84" height="25" border="0" />
                <?php } ?>
            </div>

        </td>
    </tr>
</table>
