<?php
/** PSI 报表中心首页 */
/** @var int $poCount @var int $soCount @var int $obCount */
$cards = [
    ['label' => '采购订单明细', 'desc' => '按采购订单查看物料/成品明细', 'url' => 'PSI/reports/poDetail', 'icon' => 'file-text', 'n' => $poCount],
    ['label' => '销售/采购订单明细', 'desc' => '合并查看两类订单与金额', 'url' => 'PSI/reports/soPo', 'icon' => 'clipboard', 'n' => $soCount + $poCount],
    ['label' => '交付明细', 'desc' => '出库交付进度与未交订单', 'url' => 'PSI/reports/delivery', 'icon' => 'truck', 'n' => $obCount],
];
?>
<div class="page-head">
    <div><h1>报表中心</h1><div class="desc">集中查看单据与单据之间的关联性</div></div>
</div>

<div class="stat-grid" style="grid-template-columns:repeat(auto-fill,minmax(280px,1fr))">
    <?php foreach ($cards as $c): ?>
    <a class="stat-card" href="<?php echo site_url($c['url']); ?>" style="text-decoration:none">
        <div class="stat-ic"><?php echo admin_icon($c['icon'], 22); ?></div>
        <div class="stat-main">
            <div class="stat-num"><?php echo admin_icon($c['icon'], 18) ? '' : ''; ?><?php echo e($c['label']); ?></div>
            <div class="stat-sub"><?php echo e($c['desc']); ?></div>
            <div class="muted" style="font-size:12px;margin-top:6px">相关单据 <?php echo $c['n']; ?> 条</div>
        </div>
    </a>
    <?php endforeach; ?>
</div>
