<script type="text/javascript" src="<?= base_url('js/jquery-1.11.js') ?>" ></script>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <div class="row">
        <div class="col-sm-10">
            <?php
            $tc = 300;
            foreach($profile as $pro){}
            foreach ($trans as $row) {
                
            }
            ?>
            <?php
            $DevID = "UPPER-DES34K56L";
            $MerchantID = '9';
            $MerchantCode = 'NSE';
            $transNo = $row['transNo'];
            $salt = "$DevID|$MerchantID|$MerchantCode|$transNo";
            $MAC = hash('sha512', $salt);
            $totalAmount=$row['transAmount']+300;
            $amount=$row['transAmount'];
            $valid_user=$_SESSION['id'];
            $surname=$pro['lastname'];
            $firstname=$pro['firstname'];
            $othernames=$pro['othernames'];
            $email=$pro['emailAddress'];
            $date=date('Y-m-d');
                   
            $xml_string = <<<XML
<?xml version="1.0"  encoding="UTF-8"?>
<BranchCollectRequest>
    <MerchantDetails>
        <Merchant DevID="$DevID" MerchantID="$MerchantID" MerchantCode="$MerchantCode" />
    </MerchantDetails>

    <TransactionDetails>
        <Transaction TransactionID="$transNo" MAC="$MAC" TotalAmount="$total_amount" CustomerID="$valid_user" CustomerSurname="$surname" CustomerFirstname="$firstname" CustomerOthernames="$othernames"  CustomerEmail="$email"  CustomerGSM="2348032518766" UpdateURL="http://www.nse.org.ng/updatepay.php" UpdateURLThirdParty="http://www.nse.org.ng/updatePay3rd.php" />
    </TransactionDetails>

    <ItemDetails ItemDescription="Total" InstallmentID="675178" Split="false" ItemCode="NSE01" ExpiryDate="2025-10-22 03:00:25">
        <Item ItemName="Dues." ItemAmount="$amount" />
        <Item ItemName="Transaction Cost" ItemAmount="300.0000" />
    </ItemDetails>

    <CustomFieldDetails>
        <CustomField CustomFieldLabel="Bill Generated By" CustomFieldValue="Abuja" />
        <CustomField CustomFieldLabel="Bill Generated On" CustomFieldValue="$date" />
    </CustomFieldDetails>

    <CollectionBankDetails>
        <CollectionBank CBankID="8" />
    </CollectionBankDetails>

    <BankAccounts>
        <BankDetails BankID="8">
            
            
            <AccountDetails AccountID="408" AccountName="Nigerian Society Of Engineers" AccountNo="3552108250" SplitAmount="$amount" />
            <AccountDetails AccountID="409" AccountName="Upperlink Limited" AccountNo="0992000267" SplitAmount="200.0000" />
            <AccountDetails AccountID="410" AccountName="Ecobank Nigeria Income Account" AccountNo="ECO0000000" SplitAmount="100.0000" />
        </BankDetails>
    </BankAccounts>

</BranchCollectRequest>
XML;
            ?>

            <table border="1" width="100%" cellpadding="5" cellspacing="0" class="table stripped">
                <tr><td>Amount</td><td>N<?php echo number_format($row['transAmount'], 2); ?></td></tr>
                <tr><td>Transaction Charge</td><td><?= number_format($tc, 2); ?></td></tr>
                <tr><td><strong>Total Amount</strong></td><td><?php echo number_format($row['transAmount'] + $tc, 2); ?></td></tr>
                <tr><td><img src="http://www.nse.org.ng/payment/images/quickteller.jpg" /></td><td>
                        <form action="http://www.paychoice.com.ng/nse-pay-75839/nse-pay-jhuhia46dtcniz8k.php" method="post" target="_new">      
                            <input type="hidden" value="<?= htmlentities($xml_string) ?>" name="xml_string" />
                            <input type="hidden" value="<?= $row['transAmount']; ?>" name="amount" />
                            <input type="submit" name="submit" value="Pay via Paychoice Quickteller" />
                        </form>
                    </td></tr>
            </table>
        </div>

    </div>
</div>
