<?php
/**
 * Magento Order Info Section - Magento Module
 * This demonstrates how the Magento module can inject order information
 * Location: Header - Before NetSuite anchor point
 */

use yii\helpers\Html;
?>

<div class="alert alert-info border-left-info mb-3">
    <div class="row align-items-center">
        <div class="col-sm-8">
            <h6 class="mb-1">
                <i class="fas fa-shopping-cart mr-2"></i>
                Magento Order Information
            </h6>
            <p class="mb-0">
                <strong>Magento Order #:</strong> MAG-<?= sprintf("%06d", $model->id) ?>
                <span class="badge badge-success ml-2">Synced</span>
            </p>
            <small class="text-muted">
                Last sync: <?= date('Y-m-d H:i:s') ?> | 
                <a href="#" onclick="viewMagentoDetails(<?= $model->id ?>)">View Details</a>
            </small>
        </div>
        <div class="col-sm-4 text-right">
            <?= Html::button('Sync Now', [
                'class' => 'btn btn-sm btn-outline-primary',
                'onclick' => 'syncMagentoOrder(' . $model->id . ')'
            ]) ?>
        </div>
    </div>
</div>