<?php
/* Smarty version 4.5.3, created on 2026-02-22 07:31:12
  from '/var/www/html/kaptembwa/system/plugin/ui/payment_transactions_details.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_699a8690098a24_20683456',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '27394355947be363566f06bca1e4d36d044b7014' => 
    array (
      0 => '/var/www/html/kaptembwa/system/plugin/ui/payment_transactions_details.tpl',
      1 => 1770490792,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_699a8690098a24_20683456 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/var/www/html/kaptembwa/system/vendor/smarty/smarty/libs/plugins/modifier.number_format.php','function'=>'smarty_modifier_number_format',),1=>array('file'=>'/var/www/html/kaptembwa/system/vendor/smarty/smarty/libs/plugins/modifier.date_format.php','function'=>'smarty_modifier_date_format',),));
$_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

<style>
    .detail-card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.06);
        margin-bottom: 20px;
        overflow: hidden;
    }
    
    .detail-card-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 15px 20px;
        border-bottom: none;
    }
    
    .detail-card-header h4 {
        color: white;
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }
    
    .detail-card-body {
        padding: 20px;
    }
    
    .page-header-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        overflow: hidden;
    }
    
    .page-header-card .panel-heading {
        background: transparent;
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .page-header-card .panel-heading h3 {
        color: white;
    }
    
    .page-header-card .panel-body {
        background: white;
    }
    
    .label-lg {
        font-size: 13px;
        padding: 6px 12px;
        border-radius: 6px;
    }
    
    .table > tbody > tr:hover {
        background-color: #f8fafc;
    }
    
    .btn {
        border-radius: 8px;
    }
    
    pre {
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        padding: 15px;
    }
    
    .table-striped > tbody > tr:nth-of-type(odd) {
        background-color: #f8fafc;
    }
    
    .table > thead > tr > th {
        border-bottom: 2px solid #e5e7eb;
        font-weight: 600;
    }
    
    .table > tbody > tr > th,
    .table > tbody > tr > td {
        border-top: 1px solid #e5e7eb;
    }
</style>

<div class="row">
    <div class="col-sm-12">
        <div class="page-header-card panel panel-hovered mb20">
            <div class="panel-heading">
                <div class="btn-group pull-right">
                    <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/payment_transactions" class="btn btn-default btn-sm" style="background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3);">
                        <i class="glyphicon glyphicon-arrow-left"></i> Back to List
                    </a>
                </div>
                <h3 class="panel-title">Transaction Details #<?php echo $_smarty_tpl->tpl_vars['transaction']->value['id'];?>
</h3>
            </div>
            <div class="panel-body">
                <?php if ((isset($_GET['s']))) {?>
                    <div class="alert alert-success alert-dismissible" style="border-radius: 8px; border-left: 4px solid #10b981;">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <?php echo $_GET['s'];?>

                    </div>
                <?php }?>
                <?php if ((isset($_GET['e']))) {?>
                    <div class="alert alert-danger alert-dismissible" style="border-radius: 8px; border-left: 4px solid #ef4444;">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <?php echo $_GET['e'];?>

                    </div>
                <?php }?>

                <div class="row">
                    <!-- Transaction Information -->
                    <div class="col-md-6">
                        <div class="detail-card">
                            <div class="detail-card-header">
                                <h4 class="panel-title"><i class="ion ion-card"></i> Transaction Information</h4>
                            </div>
                            <div class="detail-card-body">
                                <table class="table table-striped">
                                    <tr>
                                        <th width="40%">Transaction ID:</th>
                                        <td><strong>#<?php echo $_smarty_tpl->tpl_vars['transaction']->value['id'];?>
</strong></td>
                                    </tr>
                                    <tr>
                                        <th>Gateway Transaction ID:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['gateway_trx_id']) {?>
                                                <code><?php echo $_smarty_tpl->tpl_vars['transaction']->value['gateway_trx_id'];?>
</code>
                                            <?php } else { ?>
                                                <span class="text-muted">Not available</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Invoice Number:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['trx_invoice']) {?>
                                                <code><?php echo $_smarty_tpl->tpl_vars['transaction']->value['trx_invoice'];?>
</code>
                                            <?php } else { ?>
                                                <span class="text-muted">Not generated</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Status:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['status'] == 1) {?>
                                                <span class="label label-warning label-lg">Unpaid</span>
                                            <?php } elseif ($_smarty_tpl->tpl_vars['transaction']->value['status'] == 2) {?>
                                                <span class="label label-success label-lg">Paid</span>
                                            <?php } elseif ($_smarty_tpl->tpl_vars['transaction']->value['status'] == 3) {?>
                                                <span class="label label-danger label-lg">Failed</span>
                                            <?php } elseif ($_smarty_tpl->tpl_vars['transaction']->value['status'] == 4) {?>
                                                <span class="label label-default label-lg">Canceled</span>
                                            <?php } else { ?>
                                                <span class="label label-info label-lg">Unknown</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Amount:</th>
                                        <td><h4 class="text-success"><?php echo $_smarty_tpl->tpl_vars['_c']->value['currency_code'];?>
 <?php echo smarty_modifier_number_format($_smarty_tpl->tpl_vars['transaction']->value['price'],2);?>
</h4></td>
                                    </tr>
                                    <tr>
                                        <th>Gateway:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['gateway']) {?>
                                                <span class="label label-info"><?php echo $_smarty_tpl->tpl_vars['transaction']->value['gateway'];?>
</span>
                                            <?php } else { ?>
                                                <span class="text-muted">N/A</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Payment Method:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['payment_method']) {?>
                                                <?php echo $_smarty_tpl->tpl_vars['transaction']->value['payment_method'];?>

                                            <?php } else { ?>
                                                <span class="text-muted">N/A</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Payment Channel:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['payment_channel']) {?>
                                                <?php echo $_smarty_tpl->tpl_vars['transaction']->value['payment_channel'];?>

                                            <?php } else { ?>
                                                <span class="text-muted">N/A</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>

                    <!-- Customer Information -->
                    <div class="col-md-6">
                        <div class="detail-card">
                            <div class="detail-card-header">
                                <h4 class="panel-title"><i class="ion ion-person"></i> Customer Information</h4>
                            </div>
                            <div class="detail-card-body">
                                <?php if ($_smarty_tpl->tpl_vars['customer']->value) {?>
                                    <table class="table table-striped">
                                        <tr>
                                            <th width="40%">Customer ID:</th>
                                            <td>#<?php echo $_smarty_tpl->tpl_vars['customer']->value['id'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Username:</th>
                                            <td>
                                                <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
customers/view/<?php echo $_smarty_tpl->tpl_vars['customer']->value['id'];?>
">
                                                    <strong><?php echo $_smarty_tpl->tpl_vars['customer']->value['username'];?>
</strong>
                                                </a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>Full Name:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['customer']->value['fullname'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Email:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['customer']->value['email'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Phone Number:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['customer']->value['phonenumber'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Account Type:</th>
                                            <td><?php echo (($tmp = $_smarty_tpl->tpl_vars['customer']->value['account_type'] ?? null)===null||$tmp==='' ? 'N/A' ?? null : $tmp);?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Balance:</th>
                                            <td><strong><?php echo $_smarty_tpl->tpl_vars['_c']->value['currency_code'];?>
 <?php echo smarty_modifier_number_format($_smarty_tpl->tpl_vars['customer']->value['balance'],2);?>
</strong></td>
                                        </tr>
                                        <tr>
                                            <th>Status:</th>
                                            <td>
                                                <?php if ($_smarty_tpl->tpl_vars['customer']->value['status'] == 'Active') {?>
                                                    <span class="label label-success"><?php echo $_smarty_tpl->tpl_vars['customer']->value['status'];?>
</span>
                                                <?php } else { ?>
                                                    <span class="label label-warning"><?php echo $_smarty_tpl->tpl_vars['customer']->value['status'];?>
</span>
                                                <?php }?>
                                            </td>
                                        </tr>
                                    </table>
                                <?php } else { ?>
                                    <div class="alert alert-warning" style="border-radius: 8px; border-left: 4px solid #f59e0b;">
                                        <i class="fa fa-exclamation-triangle"></i> Customer information not available
                                    </div>
                                <?php }?>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <!-- Plan & Router Information -->
                    <div class="col-md-6">
                        <div class="detail-card">
                            <div class="detail-card-header">
                                <h4 class="panel-title"><i class="ion ion-wifi"></i> Plan & Router Information</h4>
                            </div>
                            <div class="detail-card-body">
                                <table class="table table-striped">
                                    <tr>
                                        <th width="40%">Plan Name:</th>
                                        <td><strong><?php echo $_smarty_tpl->tpl_vars['transaction']->value['plan_name'];?>
</strong></td>
                                    </tr>
                                    <tr>
                                        <th>Plan ID:</th>
                                        <td>#<?php echo $_smarty_tpl->tpl_vars['transaction']->value['plan_id'];?>
</td>
                                    </tr>
                                    <?php if ($_smarty_tpl->tpl_vars['plan']->value) {?>
                                        <tr>
                                            <th>Plan Type:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['plan']->value['type'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Validity:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['plan']->value['validity'];?>
 <?php echo $_smarty_tpl->tpl_vars['plan']->value['validity_unit'];?>
</td>
                                        </tr>
                                    <?php }?>
                                    <tr>
                                        <th>Router Name:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['routers']) {?>
                                                <?php echo $_smarty_tpl->tpl_vars['transaction']->value['routers'];?>

                                            <?php } else { ?>
                                                <span class="text-muted">N/A</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Router ID:</th>
                                        <td>#<?php echo $_smarty_tpl->tpl_vars['transaction']->value['routers_id'];?>
</td>
                                    </tr>
                                    <?php if ($_smarty_tpl->tpl_vars['router']->value) {?>
                                        <tr>
                                            <th>Router IP:</th>
                                            <td><code><?php echo $_smarty_tpl->tpl_vars['router']->value['ip_address'];?>
</code></td>
                                        </tr>
                                        <tr>
                                            <th>Router Type:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['router']->value['type'];?>
</td>
                                        </tr>
                                    <?php }?>
                                </table>
                            </div>
                        </div>
                    </div>

                    <!-- Date & Time Information -->
                    <div class="col-md-6">
                        <div class="detail-card">
                            <div class="detail-card-header">
                                <h4 class="panel-title"><i class="ion ion-clock"></i> Date & Time Information</h4>
                            </div>
                            <div class="detail-card-body">
                                <table class="table table-striped">
                                    <tr>
                                        <th width="40%">Created Date:</th>
                                        <td>
                                            <i class="glyphicon glyphicon-calendar"></i> 
                                            <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['transaction']->value['created_date'],"%B %d, %Y");?>

                                            <br>
                                            <i class="glyphicon glyphicon-time"></i> 
                                            <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['transaction']->value['created_date'],"%H:%M:%S");?>

                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Expired Date:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['expired_date']) {?>
                                                <i class="glyphicon glyphicon-calendar"></i> 
                                                <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['transaction']->value['expired_date'],"%B %d, %Y");?>

                                                <br>
                                                <i class="glyphicon glyphicon-time"></i> 
                                                <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['transaction']->value['expired_date'],"%H:%M:%S");?>

                                                <?php if (strtotime($_smarty_tpl->tpl_vars['transaction']->value['expired_date']) < time() && $_smarty_tpl->tpl_vars['transaction']->value['status'] == 1) {?>
                                                    <br><span class="label label-danger">Expired</span>
                                                <?php }?>
                                            <?php } else { ?>
                                                <span class="text-muted">Not set</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Paid Date:</th>
                                        <td>
                                            <?php if ($_smarty_tpl->tpl_vars['transaction']->value['paid_date']) {?>
                                                <i class="glyphicon glyphicon-calendar"></i> 
                                                <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['transaction']->value['paid_date'],"%B %d, %Y");?>

                                                <br>
                                                <i class="glyphicon glyphicon-time"></i> 
                                                <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['transaction']->value['paid_date'],"%H:%M:%S");?>

                                            <?php } else { ?>
                                                <span class="text-muted">Not paid yet</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Payment Gateway Request/Response -->
                <div class="row">
                    <?php if ($_smarty_tpl->tpl_vars['transaction']->value['pg_request']) {?>
                        <div class="col-md-6">
                            <div class="detail-card">
                                <div class="detail-card-header">
                                    <h4 class="panel-title"><i class="fa fa-arrow-circle-up"></i> Payment Gateway Request</h4>
                                </div>
                                <div class="detail-card-body">
                                    <pre style="max-height: 300px; overflow-y: auto;"><?php echo $_smarty_tpl->tpl_vars['transaction']->value['pg_request'];?>
</pre>
                                </div>
                            </div>
                        </div>
                    <?php }?>

                    <?php if ($_smarty_tpl->tpl_vars['transaction']->value['pg_paid_response']) {?>
                        <div class="col-md-6">
                            <div class="detail-card">
                                <div class="detail-card-header">
                                    <h4 class="panel-title"><i class="fa fa-arrow-circle-down"></i> Payment Gateway Response</h4>
                                </div>
                                <div class="detail-card-body">
                                    <pre style="max-height: 300px; overflow-y: auto;"><?php echo $_smarty_tpl->tpl_vars['transaction']->value['pg_paid_response'];?>
</pre>
                                </div>
                            </div>
                        </div>
                    <?php }?>
                </div>

                <!-- Payment URL -->
                <?php if ($_smarty_tpl->tpl_vars['transaction']->value['pg_url_payment'] && $_smarty_tpl->tpl_vars['transaction']->value['status'] == 1) {?>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="detail-card" style="border-left: 4px solid #3b82f6;">
                                <div class="detail-card-header" style="background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);">
                                    <h4 class="panel-title"><i class="fa fa-link"></i> Payment URL</h4>
                                </div>
                                <div class="detail-card-body">
                                    <div class="input-group">
                                        <input type="text" class="form-control" value="<?php echo $_smarty_tpl->tpl_vars['transaction']->value['pg_url_payment'];?>
" readonly id="payment-url" style="border-radius: 8px 0 0 8px;">
                                        <span class="input-group-btn">
                                            <button class="btn btn-primary" type="button" onclick="copyPaymentUrl()" style="border-radius: 0;">
                                                <i class="fa fa-copy"></i> Copy
                                            </button>
                                            <a href="<?php echo $_smarty_tpl->tpl_vars['transaction']->value['pg_url_payment'];?>
" class="btn btn-success" target="_blank" style="border-radius: 0 8px 8px 0;">
                                                <i class="fa fa-external-link"></i> Open
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php }?>

                <!-- Related Invoice -->
                <?php if ($_smarty_tpl->tpl_vars['invoice']->value) {?>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="detail-card" style="border-left: 4px solid #10b981;">
                                <div class="detail-card-header" style="background: linear-gradient(135deg, #10b981 0%, #059669 100%);">
                                    <h4 class="panel-title"><i class="fa fa-file-text"></i> Related Invoice</h4>
                                </div>
                                <div class="detail-card-body">
                                    <table class="table table-striped">
                                        <tr>
                                            <th width="20%">Invoice Number:</th>
                                            <td><strong><?php echo $_smarty_tpl->tpl_vars['invoice']->value['invoice'];?>
</strong></td>
                                        </tr>
                                        <tr>
                                            <th>Type:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['invoice']->value['type'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Method:</th>
                                            <td><?php echo $_smarty_tpl->tpl_vars['invoice']->value['method'];?>
</td>
                                        </tr>
                                        <tr>
                                            <th>Date:</th>
                                            <td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['invoice']->value['recharged_on'],"%B %d, %Y %H:%M:%S");?>
</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php }?>

            </div>
        </div>
    </div>
</div>

<?php $_smarty_tpl->_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>


<?php echo '<script'; ?>
>
function copyPaymentUrl() {
    var copyText = document.getElementById("payment-url");
    copyText.select();
    copyText.setSelectionRange(0, 99999);
    document.execCommand("copy");
    alert("Payment URL copied to clipboard!");
}
<?php echo '</script'; ?>
>

<?php }
}
