Вход Регистрация
Файл: RootPanel 1.7.0 FreeCode/RootPanel 1.7.0 FreeCode/_rootbill/_pay.inc.php
Строк: 3212
<?
        $r
=@mysql_query("select * from bills where id='$id' and uid='".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

        if (
mysql_num_rows($r) > 0) {
                
$r=mysql_fetch_object($r);
                
$sid=sprintf("%04d"$r->id);
                   
$money=$r->money_host+$r->money_domain+$r->money_addons+$r->money+$r->money_shop;

        if (
$sub == "kvitanciya" and $kvid) {
            print 
createKvitanciya($kvid$id0);

            
mclose();
            exit;

        }
        else if (
$sub == "kvitanciyapdf" and $kvid) {
            
createKvitanciya($kvid$id1);

            
mclose();
            exit;
        }
        else if (
$sub == "faktura" and $fid) {

            
$profile GetUserProfileByUserId($_SESSION["userId"]);
            if (
$profile->org == "3" and $profile->firma and $profile->phone) {
                print 
createFaktura($fid$id0);
            } else if ((
$profile->org == "2" or $profile->org == "1") and $profile->name and $profile->surname and $profile->phone) {
                print 
createFaktura($fid$id0);
            } else if (
$profile->org == "3") {
                
error($_lang[PayErrorNoOrgOrPhoneInProfile]);
            } else if (
$profile->org == "2" or $profile->org == "1") {
                
error($_lang[PayErrorNoNameOrPhoneInProfile]);
            }
            
mclose();
            exit;
        }
        else if (
$sub == "fakturapdf" and $fid) {
            
$profile GetUserProfileByUserId($_SESSION["userId"]);

            if (
$profile->org == "3" and $profile->firma and $profile->phone) {
                
createFaktura($fid$id1);
            } else if ((
$profile->org == "2" or $profile->org == "1") and $profile->name and $profile->surname and $profile->phone) {
                
createFaktura($fid$id1);
            } else if (
$profile->org == "3") {
                
error($_lang[PayErrorNoOrgOrPhoneInProfile]);
            } else if (
$profile->org == "2" or $profile->org == "1") {
                
error($_lang[PayErrorNoNameOrPhoneInProfile]);
            }
            
mclose();
            exit;
        }


                
_head('utf-8',$_lang[PayTitle]);

        print 
"<center><H1 class=pagetitle>".$_lang[PayTitle].$sid</H1><br>";

        if (
$r->status) {print "Счет уже оплачен.<br><br>";}
        else if (
$money == 0) {
            if (
$r->domain_id) {
                
$zone GetZoneByDomainOrderId($r->domain_id);
                
$domain GetDomainById($r->domain_id);
                if (
strtolower($zone->zone) == "ru" or strtolower($zone->zone) == "su") {
                    
$isR 1;
                    if (!
checkProfile("max"$_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfileWithPassport];
                        print 
"<BR>".$_lang[PayGoto]." <A class=rootlink href=billing.php?do=profile&isR=1&profileId=$domain->profileId&bill_id=$r->id>".$_lang[PayGotoFor]."</a>.";
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                } else {
                    
$isD 1;
                    if (!
checkProfile("min"$_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfile];
                        print 
"<BR>".$_lang[PayGoto]." <A class=rootlink href=billing.php?do=profile&isD=1&profileId=$domain->profileId&bill_id=$r->id>".$_lang[PayGotoFor]."</a>.";
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                }

                if (
strtolower($zone->zone) == "ru") {
                    
$isR 1$isD "";
                    if (!
checkProfileByAdmin($_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfileCheck];
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                } else {
                    
$isD 1$isR "";
                    if (!
checkProfileByAdmin($_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfileCheck];
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                }
            }

            
MakeBillPayed($r->id,1,$_lang[PayNullBill]);
            print 
$_lang[PayBillPaySuccess]."<BR><BR>";
        }
        else {
            if (
$r->domain_id) {
                
$zone GetZoneByDomainOrderId($r->domain_id);
                
$domain GetDomainById($r->domain_id);
                if (
strtolower($zone->zone) == "ru" or strtolower($zone->zone) == "su") {
                    
$isR 1;
                    if (!
checkProfile("max"$_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfileWithPassport];
                        print 
"<BR>".$_lang[PayGoto]." <A class=rootlink href=billing.php?do=profile&isR=1&profileId=$domain->profileId&bill_id=$r->id>".$_lang[PayGotoFor]."</a>.";
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                } else {
                    
$isD 1;
                    if (!
checkProfile("min"$_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfile];
                        print 
"<BR>".$_lang[PayGoto]." <A class=rootlink href=billing.php?do=profile&isD=1&profileId=$domain->profileId&bill_id=$r->id>".$_lang[PayGotoFor]."</a>.";
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                }

                if (
strtolower($zone->zone) == "ru") {
                    
$isR 1$isD "";
                    if (!
checkProfileByAdmin($_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfileCheck];
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                } else {
                    
$isD 1$isR "";
                    if (!
checkProfileByAdmin($_SESSION["userId"], $domain->profileId)) {
                        print 
$_lang[PayErrorNoProfileCheck];
                        
_foot('utf-8');
                        
mclose();
                        exit;
                    }
                }

            }

                    if (
$fromreg) {
                print 
$_lang[PayOrderCreateSuccess]."<BR>";

            }
            if (
$testPeriod and $testPeriodCreated) {
                print 
$_lang[PayOrderTestCreateSuccess]."<BR>";
            } else if (
$testPeriod and !$testPeriodCreated) {
                print 
$_lang[PayOrderTestCreateLater]."<BR>";
            }

            if (
$sub == "partnerPay") {
                if (
GetSetting("partnerEnable") and GetSetting("partnerEnablePayOrders")) {
                    
$partnerMoney=GetUserPartnerMoney($_SESSION["userId"]);
                    
$money=floatval($money);

                    if (
$partnerMoney >= $money) {
                        @
mysql_query("update users set partnerMoney=partnerMoney-$money where id='".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                        
MakeBillPayed($r->id,1,$_lang[payPartner]);
                        print 
$_lang[PayBillPaySuccess]."<br><br>";
                    }
                    else {
$sub='';print "<font color=red>".$_lang[PayErrorNoMoneyOnPartner]."</font><BR><BR>";}
        
                } else {
$sub='';print "<font color=red>".$_lang[PayErrorPartnerOff]."</font><BR><BR>";}
            }

            if (
$sub == "balancePay") {
                
$balanceMoney=GetUserMoney($_SESSION["userId"]);
                
$money=floatval($money);

                if (
$balanceMoney >= $money) {
                    @
mysql_query("update users set money=money-$money where id='".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                    
MakeBillPayed($r->id,1,$_lang[payBalance]);
                    print 
$_lang[PayBillPaySuccess]."<br><br>";
                }
                else {
$sub='';print "<font color=red>".$_lang[PayErrorNoMoneyOnBalance]."</font><BR><BR>";}
            }

                    if (!
$sub or $sub == "gotomerchant") {

            if (
$fromchange) {$textaddon $_lang[PayForTarifChange]." ";}

            if (!
$check) { print "<font color=red>".$textaddon.$_lang[PayNeedBillPay]."</font><BR><BR>"; }

                    
$manager_email=GetSetting("manager_email");
                      
$company_name=htmlEncode(GetSetting("company_name"));
                    
$payment_url=GetSetting("payment_url");
                    
$nopayment_url=GetSetting("nopayment_url");

            
$user GetUserById($_SESSION["userId"]);

            
$money_usd $money*GetCurrencyKoeficientByCode("USD");
            
$money_rur $money*GetCurrencyKoeficientByCode("RUB");
            
$money_uah $money*GetCurrencyKoeficientByCode("UAH");
            
$money_eur $money*GetCurrencyKoeficientByCode("EUR");
            
$money_byr $money*GetCurrencyKoeficientByCode("BYR");

            if (
$sub == "gotomerchant" and $paytype) {

                if (
$paytype != "easypay" and !$check) { print $_lang[PayForPayGoto]."<BR><BR>"; }

                if (
$paytype == "wmz") {
                    
$money_wmz $money_usd + ($money_usd/100)*GetSetting("nacenka_wmz"); $money_wmz round($money_wmz,2);

                            
$wmz=GetSetting("wmz");
                            
$wmsecret=GetSetting("wmsecret");
                    if (
$wmz and $wmsecret) { 
                        @
mysql_query("update bills set merchantmoney='$money_wmz' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://merchant.webmoney.ru/lmi/payment.asp" accept-charset="windows-1251">
                                    <input type=hidden name=LMI_PAYMENT_DESC value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=LMI_PAYEE_PURSE value="<?=$wmz?>">
                                    <input type=hidden name=LMI_PAYMENT_AMOUNT value="<?=$money_wmz?>">
                        <input type=hidden name=LMI_SUCCESS_URL value="<?=$payment_url?>">
                        <input type=hidden name=LMI_FAIL_URL value="<?=$nopayment_url?>">
                        <input type=hidden name=BILL_ID value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmz?> WMZ">
                                    </form>
                    <? }
                }
                if (
$paytype == "wmr") {
                    
$money_wmr $money_rur + ($money_rur/100)*GetSetting("nacenka_wmr"); $money_wmr round($money_wmr,2);

                            
$wmr=GetSetting("wmr");
                            
$wmsecret=GetSetting("wmsecret");
                    if (
$wmr and $wmsecret) {
                        @
mysql_query("update bills set merchantmoney='$money_wmr' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://merchant.webmoney.ru/lmi/payment.asp" accept-charset="windows-1251">
                                    <input type=hidden name=LMI_PAYMENT_DESC value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=LMI_PAYEE_PURSE value="<?=$wmr?>">
                                    <input type=hidden name=LMI_PAYMENT_AMOUNT value="<?=$money_wmr?>">
                        <input type=hidden name=LMI_SUCCESS_URL value="<?=$payment_url?>">
                        <input type=hidden name=LMI_FAIL_URL value="<?=$nopayment_url?>">
                        <input type=hidden name=BILL_ID value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmr?> WMR">
                                    </form>
                    <? }
                }
                if (
$paytype == "wme") {
                    
$money_wme $money_eur + ($money_eur/100)*GetSetting("nacenka_wme"); $money_wme round($money_wme,2);

                            
$wme=GetSetting("wme");
                            
$wmsecret=GetSetting("wmsecret");
                    if (
$wme and $wmsecret) {
                        @
mysql_query("update bills set merchantmoney='$money_wme' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://merchant.webmoney.ru/lmi/payment.asp" accept-charset="windows-1251">
                                    <input type=hidden name=LMI_PAYMENT_DESC value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=LMI_PAYEE_PURSE value="<?=$wme?>">
                                    <input type=hidden name=LMI_PAYMENT_AMOUNT value="<?=$money_wme?>">
                        <input type=hidden name=LMI_SUCCESS_URL value="<?=$payment_url?>">
                        <input type=hidden name=LMI_FAIL_URL value="<?=$nopayment_url?>">
                        <input type=hidden name=BILL_ID value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wme?> WME">
                                    </form>
                    <? }
                }
                if (
$paytype == "wmu") {
                    
$money_wmu $money_uah + ($money_uah/100)*GetSetting("nacenka_wmu"); $money_wmu round($money_wmu,2);

                            
$wmu=GetSetting("wmu");
                            
$wmsecret=GetSetting("wmsecret");
                    if (
$wmu and $wmsecret) {
                        @
mysql_query("update bills set merchantmoney='$money_wmu' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://merchant.webmoney.ru/lmi/payment.asp" accept-charset="windows-1251">
                                    <input type=hidden name=LMI_PAYMENT_DESC value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=LMI_PAYEE_PURSE value="<?=$wmu?>">
                                    <input type=hidden name=LMI_PAYMENT_AMOUNT value="<?=$money_wmu?>">
                        <input type=hidden name=LMI_SUCCESS_URL value="<?=$payment_url?>">
                        <input type=hidden name=LMI_FAIL_URL value="<?=$nopayment_url?>">
                        <input type=hidden name=BILL_ID value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmu?> WMU">
                                    </form>
                    <? }
                }
                if (
$paytype == "wmb") {
                    
$money_wmb $money_byr + ($money_byr/100)*GetSetting("nacenka_wmb"); $money_wmb round($money_wmb,2);

                            
$wmb=GetSetting("wmb");
                            
$wmsecret=GetSetting("wmsecret");
                    if (
$wmb and $wmsecret) {
                        @
mysql_query("update bills set merchantmoney='$money_wmb' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://merchant.webmoney.ru/lmi/payment.asp" accept-charset="windows-1251">
                                    <input type=hidden name=LMI_PAYMENT_DESC value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=LMI_PAYEE_PURSE value="<?=$wmb?>">
                                    <input type=hidden name=LMI_PAYMENT_AMOUNT value="<?=$money_wmb?>">
                        <input type=hidden name=LMI_SUCCESS_URL value="<?=$payment_url?>">
                        <input type=hidden name=LMI_FAIL_URL value="<?=$nopayment_url?>">
                        <input type=hidden name=BILL_ID value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmb?> WMB">
                                    </form>
                    <? }
                }
                if (
$paytype == "yandex") {
                    
$money_yandex $money_rur + ($money_rur/100)*GetSetting("nacenka_yandex"); $money_yandex round($money_yandex,2);

                            
$yandex=GetSetting("yandex");
                    if (
$yandex) {
                        @
mysql_query("update bills set merchantmoney='$money_yandex' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form method="POST" target="_blank" action="http://money.yandex.ru/select-wallet.xml" accept-charset="windows-1251">
                                    <input type="hidden" name="TargetCurrency" value="643">
                                    <input type="hidden" name="currency" value="643">
                                    <input type=hidden name="wbp_Version" value="2">
                                    <input type="hidden" name="wbp_MessageType" value="DirectPaymentIntoAccountRequest">
                                    <input type="hidden" name="wbp_ShopAddress" value="<?=$manager_email?>">
                                    <input type="hidden" name="wbp_accountid" value="<?=$yandex?>">
                                    <input type="hidden" name="wbp_currencyamount" value="643;<?=$money_yandex?>">
                                    <input class=input type="hidden" name="wbp_ShopErrorInfo" value="Payment error">
                                    <input class=input type="hidden" name="wbp_shortdescription" value="Payment request">
                                    <input class=input type="hidden" name="wbp_template_1" value="<?=$company_name?>: bill <?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_yandex?> <?=$_lang[PaySokraschenieRubl]?>">
                                    </form>

                    <? }
                }
                if (
$paytype == "pro") {
                    
$money_pro $money_rur + ($money_rur/100)*GetSetting("nacenka_pro"); $money_pro round($money_pro,2);

                            
$pro_client=GetSetting("pro_client");
                            
$pro_ra=GetSetting("pro_ra");
                            
$pro_secret=GetSetting("pro_secret");
                    if (
$pro_client and $pro_ra and $pro_secret) {
                        @
mysql_query("update bills set merchantmoney='$money_pro' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                        <form target=_blank action=http://merchant.prochange.ru/pay.pro method=POST accept-charset="windows-1251">
                        <input type=hidden name=PRO_CLIENT value='<?=$pro_client?>'>
                        <input type=hidden name=PRO_RA value='<?=$pro_ra?>'>
                        <input type=hidden name=PRO_PAYMENT_DESC value='<?=$company_name?>: bill <?=$sid?>'>
                        <input type=hidden name=PRO_SUMMA value='<?=$money_pro?>'>
                        <input type=hidden name=PRO_FIELD_1 value='<?=$sid?>'>
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_pro?> <?=$_lang[PaySokraschenieRubl]?>">
                        </form>

                    <? }
                }
                if (
$paytype == "egold") {
                    
$money_egold $money_usd + ($money_usd/100)*GetSetting("nacenka_egold"); $money_egold round($money_egold,2);

                    
$egold=GetSetting("egold");
                    if (
$egold) {
                        @
mysql_query("update bills set merchantmoney='$money_egold' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank action="https://www.e-gold.com/sci_asp/payments.asp" method="POST">
                                       <input class=input type="hidden" name="PAYEE_ACCOUNT" value="<?=$egold?>">
                                    <input class=input type="hidden" name="PAYEE_NAME" value="<?=$company_name?>">
                                    <input class=input type="hidden" name="PAYMENT_AMOUNT" value="<?=$money_egold?>">
                                    <input class=input type="hidden" name="PAYMENT_UNITS" value="1">
                                    <input class=input type="hidden" name="PAYMENT_METAL_ID" value="1">
                                    <input class=input type="hidden" name="PAYMENT_ID" value="<?=$sid?>">
                                    <input class=input type="hidden" name="STATUS_URL" value="<?=$full_www_path?>online_egold.php">
                                    <input class=input type="hidden" name="PAYMENT_URL" value="<?=$payment_url?>">
                                    <input class=input type="hidden" name="NOPAYMENT_URL" value="<?=$nopayment_url?>">
                                    <input class=input type="hidden" name="SUGGESTED_MEMO" value="<?=$company_name?>: bill <?=$sid?>">
                                    <input class=input type="hidden" name="BAGGAGE_FIELDS" value="">
                                    <input class=button type="submit" name="PAYMENT_METHOD" value="<?=$_lang[Pay]?> <?=$money_egold?> $">
                                    </form>

                    <? }
                }
                if (
$paytype == "rupay") {
                    
$money_rupay $money_rur + ($money_rur/100)*GetSetting("nacenka_rupay"); $money_rupay round($money_rupay,2);

                    
$rupay=GetSetting("rupay");
                    
$rupaysecret=GetSetting("rupaysecret");
                    if (
$rupay and $rupaysecret) {
                        @
mysql_query("update bills set merchantmoney='$money_rupay' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                        <form target=_blank action="https://rbkmoney.ru/acceptpurchase.aspx" accept-charset="windows-1251">
                        <input class=input type="hidden" name="eshopId" value="<?=$rupay?>">
                        <input class=input type="hidden" name="orderId" value="<?=$sid?>">
                        <input class=input type="hidden" name="serviceName" value="<?=$company_name?>: bill <?=$sid?>">
                        <input class=input type="hidden" name="recipientAmount" value="<?=$money_rupay?>">
                        <input class=input type="hidden" name="recipientCurrency" value="RUR">
                                    <input class=input type="hidden" name="successUrl" value="<?=$payment_url?>">
                        <input class=input type="hidden" name="failUrl" value="<?=$nopayment_url?>">
                        <input class=button type="submit" name="button" value="<?=$_lang[Pay]?> <?=$money_rupay?> <?=$_lang[PaySokraschenieRubl]?>">
                        </form>
                                <? }
                }
                if (
$paytype == "zpay") {
                    
$money_zpay $money_rur + ($money_rur/100)*GetSetting("nacenka_zpay"); $money_zpay round($money_zpay,2);

                    
$zpayid=GetSetting("zpayid");
                    
$zpaysecret=GetSetting("zpaysecret");
                    if (
$zpaysecret and $zpayid) {
                        @
mysql_query("update bills set merchantmoney='$money_zpay' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://z-payment.ru/merchant.php" accept-charset="windows-1251">
                                    <input type=hidden name=LMI_PAYMENT_DESC value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=LMI_PAYEE_PURSE value="<?=$zpayid?>">
                        <input type=hidden name=LMI_PAYMENT_NO value="<?=$sid?>">
                        <input type=hidden name=LMI_PREREQUEST value="0">
                                    <input type=hidden name=LMI_PAYMENT_AMOUNT value="<?=$money_zpay?>">
                        <input type=hidden name=LMI_SUCCESS_URL value="<?=$payment_url?>">
                        <input type=hidden name=LMI_FAIL_URL value="<?=$nopayment_url?>">
                        <input type=hidden name=CLIENT_MAIL value="<?=$user->email?>">
                        <input type=hidden name=BILL_ID value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_zpay?> ZP">
                                    </form>
                    <? }
                }
                if (
$paytype == "robox") {
                    
$robox_currency=GetSetting("robox_currency");
                    if (
$robox_currency) {
                        
$robox_currency GetCurrencyByCode($robox_currency);
                        
$money_robox $money*$robox_currency->koeficient;
                        
$robox_symbol $robox_currency->symbol;
                    } else {
                        
$money_robox $money_usd;
                        
$robox_symbol "$";
                    }
                    
$money_robox $money_robox + ($money_robox/100)*GetSetting("nacenka_robox"); $money_robox round($money_robox,2);

                    
$robox=GetSetting("robox");
                    
$robox_pass1=GetSetting("robox_pass1");
                    if (
$robox and $robox_pass1) {
                        @
mysql_query("update bills set merchantmoney='$money_robox' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                        <form target=_blank method="POST" style="margin: 0;" action="http://merchant.roboxchange.com/Index.aspx" accept-charset="windows-1251">
                        <input type=hidden name=MrchLogin value=<?=$robox?>>
                        <input type=hidden name=OutSum value=<?=$money_robox?>>
                        <input type=hidden name=InvId value=<?=$r->id?>>
                        <input type=hidden name=Desc value="<?=$company_name?>: bill <?=$sid?>">
                        <input type=hidden name=SignatureValue value="<?=md5("$robox:$money_robox:$r->id:$robox_pass1")?>">
                        <input type=hidden name=IncCurrLabel value=WMZ>
                        <input type=hidden name=Culture value=ru>
                        <input class=button type=submit value='<?=$_lang[Pay]?> <?=$money_robox?> <?=$robox_symbol?>'>
                        </form>
                    <? }
                }
                if (
$paytype == "ikass") {
                    
$money_ikass $money_usd + ($money_usd/100)*GetSetting("nacenka_ikass"); $money_ikass round($money_ikass,2);

                    
$ikass_id=GetSetting("ikass_id");
                    
$ikass_pass=GetSetting("ikass_pass");
                    if (
$ikass_id and $ikass_pass) {
                        @
mysql_query("update bills set merchantmoney='$money_ikass' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="http://www.interkassa.com/lib/payment.php">
                                    <input type=hidden name=ik_shop_id value="<?=$ikass_id?>">
                                    <input type=hidden name=ik_payment_amount value="<?=$money_ikass?>">
                        <input type=hidden name=ik_payment_id value="<?=$sid?>">
                                    <input type=hidden name=ik_payment_desc value="bill <?=$sid?>">
                        <input type=hidden name=ik_paysystem_alias value="">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_ikass?> $">
                                    </form>
                    <? }
                }
                if (
$paytype == "easypay") {
                    
$money_easypay $money_byr + ($money_byr/100)*GetSetting("nacenka_easypay"); $money_easypay ceil($money_easypay);

                    
$easypay_merno=GetSetting("easypay_merno");
                    
$easypay_pass=GetSetting("easypay_pass");

                    if (
$easypay_merno and $easypay_pass) {
                        if (!
$r->merchantId) {
                            if (
strlen($purse) == 8) {
                                
$easypay = new EASYPAY;
                                
$easypay->init($easypay_merno,$easypay_pass);

                                
$result=$easypay->createBill($r->id$money_easypay30$purse"$company_name: bill $sid""$company_name: bill $sid""");
        
                                if (
$result) {
                                    @
mysql_query("update bills set merchantId='$r->id',merchantmoney='$money_easypay' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                                    print 
$_lang[PayBillCreateEasyPaySuccess]." ($purse).<BR><BR>";

                                } else {
                                    print 
"<font color=red>".$_lang[Error].": $easypay->error</font><BR><BR>";
                                }
                            }
                            else { 
                                print 
"<font color=red>".$_lang[Error].": ".$_lang[PayErrorPurseNeed].".</font><BR><BR>"$easypay->error "1";
                                
?>
                                            <form method="POST" style="margin: 0;" action="billing.php">
                                            <input type=hidden name=do value="<?=$do?>">
                                            <input type=hidden name=sub value="gotomerchant">
                                            <input type=hidden name=id value="<?=$id?>">
                                            <input type=hidden name=paytype value="easypay">
                                <?=$_lang[PayInputEasyPayPurse]?>:<BR>
                                <input class=input type=text name=purse size=10> <input class=button type=submit value="<?=$_lang[PayCreateBillForSumm]?> <?=$money_easypay?> <?=$_lang[PaySokraschenieRubl]?>">
                                            </form>
                                <?
                            
}
                        } else if (!
$check) {
                            print 
$_lang[PayErrorBillCreateEasyPayAlready].".<BR><BR>";
                        }

                        
$billPayed 0;
                        
$billDeleted 0;
                        if (
$check and $r->merchantId) {
                            
$easypay = new EASYPAY;
                            
$easypay->init($easypay_merno,$easypay_pass);

                            
$result=$easypay->checkBill($r->id);

                            if (
$result == "1") {
                                
$billPayed 1;
                                
MakeBillPayed($r->id,1,"EasyPay Merchant");
                                print 
$_lang[PayBillStatus].": ".$_lang[BillPayed].".<BR><BR>";
                            } else if (
$result == "-1") {
                                
$billDeleted 1;
                                @
mysql_query("update bills set merchantmoney='',merchantId='' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                                print 
$_lang[PayBillStatus].": ".$_lang[BillDeleted].".<BR><BR>";
                            } else {
                                print 
$_lang[PayBillStatus].": ".$_lang[BillNotPayed].".<BR><BR>";
                            }
                        }

                        if (!
$easypay->error and !$billPayed and !$billDeleted) {
                            print 
$_lang[PayGotoEasyPay];

                            
?>
                                        <form target=_blank method="POST" style="margin: 0;" action="billing.php">
                                        <input type=hidden name=do value="<?=$do?>">
                                        <input type=hidden name=sub value="gotomerchant">
                                        <input type=hidden name=id value="<?=$id?>">
                                        <input type=hidden name=paytype value="easypay">
                                        <input type=hidden name=check value="1">
                            <input class=button type=submit value="<?=$_lang[PayCheckBillStatus]?>">
                                        </form>
                            <?

                        
}
                    }

                }
                if (
$paytype == "webpay") {
                    
$money_webpay $money_byr + ($money_byr/100)*GetSetting("nacenka_webpay"); $money_webpay ceil($money_webpay);

                            
$webpay_storeid=GetSetting("webpay_storeid");
                            
$webpay_secret=GetSetting("webpay_secret");
                            if (
$webpay_storeid and $webpay_secret) {
                        @
mysql_query("update bills set merchantmoney='$money_webpay' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

                        
$seed time();
                        
$sign sha1($seed.$webpay_storeid.$r->id.$WEBPAY_TEST."BYR".$money_webpay.$webpay_secret);
                        
?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://secure.sandbox.webpay.by:8843/">
                                    <input type=hidden name="*scart">
                                    <input type=hidden name=wsb_storeid value="<?=$webpay_storeid?>">
                                    <input type=hidden name=wsb_store value="<?=$company_name?>">
                                    <input type=hidden name=wsb_order_num value="<?=$r->id?>">
                                    <input type=hidden name=wsb_currency_id value="BYR">
                                    <input type=hidden name=wsb_version value="2">
                                    <input type=hidden name=wsb_language_id value="russian">
                                    <input type=hidden name=wsb_seed value="<?=$seed?>">
                                    <input type=hidden name=wsb_signature value="<?=$sign?>">
                                    <input type=hidden name=wsb_return_url value="<?=GetSetting("payment_url")?>">
                                    <input type=hidden name=wsb_cancel_return_url value="<?=GetSetting("nopayment_url")?>">
                                    <input type=hidden name=wsb_notify_url value="<?=$full_www_path?>online_webpay.php">
                                    <input type=hidden name=wsb_test value="<?=$WEBPAY_TEST?>">
                                    <input type=hidden name=wsb_invoice_item_name[0] value="<?="Услуги по счету $sid"?>">
                                    <input type=hidden name=wsb_invoice_item_quantity[0] value="1">
                                    <input type=hidden name=wsb_invoice_item_price[0] value="<?=$money_webpay?>">
                                    <input type=hidden name=wsb_total value="<?=$money_webpay?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_webpay?> <?=$_lang[PaySokraschenieRubl]?>">
                                    </form>
                    <? }
                }
                if (
$paytype == "portmone") {
                    
$money_portmone $money_uah + ($money_uah/100)*GetSetting("nacenka_portmone"); $money_portmone round($money_portmone,2);

                            
$portmone_id=GetSetting("portmone_id");
                            
$portmone_login=GetSetting("portmone_login");
                            
$portmone_password=GetSetting("portmone_password");
                    if (
$portmone_id and $portmone_login and $portmone_password) {
                        if (!
$check) {
                            @
mysql_query("update bills set merchantmoney='$money_portmone' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); 

                            
?>
                                        <form target=_blank method="POST" style="margin: 0;" action="https://www.portmone.com.ua/secure/gate/pay.php" accept-charset="windows-1251">
                                        <input type=hidden name=PAYEE_ID value="<?=$portmone_id?>">
                            <input type=hidden name=SHOPORDERNUMBER value="<?=$sid?>">
                                        <input type=hidden name=BILL_AMOUNT value="<?=$money_portmone?>">
                                        <input type=hidden name=DESCRIPTION value="<?=$company_name?>: bill <?=$sid?>">
                            <input type=hidden name=OUT_URL value="<?=$full_www_path?>billing.php?do=<?=$do?>&sub=gotomerchant&id=<?=$id?>&paytype=portmone&check=1">
                                        <input type=hidden name=LANG value="<?=$_lang[LangCode]?>">
                                        <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_portmone?> <?=$_lang[PaySokraschenieGrivna]?>">
                                        </form><BR><BR>
                            <? 
                        
} else {
                            
$billPayed 0;

                            
$portmone = new PORTMONE;
                            
$portmone->init($portmone_id,$portmone_login,$portmone_password);

                            
$result=$portmone->checkBill($sid);

                            if (
$result) {
                                if (
$result == $r->merchantmoney) {
                                    
$billPayed 1;
                                    
MakeBillPayed($r->id,1,"Portmone Merchant");
                                    print 
$_lang[PayBillStatus].": ".$_lang[BillPayed].".<BR><BR>";
                                } else {
                                    print 
"<font color=red>".$_lang[Error].": ".$_lang[PayErrorBadSumm]."</font><BR><BR>";
                                }
                            } else {
                                if (
$portmone->error) { $portmone->error " (".$portmone->error.")"; }
                                print 
$_lang[PayBillStatus].": ".$_lang[BillNotPayed].$portmone->error."<BR><BR>";
                            }
                        }

                        if (!
$billPayed and $r->merchantmoney 0) {
                            print 
$_lang[PayPortmoneCheckBill];

                            
?>
                                        <form method="POST" style="margin: 0;" action="billing.php">
                                        <input type=hidden name=do value="<?=$do?>">
                                        <input type=hidden name=sub value="gotomerchant">
                                        <input type=hidden name=id value="<?=$id?>">
                                        <input type=hidden name=paytype value="portmone">
                                        <input type=hidden name=check value="1">
                            <input class=button type=submit value="<?=$_lang[PayCheckBillStatus]?>">
                                        </form>
                            <?

                        
}

                    }
                }
                if (
$paytype == "privatbank") {
                    
$money_privatbank $money_uah + ($money_uah/100)*GetSetting("nacenka_privatbank"); $money_privatbank round($money_privatbank,2);
                    
$money_privatbank_usd $money_usd + ($money_usd/100)*GetSetting("nacenka_privatbank"); $money_privatbank_usd round($money_privatbank_usd,2);

                    
$privatbank_id=GetSetting("privatbank_id");
                    
$privatbank_pass=GetSetting("privatbank_pass");
                    
$privatbank_name=GetSetting("privatbank_name");
                    if (
$privatbank_id and $privatbank_pass and $privatbank_name) {
                        @
mysql_query("update bills set merchantmoney='$money_privatbank' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

                        
$money_privatbank sprintf("%01.2f"$money_privatbank); $amount preg_replace("/./ui"""$money_privatbank); while( strlen($amount)<12) {$amount="0".$amount;}
                        
$money_privatbank_usd sprintf("%01.2f"$money_privatbank_usd); $amount_usd preg_replace("/./ui"""$money_privatbank_usd); while( strlen($amount_usd)<12) {$amount_usd="0".$amount_usd;}
                        if (
$PRIVATBANK_TEST) { $orderID "Test_".$privatbank_name."_".time()."_$r->id"; } else { $orderID time()."_".$r->id; }

                        
$hash sha1($privatbank_pass.$privatbank_id."414963".$orderID.$amount."980".$amount_usd."840");
                        
$hash hexbin($hash);
                        
$hash base64_encode($hash);

                        
$path preg_replace("/http:/ui","https:",$full_www_path);
                        
?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://www.verification.privatbank.ua/SENTRY/PaymentGateway/Application/CheckoutPage/CheckoutPage.aspx">
                        <input type='hidden' value='1.0.0' name='Version'>
                        <input type='hidden' value='<?=$privatbank_id?>' name='MerID'>
                        <input type='hidden' value='<?=$path?>online_privatbank.php' name='MerRespURL'>
                        <input type='hidden' value='414963' name='AcqID'>
                        <input type='hidden' value='<?=$amount?>' name='PurchaseAmt'>
                        <input type='hidden' value='980' name='PurchaseCurrency'>
                        <input type='hidden' value='<?=$amount_usd?>' name='PurchaseAmt2'>
                        <input type='hidden' value='840' name='PurchaseCurrency2'>
                        <input type='hidden' value='<?=$orderID?>' name='OrderID'>
                        <input type='hidden' value='2' name='PurchaseCurrencyExponent'>
                        <input type='hidden' value='SHA1' name='SignatureMethod'>
                        <input type='hidden' value ='<?=$hash?>' name='Signature'>
                        <input type='hidden' value='A' name='CaptureFlag'>
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_privatbank?> <?=$_lang[PaySokraschenieGrivna]?>">
                                    </form>
                    <? }
                }
                if (
$paytype == "liqpay") {
                    
$liqpay_currency=GetSetting("liqpay_currency");
                    if (
$liqpay_currency) {
                        
$liqpay_currency GetCurrencyByCode($liqpay_currency);
                        
$money_liqpay $money*$liqpay_currency->koeficient;
                        
$liqpay_symbol $liqpay_currency->symbol;
                        
$liqpay_code $liqpay_currency->code;
                        if (
$liqpay_code == "RUB") {$liqpay_code "RUR";}
                    } else {
                        
$money_liqpay $money_usd;
                        
$liqpay_symbol "$";
                        
$liqpay_code "USD";
                    }
                    
$money_liqpay $money_liqpay + ($money_liqpay/100)*GetSetting("nacenka_liqpay"); $money_liqpay round($money_liqpay,2);

                    
$liqpay_id=GetSetting("liqpay_id");
                    
$liqpay_password=GetSetting("liqpay_password");
                    if (
$liqpay_id and $liqpay_password) {
                        
$desc $company_name.": bill ".$sid;

                        @
mysql_query("update bills set merchantmoney='$money_liqpay' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                        <form target=_blank method="POST" style="margin: 0;" action="https://liqpay.com/?do=clickNbuy">
                        <input type="hidden" name="version" value="1.1">
                        <input type="hidden" name="merchant_id" value="<?=$liqpay_id?>">
                        <input type="hidden" name="amount" value="<?=$money_liqpay?>">
                        <input type="hidden" name="currency" value="<?=$liqpay_code?>">
                        <input type="hidden" name="description" value="<?=$desc?>">
                        <input type="hidden" name="order_id" value="<?=$r->id?>">
                        <input type="hidden" name="result_url" value="<?=GetSetting("payment_url")?>">
                        <input type="hidden" name="server_url" value="<?=$full_www_path?>online_liqpay.php">
                        <input class=button type=submit value='<?=$_lang[Pay]?> <?=$money_liqpay?> <?=$liqpay_symbol?>'>
                        </form>
                    <? }
                }
                if (
$paytype == "twopay") {
                    
$twopay_currency=GetSetting("twopay_currency");
                    if (
$twopay_currency) {
                        
$twopay_currency GetCurrencyByCode($twopay_currency);
                        
$money_twopay $money*$twopay_currency->koeficient;
                        
$twopay_symbol $twopay_currency->symbol;
                        
$twopay_code $twopay_currency->code;
                    } else {
                        
$money_twopay $money_usd;
                        
$twopay_symbol "$";
                        
$twopay_code "USD";
                    }
                    
$money_twopay $money_twopay + ($money_twopay/100)*GetSetting("nacenka_twopay"); $money_twopay round($money_twopay,2);

                    
$twopay_id=GetSetting("twopay_id");
                    
$twopay_secret=GetSetting("twopay_secret");
                    if (
$twopay_id and $twopay_secret) {
                        @
mysql_query("update bills set merchantmoney='$money_twopay' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                        <form target=_blank method="POST" style="margin: 0;" action="https://2pay.ru/oplata/">
                        <input type="hidden" name="id" value="<?=$twopay_id?>">
                        <input type="hidden" name="v1" value="<?=$r->id?>">
                        <input type="hidden" name="amount" value="<?=$money_twopay?>">
                        <input class=button type=submit value='<?=$_lang[Pay]?> <?=$money_twopay?> <?=$twopay_symbol?>'>
                        </form>
                    <? }
                }
                if (
$paytype == "smscoin") {
                    
$money_smscoin $money_usd + ($money_usd/100)*GetSetting("nacenka_smscoin"); $money_smscoin round($money_smscoin,2);

                    
$smscoin_id=GetSetting("smscoin_id");
                    
$smscoin_secret=GetSetting("smscoin_secret");
                    if (
$smscoin_id and $smscoin_secret) {
                        @
mysql_query("update bills set merchantmoney='$money_smscoin' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

                        print 
$_lang[PayGotoSMSCoin];

                        
$desc "bill # $sid";

                        
$sign md5($smscoin_id."::".$r->id."::".$money_smscoin."::"."1"."::".$desc."::".$smscoin_secret);
                        
?>

                                    <form target=_blank method="POST" style="margin: 0;" action="http://bank.smscoin.com/language/<?=$_SESSION["userLang"]?>/bank/">
                                    <input type=hidden name=s_purse value="<?=$smscoin_id?>">
                        <input type=hidden name=s_order_id value="<?=$r->id?>">
                                    <input type=hidden name=s_amount value="<?=$money_smscoin?>">
                                    <input type=hidden name=s_clear_amount value="1">
                                    <input type=hidden name=s_description value="<?=$desc?>">
                                    <input type=hidden name=s_sign value="<?=$sign?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_smscoin?> $">
                                    </form>
                    <? }
                }
                if (
$paytype == "paypal") {
                    
$paypal_currency=GetSetting("paypal_currency");
                    if (
$paypal_currency) {
                        
$paypal_currency GetCurrencyByCode($paypal_currency);
                        
$money_paypal $money*$paypal_currency->koeficient;
                        
$paypal_symbol $paypal_currency->symbol;
                        
$paypal_code $paypal_currency->code;
                    } else {
                        
$money_paypal $money_usd;
                        
$paypal_symbol "$";
                        
$paypal_code "USD";
                    }
                    
$money_paypal $money_paypal + ($money_paypal/100)*GetSetting("nacenka_paypal"); $money_paypal round($money_paypal,2);

                    
$paypal=GetSetting("paypal");
                    if (
$paypal) {
                        @
mysql_query("update bills set merchantmoney='$money_paypal' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://www.paypal.com/cgi-bin/webscr">
                                    <input type=hidden name=business value="<?=$paypal?>">
                                    <input type=hidden name=currency_code value="<?=$paypal_code?>">
                                    <input type=hidden name=return value="<?=GetSetting("payment_url")?>">
                                    <input type=hidden name=cancel_return value="<?=GetSetting("nopayment_url")?>">
                                    <input type=hidden name=notify_url value="<?=$full_www_path."online_paypal.php"?>">
                                    <input type=hidden name=cmd value="_xclick">
                                    <input type=hidden name=item_name value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=amount value="<?=$money_paypal?>">
                        <input type=hidden name=item_number value="<?=$sid?>">
                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_paypal?> <?=$paypal_symbol?>">
                                    </form>
                    <? }
                }
                if (
$paytype == "2checkout") {
                    
$money_twoco $money_usd + ($money_usd/100)*GetSetting("nacenka_twoco"); $money_twoco round($money_twoco,2);

                    
$twoco_id=GetSetting("twoco_id");
                    
$twoco_secret=GetSetting("twoco_secret");
                    if (
$twoco_id and $twoco_secret) {
                        @
mysql_query("update bills set merchantmoney='$money_twoco' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://www.2checkout.com/checkout/purchase">
                                    <input type=hidden name=sid value="<?=$twoco_id?>">
                        <input type=hidden name=cart_order_id value="<?=$r->id?>">
                                    <input type=hidden name=total value="<?=$money_twoco?>">
                                    <input type=hidden name=x_receipt_link_url value="<?=$full_www_path."online_twoco.php"?>">
                                    <input type=hidden name=tco_currency value="USD">
                                    <input type=hidden name=fixed value="Y">

                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_twoco?> $">
                                    </form>
                    <? }
                }
                if (
$paytype == "authorize") {
                    
$money_authorize $money_usd + ($money_usd/100)*GetSetting("nacenka_authorize"); $money_authorize round($money_authorize,2);

                    
$authorize_login=GetSetting("authorize_login");
                    
$authorize_secret=GetSetting("authorize_secret");
                    if (
$authorize_login and $authorize_secret) {
                        
$x_time time();
                        @
mysql_query("update bills set merchantmoney='$money_authorize' where id='$r->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error()); ?>

                                    <form target=_blank method="POST" style="margin: 0;" action="https://secure.authorize.net/gateway/transact.dll">
                                    <input type=hidden name=x_version value="3.1">
                                    <input type=hidden name=x_show_form value="PAYMENT_FORM">
                                    <input type=hidden name=x_relay_response value="TRUE">
                                    <input type=hidden name=x_login value="<?=$authorize_login?>">
                        <input type=hidden name=x_fp_sequence value="<?=$r->id?>">
                        <input type=hidden name=x_fp_timestamp value="<?=$x_time?>">
                        <input type=hidden name=x_fp_hash value="<?=hmac($authorize_secret,$authorize_login."^".$r->id."^".$x_time."^".sprintf("%01.2f"$money_authorize)."^")?>">
                                    <input type=hidden name=x_receipt_link_url value="<?=GetSetting("payment_url")?>">
                                    <input type=hidden name=x_relay_url value="<?=$full_www_path."online_authorize.php"?>">
                                    <input type=hidden name=x_description value="<?=$company_name?>: bill <?=$sid?>">
                                    <input type=hidden name=x_amount value="<?=sprintf("%01.2f"$money_authorize)?>">
                        <input type=hidden name=x_invoice_num value="<?=$r->id?>">
                                    <input type=hidden name=x_cust_id value="<?=$_SESSION["userLogin"]?>">

                                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_authorize?> $">
                                    </form>
                    <? }
                }


                print 
"<BR><BR>".$_lang[PayAlsoYouCan]." <A class=rootlink href=billing.php?do=$do&id=$id>".$_lang[PaySelectAnotherPayMethod]."</a>.";
                print 
"</center>";
                
_foot('utf-8');
                
mclose();
                exit;
            }

            print 
"<table width=600 class='rpTableBlank' border=1 cellpadding=0 cellspacing=0><tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>";

                    if (
GetSetting("userBalanceEnable") and !$r->addfunds and GetUserMoney($_SESSION["userId"]) >= $money) {
                            
?>
                    <tr>
                    <td valign=top><BR>&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-size: 30">>>></b></td>
                    <td><BR>
                        
                    <B>:: <?=$_lang[payBalance]?></B><BR><BR>
                    
                    <B><?=$_lang[PayNaSchetu]?>:</b>  <?=round(GetUserMoney($_SESSION["userId"])*CURK,2)?> <?=CURS?><BR><BR>

                    <form method=post>
                    <input type=hidden name=sub value=balancePay>
                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=round($money*CURK,2)?> <?=CURS?>">
                    </form>
                    <BR>
                        
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    if (
GetSetting("partnerEnable") and GetSetting("partnerEnablePayOrders") and GetUserPartnerMoney($_SESSION["userId"]) >= $money) {
                            
?>
                    <tr>
                    <td valign=top><BR>&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-size: 30">>>></b></td>
                    <td><BR>
                        
                    <B>:: <?=$_lang[payPartner]?></B><BR><BR>
                    
                    <B><?=$_lang[PayNaSchetu]?>:</b>  <?=round(GetUserPartnerMoney($_SESSION["userId"])*CURK,2)?> <?=CURS?><BR><BR>

                    <form method=post>
                    <input type=hidden name=sub value=partnerPay>
                    <input class=button type=submit value="<?=$_lang[Pay]?> <?=round($money*CURK,2)?> <?=CURS?>">
                    </form>
                    <BR>
                        
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$wmz=GetSetting("wmz");
                    
$wmr=GetSetting("wmr");
                    
$wmu=GetSetting("wmu");
                    
$wme=GetSetting("wme");
                    
$wmb=GetSetting("wmb");
                    
$wmsecret=GetSetting("wmsecret");
            
$wm_comment=GetSetting("wm_comment");
                    if (
$wmz or $wmr or $wmu or $wme or $wmb) {
                
$money_wmz $money_usd + ($money_usd/100)*GetSetting("nacenka_wmz"); $money_wmz round($money_wmz,2);
                
$money_wmr $money_rur + ($money_rur/100)*GetSetting("nacenka_wmr"); $money_wmr round($money_wmr,2);
                
$money_wmu $money_uah + ($money_uah/100)*GetSetting("nacenka_wmu"); $money_wmu round($money_wmu,2);
                
$money_wme $money_eur + ($money_eur/100)*GetSetting("nacenka_wme"); $money_wme round($money_wme,2);
                
$money_wmb $money_byr + ($money_byr/100)*GetSetting("nacenka_wmb"); $money_wmb round($money_wmb,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.webmoney.ru/" target=_blank><img src="./_rootimages/logo_wm.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[payWebMoney]?></b><BR><BR>

                <? if ($wm_comment) {print $wm_comment."<BR><BR>";} ?>
                            
                            <B><?=$_lang[PayPurses]?>:</B><BR>
                            <? if ($wmz) { print "WMZ: $wmz (".$_lang[PayToPay].$money_wmz WMZ)<BR>"; } ?>
                            <? if ($wmr) { print "WMR: $wmr (".$_lang[PayToPay].$money_wmr WMR)<BR>"; } ?>
                            <? if ($wmu) { print "WMU: $wmu (".$_lang[PayToPay].$money_wmu WMU)<BR>"; } ?>
                            <? if ($wme) { print "WME: $wme (".$_lang[PayToPay].$money_wme WME)<BR>"; } ?>
                            <? if ($wmb) { print "WMB: $wmb (".$_lang[PayToPay].$money_wmb WMB)<BR>"; } ?>
                            <BR>
    
                <? if ($wmz and $wmsecret) { ?>
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="wmz">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmz?> WMZ">
                            </form>
                <? ?>

                <? if ($wme and $wmsecret) { ?>
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="wme">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wme?> WME">
                            </form>
                <? ?>
    
                <? if ($wmr and $wmsecret) { ?>
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="wmr">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmr?> WMR">
                            </form>
                <? ?>
    
                <? if ($wmu and $wmsecret) { ?>
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="wmu">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmu?> WMU">
                            </form>
                <? ?>

                <? if ($wmb and $wmsecret) { ?>
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="wmb">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_wmb?> WMB">
                            </form>
                <? ?>
    
                <BR>
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}
    
                    
$yandex=GetSetting("yandex");
            
$yandex_comment=GetSetting("yandex_comment");
                    if (
$yandex) {
                
$money_yandex $money_rur + ($money_rur/100)*GetSetting("nacenka_yandex"); $money_yandex round($money_yandex,2);
                            
?>
                    <tr>
                    <td valign=top><BR><A class=rootlink href="http://money.yandex.ru/" target=_blank><img src="./_rootimages/logo_yandex.gif" border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td><BR>
                        
                    <B>:: <?=$_lang[payYandex]?></B><BR><BR>

                    <? if ($yandex_comment) {print $yandex_comment."<BR><BR>";} ?>
                        
                    <B><?=$_lang[PayPurse]?>:</b> <?=$yandex?> (<?=$_lang[PayToPay]?> <?=$money_yandex?> <?=$_lang[PaySokraschenieRubl]?>)<BR><BR>
                            
                                <form method="POST" action="billing.php">
                                <input type=hidden name=do value="<?=$do?>">
                                <input type=hidden name=sub value="gotomerchant">
                                <input type=hidden name=id value="<?=$id?>">
                                <input type=hidden name=paytype value="yandex">
                                <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_yandex?> <?=$_lang[PaySokraschenieRubl]?>">
                                </form>

                    <b style="font-size: 14;"><?=$_lang[PayPayByHandsAlert]?></b><br><Br>
                        
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$pro_client=GetSetting("pro_client");
                    
$pro_ra=GetSetting("pro_ra");
                    
$pro_secret=GetSetting("pro_secret");
            
$pro_comment=GetSetting("pro_comment");
                    if (
$pro_client and $pro_ra and $pro_secret) {
                
$money_pro $money_rur + ($money_rur/100)*GetSetting("nacenka_pro"); $money_pro round($money_pro,2);
                            
?>
                    <tr>
                    <td valign=top><BR><A class=rootlink href="http://www.prochange.ru/merchant.html" target=_blank><img src="./_rootimages/logo_pro.gif" border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td><BR>
                        
                    <B>:: <?=$_lang[payYandex]?></B><BR><BR>

                    <? if ($pro_comment) {print $pro_comment."<BR><BR>";} ?>
                        
                                <form method="POST" action="billing.php">
                                <input type=hidden name=do value="<?=$do?>">
                                <input type=hidden name=sub value="gotomerchant">
                                <input type=hidden name=id value="<?=$id?>">
                                <input type=hidden name=paytype value="pro">
                                <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_pro?> <?=$_lang[PaySokraschenieRubl]?>">
                                </form>

                    <Br>
                        
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}
    
                    
$egold=GetSetting("egold");
            
$egold_comment=GetSetting("egold_comment");
                    if (
$egold) {
                
$money_egold $money_usd + ($money_usd/100)*GetSetting("nacenka_egold"); $money_egold round($money_egold,2);
                            
?>
                    <tr>
                    <td valign=top><BR><A class=rootlink href="http://www.e-gold.com/" target=_blank><img src="./_rootimages/logo_egold.gif" border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td><BR>
                        
                    <B>:: <?=$_lang[payEgold]?></b><BR><BR>

                    <? if ($egold_comment) {print $egold_comment."<BR><BR>";} ?>
                        
                    <B><?=$_lang[PayAccount]?>:</B> <?=$egold?> (<?=$_lang[PayToPay]?> <?=$money_egold?> $)<BR><BR>
                        
                                <form action="billing.php" method="POST">
                                <input type=hidden name=do value="<?=$do?>">
                                <input type=hidden name=sub value="gotomerchant">
                                <input type=hidden name=id value="<?=$id?>">
                                <input type=hidden name=paytype value="egold">
                                <input class=button type="submit" name="PAYMENT_METHOD" value="<?=$_lang[Pay]?> <?=$money_egold?> $">
                                </form>
            
                    <BR>
                        
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$rupayschet=GetSetting("rupayschet");
                    
$rupay=GetSetting("rupay");
                    
$rupaysecret=GetSetting("rupaysecret");
            
$rupay_comment=GetSetting("rupay_comment");
                    if (
$rupayschet) {
                
$money_rupay $money_rur + ($money_rur/100)*GetSetting("nacenka_rupay"); $money_rupay round($money_rupay,2);
                            
?>
                    <tr>
                    <td valign=top><BR><A class=rootlink href="http://rbkmoney.ru/" target=_blank><img src="./_rootimages/logo_rbk.gif" border=0></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td><BR>
                        
                    <B>:: <?=$_lang[payRBKMoney]?></b><BR><BR>

                    <? if ($rupay_comment) {print $rupay_comment."<BR><BR>";} ?>
                        
                    <B><?=$_lang[PayBill]?>:</B> <?=$rupayschet?> (<?=$_lang[PayToPay]?> <?=$money_rupay?> <?=$_lang[PaySokraschenieRubl]?>)<BR><BR>
                        
                    <? if ($rupay and $rupaysecret) { ?>
                    <form action="billing.php" >
                                <input type=hidden name=do value="<?=$do?>">
                                <input type=hidden name=sub value="gotomerchant">
                                <input type=hidden name=id value="<?=$id?>">
                                <input type=hidden name=paytype value="rupay">
                    <input class=button type="submit" name="button" value="<?=$_lang[Pay]?> <?=$money_rupay?> <?=$_lang[PaySokraschenieRubl]?>">
                    </form><BR>
                                <? ?>
                        
     
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$zpay=GetSetting("zpay");
                    
$zpayid=GetSetting("zpayid");
                    
$zpaysecret=GetSetting("zpaysecret");
            
$zpay_comment=GetSetting("zpay_comment");
                    if (
$zpay) {
                
$money_zpay $money_rur + ($money_rur/100)*GetSetting("nacenka_zpay"); $money_zpay round($money_zpay,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.z-payment.ru/" target=_blank><img src="./_rootimages/logo_zpay.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[payZPayment]?></b><BR><BR>

                <? if ($zpay_comment) {print $zpay_comment."<BR><BR>";} ?>
                            
                            <B><?=$_lang[PayPurse]?>:</B> <?=$zpay?> (<?=$_lang[PayToPay]?> <?=$money_zpay?> ZP)<BR><BR>
    
                <? if ($zpaysecret and $zpayid) { ?>
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="zpay">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_zpay?> ZP">
                            </form>
                <? ?>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$robox=GetSetting("robox");
                    
$robox_pass1=GetSetting("robox_pass1");
            
$robox_currency=GetSetting("robox_currency");
            
$robox_comment=GetSetting("robox_comment");
                    if (
$robox and $robox_pass1) {
                if (
$robox_currency) {
                    
$robox_currency GetCurrencyByCode($robox_currency);
                    
$money_robox $money*$robox_currency->koeficient;
                    
$robox_symbol $robox_currency->symbol;
                } else {
                    
$money_robox $money_usd;
                    
$robox_symbol "$";
                }
                
$money_robox $money_robox + ($money_robox/100)*GetSetting("nacenka_robox"); $money_robox round($money_robox,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.roboxchange.com/" target=_blank><img src="./_rootimages/logo_robox.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[payRoboxchange]?></b><BR><BR>

                <? if ($robox_comment) {print $robox_comment."<BR><BR>";} ?>
                            
                <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="robox">
                <input class=button type=submit value='<?=$_lang[Pay]?> <?=$money_robox?> <?=$robox_symbol?>'>
                </form>

                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$ikass_id=GetSetting("ikass_id");
                    
$ikass_pass=GetSetting("ikass_pass");
            
$ikass_comment=GetSetting("ikass_comment");
                    if (
$ikass_id and $ikass_pass) {
                
$money_ikass $money_usd + ($money_usd/100)*GetSetting("nacenka_ikass"); $money_ikass round($money_ikass,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.interkassa.com/" target=_blank><img src="./_rootimages/logo_ikass.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[payInterkassa]?></b><BR><BR>

                <? if ($ikass_comment) {print $ikass_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                            <input type=hidden name=do value="<?=$do?>">
                            <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="ikass">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_ikass?> $">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$easypay_merno=GetSetting("easypay_merno");
                    
$easypay_pass=GetSetting("easypay_pass");
            
$easypay_comment=GetSetting("easypay_comment");
                    if (
$easypay_merno and $easypay_pass) {
                
$money_easypay $money_byr + ($money_byr/100)*GetSetting("nacenka_easypay"); $money_easypay ceil($money_easypay);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.easypay.by/" target=_blank><img src="./_rootimages/logo_easypay.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[payEasyPay]?></b><BR><BR>

                <? if ($easypay_comment) {print $easypay_comment."<BR><BR>";} ?>
                            
                <? if ($money_easypay >= 105) { ?>
                                <form method="POST" style="margin: 0;" action="billing.php">
                                <input type=hidden name=do value="<?=$do?>">
                                <input type=hidden name=sub value="gotomerchant">
                                <input type=hidden name=id value="<?=$id?>">
                                <input type=hidden name=paytype value="easypay">
                    <?=$_lang[PayInputEasyPayPurse]?>:<BR>
                    <input class=input type=text name=purse size=10> <input class=button type=submit value="<?=$_lang[PayCreateBillForSumm]?> <?=$money_easypay?> <?=$_lang[PaySokraschenieRubl]?>">
                                </form>
                <? } else { ?>
                    <?=$_lang[PayMinBillSummEasyPay]?><BR>
                <? ?>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$webpay_storeid=GetSetting("webpay_storeid");
                    
$webpay_secret=GetSetting("webpay_secret");
            
$webpay_comment=GetSetting("webpay_comment");
                    if (
$webpay_storeid and $webpay_secret) {
                
$money_webpay $money_byr + ($money_byr/100)*GetSetting("nacenka_webpay"); $money_webpay ceil($money_webpay);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.webpay.by/" target=_blank><img src="./_rootimages/logo_webpay.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[payWebPay]?></b><BR><BR>

                <? if ($webpay_comment) {print $webpay_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="webpay">
                <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_webpay?> <?=$_lang[PaySokraschenieRubl]?>">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$portmone_id=GetSetting("portmone_id");
                    
$portmone_login=GetSetting("portmone_login");
                    
$portmone_password=GetSetting("portmone_password");
            
$portmone_comment=GetSetting("portmone_comment");
                    if (
$portmone_id and $portmone_login and $portmone_password) {
                
$money_portmone $money_uah + ($money_uah/100)*GetSetting("nacenka_portmone"); $money_portmone round($money_portmone,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.portmone.com/" target=_blank><img src="./_rootimages/logo_portmone.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[PayPortmone]?></b><BR><BR>

                <? if ($portmone_comment) {print $portmone_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="portmone">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_portmone?> <?=$_lang[PaySokraschenieGrivna]?>">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$privatbank_id=GetSetting("privatbank_id");
                    
$privatbank_name=GetSetting("privatbank_name");
                    
$privatbank_pass=GetSetting("privatbank_pass");
            
$privatbank_comment=GetSetting("privatbank_comment");
                    if (
$privatbank_id and $privatbank_name and $privatbank_pass) {
                
$money_privatbank $money_uah + ($money_uah/100)*GetSetting("nacenka_privatbank"); $money_privatbank round($money_privatbank,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://shop.privatbank.ua/" target=_blank><img src="./_rootimages/logo_privatbank.gif"  border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[PayPrivatbank]?></b><BR><BR>

                <? if ($privatbank_comment) {print $privatbank_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="privatbank">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_privatbank?> <?=$_lang[PaySokraschenieGrivna]?>">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$liqpay_id=GetSetting("liqpay_id");
                    
$liqpay_password=GetSetting("liqpay_password");
                    
$liqpay_currency=GetSetting("liqpay_currency");
            
$liqpay_comment=GetSetting("liqpay_comment");
                    if (
$liqpay_id and $liqpay_password) {
                if (
$liqpay_currency) {
                    
$liqpay_currency GetCurrencyByCode($liqpay_currency);
                    
$money_liqpay $money*$liqpay_currency->koeficient;
                    
$liqpay_symbol $liqpay_currency->symbol;
                } else {
                    
$money_liqpay $money_usd;
                    
$liqpay_symbol "$";
                }
                
$money_liqpay $money_liqpay + ($money_liqpay/100)*GetSetting("nacenka_liqpay"); $money_liqpay round($money_liqpay,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://shop.privatbank.ua/" target=_blank><img src="./_rootimages/logo_liqpay.gif"  border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[PayLiqpay]?></b><BR><BR>

                <? if ($liqpay_comment) {print $liqpay_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="liqpay">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_liqpay?> <?=$liqpay_symbol?>">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$twopay_id=GetSetting("twopay_id");
                    
$twopay_secret=GetSetting("twopay_secret");
                    
$twopay_currency=GetSetting("twopay_currency");
            
$twopay_comment=GetSetting("twopay_comment");
                    if (
$twopay_id and $twopay_secret) {
                if (
$twopay_currency) {
                    
$twopay_currency GetCurrencyByCode($twopay_currency);
                    
$money_twopay $money*$twopay_currency->koeficient;
                    
$twopay_symbol $twopay_currency->symbol;
                } else {
                    
$money_twopay $money_usd;
                    
$twopay_symbol "$";
                }
                
$money_twopay $money_twopay + ($money_twopay/100)*GetSetting("nacenka_twopay"); $money_twopay round($money_twopay,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.2pay.ru/" target=_blank><img src="./_rootimages/logo_twopay.png"  border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[Pay2pay]?></b><BR><BR>

                <? if ($twopay_comment) {print $twopay_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="twopay">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_twopay?> <?=$twopay_symbol?>">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$smscoin_id=GetSetting("smscoin_id");
                    
$smscoin_secret=GetSetting("smscoin_secret");
            
$smscoin_comment=GetSetting("smscoin_comment");
                    if (
$smscoin_id and $smscoin_secret) {
                
$money_smscoin $money_usd + ($money_usd/100)*GetSetting("nacenka_smscoin"); $money_smscoin round($money_smscoin,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.smscoin.com/" target=_blank><img src="./_rootimages/logo_smscoin.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[PaySMSCoin]?></b><BR><BR>

                <? if ($smscoin_comment) {print $smscoin_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="smscoin">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_smscoin?> $">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$paypal=GetSetting("paypal");
            
$paypal_currency=GetSetting("paypal_currency");
            
$paypal_comment=GetSetting("paypal_comment");
                    if (
$paypal) {
                if (
$paypal_currency) {
                    
$paypal_currency GetCurrencyByCode($paypal_currency);
                    
$money_paypal $money*$paypal_currency->koeficient;
                    
$paypal_symbol $paypal_currency->symbol;
                    
$paypal_code $paypal_currency->code;
                } else {
                    
$money_paypal $money_usd;
                    
$paypal_symbol "$";
                    
$paypal_code "USD";
                }
                
$money_paypal $money_paypal + ($money_paypal/100)*GetSetting("nacenka_paypal"); $money_paypal round($money_paypal,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.paypal.com/" target=_blank><img src="./_rootimages/logo_paypal.gif" border=0></a></td>
                            <td><BR>
                            
                            <B>:: <?=$_lang[PayPal]?></b><BR><BR>

                <? if ($paypal_comment) {print $paypal_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="paypal">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_paypal?> <?=$paypal_symbol?>">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$twoco_id=GetSetting("twoco_id");
                    
$twoco_secret=GetSetting("twoco_secret");
            
$twoco_comment=GetSetting("twoco_comment");
                    if (
$twoco_id and $twoco_secret) {
                
$money_twoco $money_usd + ($money_usd/100)*GetSetting("nacenka_twoco"); $money_twoco round($money_twoco,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.2checkout.com/" target=_blank><img src="./_rootimages/logo_twoco.gif" border=0></a><BR><BR></td>
                            <td valign=top><BR>
                            
                            <B>:: <?=$_lang[Pay2Checkout]?></b><BR><BR>

                <? if ($twoco_comment) {print $twoco_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="2checkout">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_twoco?> $">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

                    
$authorize_login=GetSetting("authorize_login");
                    
$authorize_secret=GetSetting("authorize_secret");
                    if (
$authorize_login and $authorize_secret) {
                
$money_authorize $money_usd + ($money_usd/100)*GetSetting("nacenka_authorize"); $money_authorize round($money_authorize,2);

                            
?>
                            <tr>
                            <td valign=top><BR><A class=rootlink href="http://www.authorize.net/" target=_blank><img src="./_rootimages/logo_authorize.gif" border=0></a><BR><BR></td>
                            <td valign=top><BR>
                            
                            <B>:: <?=$_lang[PayAuthorize]?></b><BR><BR>

                <? if ($authorize_comment) {print $authorize_comment."<BR><BR>";} ?>
                            
                            <form method="POST" style="margin: 0;" action="billing.php">
                               <input type=hidden name=do value="<?=$do?>">
                               <input type=hidden name=sub value="gotomerchant">
                            <input type=hidden name=id value="<?=$id?>">
                            <input type=hidden name=paytype value="authorize">
                            <input class=button type=submit value="<?=$_lang[Pay]?> <?=$money_authorize?> $">
                            </form>
                <BR>
                            
                            </td></tr>
                            <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                            <?
                    
}

            
$kvs GetKvitancii(1);
                    if (@
mysql_num_rows($kvs) > 0) {
                while (
$kv mysql_fetch_object($kvs)) {
                                
?>
                                <tr>
                    <td valign=top><BR>&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-size: 30">>>></b></td>
                                <td><BR>
                            
                                <B>:: <?=$_lang[payKvitanciya]?></b><BR><BR>

                    <?=preg_replace("/rn/ui""<BR>"htmlDecode($kv->comment))?><br><br>

                                <input class=button type=button value="<?=$_lang[PayGetKvitansiya]?> (HTML)" onClick="popupWin = window.open('billing.php?do=<?=$do?>&id=<?=$id?>&sub=kvitanciya&kvid=<?=$kv->id?>', 'kvitanciya', 'location=no,width=650,height=600,top=0'); popupWin.focus(); return false;"><BR>
                    <form style="margin: 0;" method=post><input type=hidden name=do value=<?=$do?>><input type=hidden name=id value=<?=$id?>><input type=hidden name=sub value=kvitanciyapdf><input type=hidden name=kvid value=<?=$kv->id?>><input class=button type=submit value="<?=$_lang[PayGetKvitansiya]?> (PDF)"></form><BR>

                    <BR>
                            
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                                <?
                
}
                    }

            
$fs GetFakturas(1);
                    if (@
mysql_num_rows($fs) > 0) {
                while (
$f mysql_fetch_object($fs)) {
                                
?>
                                <tr>
                    <td valign=top><BR>&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-size: 30">>>></b></td>
                                <td><BR>
                        
                                <B>:: <?=$_lang[paySchet]?></b><BR><BR>

                    <?=preg_replace("/rn/ui""<BR>"htmlDecode($f->comment))?><br><br>
            
                                <input class=button type=button value="<?=$_lang[PayGetSchetFaktura]?> (HTML)" onClick="popupWin = window.open('billing.php?do=<?=$do?>&id=<?=$id?>&sub=faktura&fid=<?=$f->id?>', 'faktura', 'location=no,width=650,height=700,top=0'); popupWin.focus(); return false;"><BR>
                                <form style="margin: 0;" method=post><input type=hidden name=do value=<?=$do?>><input type=hidden name=id value=<?=$id?>><input type=hidden name=sub value=fakturapdf><input type=hidden name=fid value=<?=$f->id?>><input class=button type=submit value="<?=$_lang[PayGetSchetFaktura]?> (PDF)"></form><BR>

                    <BR>
                            
                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                                <?
                
}
            }

            
$r GetPayMethods();
            while (
$rr = @mysql_fetch_object($r)) {
                
?>
                    <tr>
                    <td valign=top><BR>&nbsp;&nbsp;&nbsp;&nbsp;<b style="font-size: 30">>>></b></td>
                    <td><BR>
                        
                    <B>:: <?=$rr->name?></B><BR><BR>

                    <?=preg_replace("/rn/ui""<BR>"htmlDecode($rr->comment))?><br><br>

                                </td></tr>
                                <tr bgcolor=#CCCCCC><td colspan=5 height=1></td></tr>
                <?
            
}

                    print 
"</table><BR><BR>";
                    }
        }
                
_foot('utf-8');
        }
?>
Онлайн: 2
Реклама