!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.68 (Linux) PHP/7.4.33. PHP/7.4.33 

uname -a: Linux bjb2293782.nichost.ru 6.6.151-1.el8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Aug 10
11:16:02 MSK 2026 x86_64
 

uid=12584(bjb2293782) gid=12584(bjb2293782) groups=12584(bjb2293782)  

Safe-mode: OFF (not secure)

/home/bjb2293782/xn--80abaeoqbbrbgf8aea5a2a2z.xn--p1ai/docs/   drwxr-x---
Free 2715.72 GB of 4607.12 GB (58.95%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     basket.php (13.86 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require("design.php");
require(
"paymentutils.php");

session_start();

if (isset(
$_POST['action']))
{
    if (
$_POST['action'] == "shop:pay")
    {
        
$payer trim(_POST_('payer'));
        if (
$payer == "") die("ERROR: Необходимо задать имя плательщика!");

        
$order = isset($_SESSION['order']) ? intval($_SESSION['order']): 0;
        if (
$order == 0) die("ERROR: Заказ не найден!");
        

        
$mysql mysqlopen();

        
// проверим, что заказ еще не оплачен
        
$result mysqli_query($mysql,
                        
"SELECT
                            IF(`payDate` IS NULL,0,1) as `payed`
                        FROM
                            libOrders
                        WHERE
                            `id`=
$order
                        LIMIT 1"
);
        if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");
        if (!(
$row mysqli_fetch_assoc($result)))
        {
            
mysqli_free_result($result);
            die(
"ERROR: Заказ не найден!");
        }
        if (
$row['payed']==1)
        {
            
mysqli_free_result($result);
            die(
"ERROR: Заказ уже оплачен!");
        }
        
mysqli_free_result($result);
        

        
setcookie("PAYER",$payertime()+10000000);         


        
// обновить сумму и плательщика
        
$sum 0;
        
$result mysqli_query($mysql,"SELECT SUM(`price`*`count`) FROM libOrderItems WHERE `order`=$order");
        if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");
        if (
$row mysqli_fetch_row($result)) $sum floatval($row[0]);
        
mysqli_free_result($result);

        if (
$sum <= 0.0) die("ERROR: Неверная сумма заказа!");

        
$payer2 mysqli_escape_string($mysql$payer);
        
mysqli_query($mysql"UPDATE libOrders SET `sum`=$sum, `payer`='$payer2' WHERE `id`=$order LIMIT 1");
        if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");


        if (
KASSA=="ROBOKASSA")
        {

            
$result mysqli_query($mysql,
                
"SELECT
                    `desc`,
                    `price`*`count` as `sum`,
                    `count`
                FROM
                   libOrderItems
                WHERE
                   `order`=
$order
                "
);
            if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");


            
$Receipt '{"sno":"osn","items":[';

            
$first true;
            while(
$row mysqli_fetch_assoc($result))
            {
                if (!
$first$Receipt.=",";
                
$Receipt.='{"name":"' str_replace("'","`",$row['desc']). '"';
                
$Receipt.=',"quantity":'.$row['count'];
                
$Receipt.=',"sum":'.$row['sum'];
                
$Receipt.=',"payment_method":"full_payment"';
                
$Receipt.=',"payment_object":"service"';
                
$Receipt.=',"tax":"none"}';
                
$first false;
            }
            
mysqli_free_result($result);
            
$Receipt .= "]}";

            
//$f = fopen("___json.txt", "w");
            //fwrite($f, $Receipt);
            //fclose($f);



            // регистрационная информация (Идентификатор магазина, пароль #1)
            // registration info (Merchant ID, password #1)
            
$mrh_login mrh_login;
            
$mrh_pass1 mrh_pass1;

            
// номер заказа
            // number of order
            
$inv_id $order;

            
// описание заказа
            // order description
            
$host $_SERVER['HTTP_HOST'];
            
$inv_desc "Заказ №$order на сайте \"библиотекикоролёва.рф\"";

            
// сумма заказа
            // sum of order
            
$out_summ $sum;

            
// тип товара
            // code of goods
            //$shp_item = 1;

            // предлагаемая валюта платежа
            // default payment e-currency
            
$in_curr "BANKOCEAN2R";

            
// язык
            // language
            
$culture "ru";

            
// кодировка
            // encoding
            
$encoding "utf-8"

            
// Адрес электронной почты покупателя
            // E-mail
            //$userEmail = ...

            // Срок действия счёта
            // Expiration Date

            //$ExpirationDate = "2029-01-16T12:00";
            
$ExpirationDate Date("Y-m-d",time()+24*3600)."T12:00";

            
// Валюта счёта
            // OutSum Currency
            //$OutSumCurrency = "USD";

            // формирование подписи
            // generate signature
            //$Receipt2 = URLencode($Receipt);
            
$crc  md5("$mrh_login:$out_summ:$inv_id:$Receipt:$mrh_pass1");

            
// форма оплаты товара
            // payment form
            
print
            
"<form name=payForm action='https://auth.robokassa.ru/Merchant/Index.aspx' method=POST>".
            
"<input type=hidden name=MerchantLogin value=$mrh_login>".
            
"<input type=hidden name=OutSum value=$out_summ>".
            
"<input type=hidden name=InvId value=$inv_id>".
            
"<input type=hidden name=Receipt value='$Receipt'>".
            
"<input type=hidden name=Description value='$inv_desc'>".
            
"<input type=hidden name=SignatureValue value=$crc>".
            
//"<input type=hidden name=Shp_item value='$shp_item'>".
            
"<input type=hidden name=IncCurrLabel value=$in_curr>".
            
"<input type=hidden name=Culture value=$culture>".
            
            
//"<input type=hidden name=Email value=$userEmail>".
            
"<input type=hidden name=ExpirationDate value=$ExpirationDate>";
            
//if (mrh_test_mode==1) print "<input type=hidden name=IsTest value=1>";
            //"<input type=hidden name=OutSumCurrency value=$OutSumCurrency>".
            //"<input type=submit value='Оплатить'>".
            //print "<input type=submit value='Оплатить доступ на ".PAY_PERIOD." мес. (".PAY_SUM." руб.)'>".
               
"</form>";
               exit(
0);

        }
        else
            die(
"OK");
    }
}


$mrh_pass1 mrh_pass1// merchant pass1 here

// HTTP parameters:
if (isset($_REQUEST["InvId"]))
{
    
$out_summ $_REQUEST["OutSum"];
    
$inv_id $_REQUEST["InvId"];
    
$crc $_REQUEST["SignatureValue"];
    
$crc strtoupper($crc);  // force uppercase

    // build own CRC
    
$my_crc strtoupper(md5("$out_summ:$inv_id:$mrh_pass1"));

    if (
$my_crc != $crc) die("bad SignatureValue\n");

    
$_SESSION['order'] = 0;
    
$order $inv_id;
}
else
if (isset(
$_GET['order']))
{
    
$order intval($_GET['order']);
    
$code _GET_('code');

    if (
GenOrderProtectionCode($order) != $code) die("ERROR: Доступ закрыт");
    
$_SESSION['order'] = $order;
}
else
{
    
$order = isset($_SESSION['order']) ? intval($_SESSION['order']) : 0;
    if (
$order == 0) die("ERROR: Неверный номер заказа");
}


TOP(-1);


LEFTCOLUMN();
CHANNELS();


MAINCOLUMN();


$mysql mysqlopen();

$result mysqli_query($mysql,
                        
"SELECT
                            `id`,
                            `payer`,
                            `date`,
                            IF(`payDate` IS NULL,0,1) as `payed`
                        FROM
                            libOrders
                        WHERE
                            `id`=
$order
                        LIMIT 1"
);
if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");
if (!(
$row mysqli_fetch_assoc($result)))
{
    
mysqli_free_result($result);

    print 
"<h1>Заказ $order</h1>\n";
    print 
"<br><br><center>Заказ не найден</center>\n";

    
MIDDLECOLUMN2();
    print 
"<center><table><tr><td>";
    
ACTUALLINKS('actualLinksH');
    print 
"</tr></td></table></center>";
    
FAQ();

    
MIDDLECOLUMN();
    
CHANNELS("channelBlockH");
    
RIGHTCOLUMN();

    
ACTUALLINKS();
    
FAQ();
    
BOTTOM();
    exit(
0);
}


print 
"<h1>Заказ $order от ".SQLtoDate($row['date'])."</h1>\n";


if (
$row['payed']==1)
{
    

    print 
"<br><br><center style='font-size:22px'>Заказ оплачен!</center><br><br>\n";

    print 
"<center>Чтобы воспользоваться оплаченной услугой, назовите библиотекарю имя <b>"._html_($row['payer'])."</b></center><br><br>";

    
mysqli_free_result($result);

    
MIDDLECOLUMN2();
    print 
"<center><table><tr><td>";
    
ACTUALLINKS('actualLinksH');
    print 
"</tr></td></table></center>";
    
FAQ();

    
MIDDLECOLUMN();
    
CHANNELS("channelBlockH");
    
RIGHTCOLUMN();

    
ACTUALLINKS();
    
FAQ();
    
BOTTOM();
    exit(
0);
}

$payer $row['payer'];
mysqli_free_result($result);


?>


<center>
    <table width=90% style='min-width:600' border=1 bordercolor=#999999 cellspacing=0 cellpadding=4>
    <tr>
        <th width=70%>Назначение</th>
        <th width=10%>Цена<br>руб.</th>
        <th width=10%>Кол-во</th>
        <th width=10%>Сумма<br>руб.</th>
    </tr>

<?php
$mysql 
mysqlopen();


            
// удалить из заказа прошедшие события
            
$result mysqli_query($mysql"SELECT
                                                libOrderItems.`id`
                                            FROM
                                                libOrderItems, libEvents
                                            WHERE
                                                libOrderItems.`order`=
$order AND
                                                libOrderItems.`itemType`=1 AND
                                                libOrderItems.`item`=libEvents.`id` AND
                                                DATEDIFF(NOW(), libEvents.`date`) > 0"
);
            if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");

            
$list "";
            while(
$row mysqli_fetch_row($result))
            {
                if (
$list!=""$list.=",";
                
$list.=$row[0];
            }
            
mysqli_free_result($result);

            if (
$list!="")
            {
                
mysqli_query($mysql"DELETE FROM libOrderItems WHERE `id` in ($list)");
                if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");
            }


$result mysqli_query($mysql,
                                
"SELECT
                                    `id`,
                                    `desc`,
                                    `count`,
                                    `price`
                                FROM
                                    libOrderItems
                                WHERE
                                    libOrderItems.`order`=
$order
                                ORDER BY `id` ASC"
);
if (
mysqli_errno($mysql)) die("ERROR: ".mysqli_error($mysql)." at line ".__LINE__." of file ".__FILE__."\n");

$total 0;
$items = array();

while(
$row mysqli_fetch_assoc($result))
{
    
$id intval($row['id']);
    
$price floatval($row['price']);
    
$count intval($row['count']);

    print 
"<tr id=row$id>\n";
    print 
"<td>".$row['desc']."</td>\n";
    print 
"<td nowrap align=right>$price</td>\n";
    print 
"<td><input id=cnt$id onchange='setCount(this,$id)' type=number minvalue=0 maxvalue=100000 value=$count style='width:100%;min-width:70;text-align:center'></td>\n";

    
$sum $price $count;
    
$total+=$sum;
    print 
"<td nowrap align=right id=sum$id>$sum</td>\n";
    print 
"</tr>\n";

    
array_push($items, array('id'=>$id'price'=>$price'count'=>$count));
}

print 
"<tr><td colspan=3 align=right style='font-weight:bold;font-style:italic'>Итого:</td><td id=totalSum nowrap style='font-weight:bold' align=right>$total</td></tr>\n";
?>
</table>
<br><br>
<center style='padding:10 10 10 10;background-color:#cccccc;border:solid 1px #666666;border-radius:15px'>Представьтесь: <input id=payer style='width:500' placeholder="Иванов Иван" value="<?php 
if (($payer=="" || $payer==null) && isset($_COOKIE['payer'])) print _input_($_COOKIE['payer']);
else
    print 
_input_($payer);
?>"><br>
<font style='font-size:12px'>Чтобы потом воспользоваться платной услугой необходимо назвать библиотекарю указанное имя.</font>
</center>
<br><br>

<center>
<input type=button id=payBtn class=dlgBtn value='Оплатить' style='width:300px; height:60px; font-size:16px' onclick='doPay()'>
</center>

<div id=payDiv></div>

<script>

items = <?php print json_encode($items); ?>;

function updateTotalSum()
{
    var total = 0.0;
    for(var i=items.length-1; i>=0; i--)
    {
        var id = items[i].id;
        var n = parseInt(document.getElementById('cnt'+id).value);
        if (isNaN(n)) n = 1;
        else
        if (n<=0)
        {
            var tr = document.getElementById('row'+id);
            tr.parentNode.removeChild(tr);

            items.splice(i, 1);
        }
        else
        {
            var sum = n * items[i].price;
            document.getElementById('sum'+id).innerHTML = sum;
            total+=sum;
        }    
    }
    document.getElementById('totalSum').innerHTML=total;
    if (items.length == 0) location="index.php";
}

function _setCount(id, n)
{
    sendXHR('api.php','action=shop:setcount&id='+id+'&n='+n,
        function(html)
        {
            updateTotalSum();
        },
        function(error)
        {
            errorBox(error);
        });
}

function setCount(input, id)
{
    var n = parseInt(input.value);
    if (isNaN(n)) n = 1;
    else
    if (n<=0)
    {
        yesNoDialog('Удалить данную позицию из заказа?','Удаление',
            function()
            {
                _setCount(id, n);
            },
            function()
            {
                input.value = 1;
                _setCount(id, 1);
            });
    }
    else
        _setCount(id, n);
}


function doPay()
{
    var payer = document.getElementById('payer').value.trim();

    if (payer == '')
    {
        errorBox("Представьтесь, пожалуйста!", function()
            {
                document.getElementById('payer').focus();
            });
        return;
    }


    var post = 'action=shop:pay';
    post+='&payer='+encodeURIComponent(payer);


    document.getElementById('payBtn').disabled = true;
    sendXHR('basket.php',post,
        function(response)
        {
            console.log(response);
            <?php
            
if (KASSA == "ROBOKASSA")
            {
            
?>
            document.getElementById('payDiv').innerHTML = response;
            document.forms['payForm'].submit();
            <?php
            
}
            else
            {
            
?>
            location = "pay.php";
            <?php
            
}
            
?>
        },
        function(error)
        {
            errorBox(error);
            document.getElementById('payBtn').disabled = false;
        });
}
</script>



<br>

<?php 
if (AdminAuth())
{
?>
<h2>Ссылка на страницу оплаты:</h2>
<script type="text/javascript" src="qrcode.js"></script>

<center><div id="qrcode" style="width:320px; height:320px; margin-top:15px;"></div></center>


<?php
    $code 
GenOrderProtectionCode($order);
    
$link GetSiteURL()."/basket.php?order=$order&code=$code";

    print 
"<br><center><a href='$link'>$link</a></center>";
?>

<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
    width : 320,
    height : 320
});
qrcode.makeCode("<?php print $link?>");
</script>

<?php
}
?>


<?php
MIDDLECOLUMN2
();
    print 
"<center><table><tr><td>";
    
ACTUALLINKS('actualLinksH');
    print 
"</tr></td></table></center>";
    
FAQ();

    
MIDDLECOLUMN();
    
CHANNELS("channelBlockH");
    
RIGHTCOLUMN();

    
ACTUALLINKS();
    
FAQ();
    
BOTTOM();
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0055 ]--