function extend()
    {
        $id = addslashes($_GET['app_id']);
        $acc = new App2Acc();
        $apps = $acc->getWhereFromMultipleTable("ac_admin_id = '" . Account::getMyID() . "' AND ac_app_id = app_id AND ac_app_id = '{$id}' ", array("AppAccount"));
        if (count($apps) < 1) {
            die("hacking attempt");
        } else {
            $app = $apps[0];
        }
        if ($app->app_active < 1) {
            header("Location:" . _SPPATH . "myapps");
            die;
        }
        if ($app->app_paket_id < 2) {
            die("Paket bukan paket PAID");
        }
        $prevPaket = new Paket();
        $prevPaket->getByID($app->app_paket_id);
        AppAccount::checkOwnership($app);
        $paket = new Paket();
        $arrPaket = $paket->getWhere("paket_active = 1 AND paket_id > 1 ORDER BY paket_id ASC");
        $paket2 = new Paket();
        $paket2->getByID(2);
        $paket1 = new Paket();
        $paket1->getByID(3);
        $next = 3;
        ?>
        <div class="container attop" style="text-align: center;" >
        <div class="col-md-8 col-md-offset-2">
    <div class="appear_logo_pages">
        <a href="<?php 
        echo _SPPATH;
        ?>
">
            <img src="<?php 
        echo _SPPATH;
        ?>
images/appear-payment.png" >
        </a>
    </div>

        <div class="app" style="background-color: #dedede;">
            <div style="background-color: #cccccc; padding: 5px; text-align: center; font-size: 15px;">
                Previous Package : <?php 
        echo $prevPaket->paket_name;
        ?>
<br>
                Contract End : <?php 
        echo date("d-m-Y", strtotime($app->app_contract_end));
        ?>
 in <?php 
        echo dateDifference(date("Y-m-d", strtotime($app->app_contract_end)), date("Y-m-d"));
        ?>
 days
            </div>

            <div style="background-color: #f6f6f6; padding: 5px; text-align: center; font-size: 20px;">Payment For</div>
            <div class="col-md-3 " style="text-align: center; min-height: 270px;  padding: 10px; background-color: #FFFFFF;">
                <b >App Details</b><br><br>
                <img src="<?php 
        echo $app->app_icon;
        ?>
" width="80%"><br>
                <?php 
        echo $app->app_name;
        ?>
            </div>
            <div class="col-md-9 " style="text-align: center; padding: 10px;background-color: #dedede;">
                <div style="padding-bottom: 20px; font-weight: bold;">Package Details</div>
                <div class="clearfix"></div>
                <?php 
        if ($app->app_paket_id != 5) {
            ?>
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <img style="cursor: pointer;" id="paket1" onclick="setPaket(1);" src="<?php 
            echo _SPPATH;
            ?>
images/paket-android-ios.png" width="100%">
                    <small>what you get</small>
                </div>
                <?php 
        } else {
            $paket1 = new Paket();
            $paket1->getByID(5);
            $next = 5;
            ?>
                    <div class="col-md-6 col-sm-6 col-xs-6">
                        <img style="cursor: pointer;" id="paket1" onclick="setPaket(1);" src="<?php 
            echo _SPPATH;
            ?>
images/paket-android-ios.png" width="100%">
                        <small>what you get</small>
                    </div>
                <?php 
        }
        ?>
                <?php 
        if ($app->app_paket_id == 2) {
            ?>
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <img style="cursor: pointer;" id="paket2" onclick="setPaket(2);" src="<?php 
            echo _SPPATH;
            ?>
images/paket-android-2.png"  width="100%">
                    <small>what you get</small>
                </div>
                <?php 
        }
        ?>

                <div class="clearfix"></div>
                <script>
                    var paket_selected = 3;
                    function setPaket(x){
                        if(x == 1){
                            $('#paket2').attr("src","<?php 
        echo _SPPATH;
        ?>
images/paket-android-2.png");
                            $('#paket1').attr("src","<?php 
        echo _SPPATH;
        ?>
images/paket-android-ios.png");
                            $('#paketprice').html("IDR <?php 
        echo idr($paket1->paket_price);
        ?>
 / year");
                            paket_selected = 3;
                            $('#paybuttonpaket3').show();
                            $('#paybuttonpaket2').hide();
                        }else{
                            $('#paket2').attr("src","<?php 
        echo _SPPATH;
        ?>
images/paket-android.png");
                            $('#paket1').attr("src","<?php 
        echo _SPPATH;
        ?>
images/paket-android-ios-2.png");
                            $('#paketprice').html("IDR <?php 
        echo idr($paket2->paket_price);
        ?>
 / year");
                            paket_selected = 2;
                            $('#paybuttonpaket2').show();
                            $('#paybuttonpaket3').hide();
                        }
                    }
                </script>
            </div>
            <div class="clearfix"></div>
            <div id="paketprice" style="background-color: #f6f6f6; padding: 5px; text-align: center; font-size: 30px;">IDR <?php 
        echo idr($paket1->paket_price);
        ?>
 / year</div>
            <div style="background-color: #cccccc; padding: 5px; text-align: center; font-size: 15px;">

                This will renew the contract until <?php 
        echo date("d-m-Y", strtotime($app->app_contract_end . " + 1 year"));
        ?>
            </div>
        </div>

        <div style="padding: 20px;">
            <a id="paybuttonpaket3" href="<?php 
        echo _SPPATH;
        ?>
Vp/pay?app_id=<?php 
        echo $app->app_id;
        ?>
&paket=<?php 
        echo $next;
        ?>
" class="btn btn-danger btn-lg">PAY NOW USING VERITRANS</a>
            <a id="paybuttonpaket2" style="display: none;" href="<?php 
        echo _SPPATH;
        ?>
Vp/pay?app_id=<?php 
        echo $app->app_id;
        ?>
&paket=2" class="btn btn-danger btn-lg">PAY NOW USING VERITRANS</a>

            <!--            <a href="--><?php 
        //=_SPPATH;
        ?>
<!--VeritransPay/pay?app_id=--><?php 
        //=$app->app_id;
        ?>
<!--" class="btn btn-danger btn-lg">PAY NOW USING VERITRANS</a>-->
        </div>


        <hr>
        <div style="text-align: center; margin-bottom: 100px;">
            <a href="<?php 
        echo _SPPATH;
        ?>
myapps">I will finish the payment later. Go back to My Apps.</a>
        </div>


    <?php 
    }
示例#2
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
        )
        */
    }
示例#3
0
    function preview()
    {
        $id = addslashes($_GET['id']);
        $app = new AppAccount();
        $app->getByID($id);
        AppAccount::checkOwnership($app);
        //        pr($app);
        ?>

        <div class="container attop"  >
            <div class="col-md-8 col-md-offset-2">
                <div class="appear_logo_pages">
                    <a href="<?php 
        echo _SPPATH;
        ?>
">
                        <img src="<?php 
        echo _SPPATH;
        ?>
images/appear-capsule.png" >
                    </a>
                </div>


                <div style="text-align: center; padding-top: 20px;">
                <p>You can preview your App by installing our Appear Capsule App</p>


                    <div class="strike">
                        <span>1.Download Appear Capsule App</span>
                    </div>
                    <div class="steps">

                        <img src="<?php 
        echo _SPPATH;
        ?>
images/gplay.png" width="150px">
                        <img src="<?php 
        echo _SPPATH;
        ?>
images/appstore.png" width="150px">

                    </div>

                    <div class="strike">
                        <span>2.Login with your Appear Credentials</span>
                    </div>

                    <div class="steps">

                        Screen shots

                    </div>

                    <div class="strike">
                        <span>3.Select the App</span>
                    </div>
                    <div class="steps">

                        Screen shots

                    </div>

<!--                <div style="float: left;">-->
<!--                    <div class="app" style="text-align: center;width: 100px;">-->
<!--                    <img src="--><?php 
        //=$app->app_icon;
        ?>
<!--" width="50px"><br>-->
<!--                    --><?php 
        //=$app->app_name;
        ?>
<!--                    </div>-->
<!--                </div>-->

                    <?php 
        if ($app->app_active < 1) {
            ?>
                        <div class="strike">
                            <span>4.Activate the App</span>
                        </div>
                        <div class="steps">

                            Your App has not been activated.
                            <br>That means you'll missed all the business opportunities through Google play and App Store Listing.

                            <br><br>
                            <a href="<?php 
            echo _SPPATH;
            ?>
PaymentWeb/pay?app_id=<?php 
            echo $id;
            ?>
">
                                <img src="<?php 
            echo _SPPATH;
            ?>
images/appear-active.png" width="250px">
                                </a>

                        </div>
                        <?php 
        }
        ?>
                    <br>
                <h5><a href="<?php 
        echo _SPPATH;
        ?>
myapps">back to my apps</a> </h5>
                    <br><br>

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

        <?php 
    }
 public static function processFree()
 {
     $json = array();
     $json['err'] = "";
     $json['bool'] = 0;
     $rand = $_SESSION['rand'];
     $token = $_POST['token'];
     if ($rand != $token) {
         $json['err'] .= "Wrong Token<br>";
     }
     $id = addslashes($_POST['app_id']);
     $app = new AppAccount();
     $app->getByID($id);
     AppAccount::checkOwnership($app);
     if ($app->app_active) {
         $json['err'] .= "App already active<br>";
     }
     //        reason += validateEmpty(theForm.tos);
     //
     //        reason += validateEmpty(theForm.org_name);
     //        reason += validateEmpty(theForm.org_type);
     //
     //        reason += validateEmpty(theForm.org_doc);
     //        reason += validateEmpty(theForm.org_addresss);
     //        reason += validateEmpty(theForm.contact_name);
     //        reason += validateEmpty(theForm.contact_phone);
     //        reason += validateEmpty(theForm.contact_email);
     //check username
     $tos = addslashes($_POST['tos']);
     if ($tos == "") {
         $json['err'] .= "Please accept Terms of Service<br>";
     }
     //check username
     $org_name = addslashes($_POST['org_name']);
     if ($org_name == "") {
         $json['err'] .= "Organization Name cannot be empty<br>";
     }
     //check username
     $org_type = addslashes($_POST['org_type']);
     if ($org_type == "") {
         $json['err'] .= "Organization Type cannot be empty<br>";
     }
     //check username
     $org_doc = addslashes($_POST['org_doc']);
     if ($org_doc == "") {
         $json['err'] .= "Documents cannot be empty<br>";
     }
     //check username
     $org_addresss = addslashes($_POST['org_addresss']);
     if ($org_addresss == "") {
         $json['err'] .= "Adress cannot be empty<br>";
     }
     //check username
     $contact_name = addslashes($_POST['contact_name']);
     if ($contact_name == "") {
         $json['err'] .= "Contact cannot be empty<br>";
     }
     //check username
     $contact_phone = addslashes($_POST['contact_phone']);
     if ($contact_phone == "") {
         $json['err'] .= "Phone cannot be empty<br>";
     }
     //check username
     $contact_email = addslashes($_POST['contact_email']);
     if ($contact_email == "") {
         $json['err'] .= "Email cannot be empty<br>";
     }
     if ($json['err'] == "") {
         $app->app_type = 1;
         $app->app_paket_id = 1;
         //FREE
         $app->app_active = 1;
         $succ = $app->save();
         //TODO hahah
         if ($succ) {
             $free = new AppFree();
             $free->free_app_id = $app->app_id;
             $free->free_address = $org_addresss;
             $free->free_contact_email = $contact_email;
             $free->free_org_name = $org_name;
             $free->free_org_docs = $org_doc;
             $free->free_org_type = $org_type;
             $free->free_contact_name = $contact_name;
             $free->free_contact_phone = $contact_phone;
             $free->free_date = leap_mysqldate();
             $free->save(1);
         }
         $json['bool'] = $succ;
     }
     //        $json['post'] = $_POST;
     echo json_encode($json);
     die;
 }