<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Please Wait..</title>
    </head>
    <body onload="document.frmPayment.submit();">
        <p align="center"><br>
                Please wait while you redirect to payment Gateway<br>
                    Do not Press back Button and reload this page..
                    </p>
                    <?php
                    if ($total_amount > 0) {
                        ?>
                        <div id="wrapper" style="visibility:hidden;">
                            <form name="frmPayment" method="post" id="frmPayment" action="https://www.paypal.com/cgi-bin/webscr">
                                <input type="hidden" name="cmd" id="cmd" value="_xclick" />
                                <input type="hidden" name="business" id="business" value="info@karachikitchen.com" />
                                <input type="hidden" name="item_name" id="item_name" value="Karachi Kitchen Order" />
                                <input type="hidden" name="item_number" id="item_number" value="<?= $this->session->userdata('order_id') ?>" />
                                <input type="hidden" name="amount" id="amount" value="<?= $total_amount; ?>" />
                                <input type="hidden" name="no_shipping" id="no_shipping" value="2" />
                                <input type="hidden" name="no_note" id="no_note" value="1" />
                                <input type="hidden" name="currency_code" id="currency_code" value="USD" />
                                <input type="hidden" name="bn" id="bn" value="IC_Sample" />
                                <input type="hidden" name="notify_url" id="notify_url" value="<?= site_url('order-status/?action=ipn') ?>" />        
                                <input type="hidden" name="return" id="return" value="<?= site_url('order-status/?orderStatus=0') ?>" />
                                <input type="hidden" name="success_return" id="success_return" value="<?= site_url('order-status/?orderStatus=0') ?>" />
                                <input type="hidden" name="cancel_return" id="cancel_return" value="<?= site_url('order-status/?orderStatus=1') ?>" />
                            </form>                                                    
                        </div>
                        <?php
                    } else {
                        redirect(site_url());
                        exit;
                    }
                    ?>
                    </body>
                    </html>