示例#1
0
 function testDate()
 {
     $date = new DateTime();
     $date->setDate(2016, 31, 1);
     $ymd = $date->format('Y-m-d');
     $ymd = "2016-01-31";
     $prev_mon = date('Y-m-d', strtotime($ymd . " +1 month"));
     $prev_year = date('Y-m-d', strtotime($ymd . " +4 months"));
     echo "           " . $prev_mon . " " . $prev_year;
     $curMonth = 7;
     $curYear = 2016;
     if ($curMonth == 12) {
         $firstDayNextMonth = mktime(0, 0, 0, 0, 0, $curYear + 1);
     } else {
         $firstDayNextMonth = mktime(0, 0, 0, $curMonth + 1, 1);
     }
     pr(date("Y-m-d", $firstDayNextMonth));
     pr(getFirstDayOfNextMonth($curMonth, $curYear));
     pr(getFirstDayOfNext4Month($curMonth, $curYear));
     $app = new AppAccount();
     $app->getByID(19);
     $vpt = new VpTransaction();
     $vpt->getByID("14720056041915");
     $vpt->order_id = 1122;
     //        KomisiModel::log($app,$vpt);
     $nn = new AppFree();
     $nn->printColumlistAsAttributes();
 }
    function receipt()
    {
        $order_id = addslashes($_GET['order_id']);
        $order = new VpTransaction();
        $order->getByID($order_id);
        //        pr($order);
        //TODO : harus dibikin
        if ($order->order_acc_id != Account::getMyID() && !in_array("master_admin", Account::getMyRoles())) {
            die("hacking attempt");
        }
        $app = new AppAccount();
        $app->getByID($order->order_app_id);
        if ($app->app_active == 0) {
            die("App not active");
        }
        $acc = new Account();
        $acc->getByID($app->app_client_id);
        $paket = new Paket();
        $paket->getByID($order->order_paket_id);
        $vpData = new VpData();
        $arr = $vpData->getWhere("order_id = '{$order_id}' LIMIT 0,1");
        if (count($arr) > 0) {
            $data = $arr[0];
        } else {
            $data = new VpData();
        }
        if ($acc->admin_marketer != "") {
            $arrAg = $acc->getWhere("admin_username = '******' LIMIT 0,1");
            if (count($arrAg) > 0) {
                $agent = $arrAg[0];
            }
        }
        //        pr($arr);
        ?>
        <style>
            h1{
                font-size: 25px;
                padding-top: 30px;
            }
            h3{
                font-size: 20px;
                font-style: italic;
            }
            h4{
                font-size: 17px;
                margin-top: 20px;
                margin-bottom: 30px;
            }
            .billings td{
                padding-right: 20px;
                padding-bottom: 10px;
            }
            @media (max-width: 768px) {

                .monly {
                    display: initial;
                }

                .donly {
                    display: none;
                }

                h1{
                    font-size: 20px;
                }
                h3{
                    font-size: 17px;
                    font-style: italic;
                }
                h4{
                    font-size: 14px;
                    margin-bottom: 30px;
                }
                .billings td{
                    padding-bottom: 10px;
                }
            }

            @media (min-width: 768px) {
                .monly {
                    display: none;
                }

                .donly {
                    display: initial;
                }



            }
            @media print {
                .pure-toggle-label[data-toggle-label='left']{
                    display: none;
                }
                #printme{
                    display: none;
                }
                body{
                    background-color: #ffffff;
                }
            }
        </style>
        <div class="container attop"  >
                <div class="col-md-8 col-md-offset-2">


                    <div style="text-align: center; background-color: #ffffff; padding: 20px; min-height: 800px;  margin-top: 20px; padding-top: 20px; padding-bottom: 20px; ">
                        <img src="<?php 
        echo _SPPATH;
        ?>
images/header_appear.jpg" width="100%">

                        <h1>PAYMENT RECEIPT</h1>
                        <h3>Your payment has been completed successfully</h3>
                        <div class="receipt" style=" margin-top: 30px;">
                        <h4>TRANSACTION DETAILS</h4>
                        <table class="billings" align="center" style="text-align: left;">
                            <tr>
                                <td>ORDER ID</td>
                                <td><?php 
        echo $order_id;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>PAYMENT DATE / TIME</td>
                                <td><?php 
        echo date("F j, Y, g:i a", strtotime($order->order_date));
        ?>
</td>
                            </tr>
                            <tr>
                                <td>PACKAGE NAME</td>
                                <td><?php 
        echo $paket->paket_name;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>APP ID</td>
                                <td><?php 
        echo $app->app_id;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>ACCOUNT ID</td>
                                <td><?php 
        echo $acc->admin_nama_depan;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>AMOUNT</td>
                                <td>IDR <?php 
        echo idr($paket->paket_price);
        ?>
</td>
                            </tr>
                            <tr>
                                <td>STATUS</td>
                                <td><?php 
        echo $data->transaction_status;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>PAYMENT TYPE</td>
                                <td><?php 
        echo $data->payment_type;
        ?>
</td>
                            </tr>
                            <tr>
                                <td>BANK NAME</td>
                                <td><?php 
        echo $data->bank;
        ?>
</td>
                            </tr>
                            <?php 
        if (count($arrAg) > 0) {
            ?>
                            <tr>
                                <td>AGENT ID</td>
                                <td><?php 
            echo $agent->admin_username;
            ?>
</td>
                            </tr>
                            <?php 
        }
        ?>
                        </table>
                        </div>


                    </div>
                    <div id="printme" style="text-align: right; margin-top: 5px; margin-bottom: 100px;" >
                         <a href="#" onclick="window.print();"><i class="glyphicon glyphicon-print"></i> print</a> |
                        <a href="<?php 
        echo _SPPATH;
        ?>
myOrders">back to my transactions</a>
                    </div>
                </div>
            </div>
        <?php 
    }
示例#3
0
    function error()
    {
        $order_id = addslashes($_GET['order_id']);
        $status_code = addslashes($_GET['status_code']);
        $transaction_status = addslashes($_GET['transaction_status']);
        $vpt = new VpTransaction();
        $vpt->getByID($order_id);
        $app = new AppAccount();
        $app->getByID($vpt->order_app_id);
        AppAccount::checkOwnership($app);
        $vpt->order_status_from = $status_code;
        $vpt->save();
        ?>
        <div class="container attop"  >
            <div class="col-md-8 col-md-offset-2">

                <div style="text-align: center; padding: 20px;">
                    <a href="<?php 
        echo _SPPATH;
        ?>
">
                        <img src="<?php 
        echo _SPPATH;
        ?>
images/appear-icontext.png" style="max-width: 300px;">
                    </a>
                </div>
                <?php 
        ?>

                <h1>Error</h1>
                <p>Your Payment Error</p>

                <p>
                    Please <a href="<?php 
        echo _SPPATH;
        ?>
contact">contact us</a> for more details.
                </p>

                <a class="btn btn-default" href="<?php 
        echo _SPPATH;
        ?>
myApps">back to my Apps</a>
                <?php 
        ?>
            </div>
        </div>
        <?php 
        /*
        * Array
        (
            [url] => vp/error
            [order_id] => 70872981
            [status_code] => 202
            [transaction_status] => deny
        )
        */
    }