Ejemplo n.º 1
0
 /**
  * Вывод страницы по сбербанку - "Квитанция сбербанка".
  */
 public function sberAction()
 {
     front::og('tpl')->page = 'index';
     front::og('tpl')->script = '/scripts/bill2.js';
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/bank_payments.php';
     $fm_val = '';
     /*
      * Берем данные по предыдущему переводу, если он есть
      */
     $bp = new bank_payments();
     if ($id = __paramInit('int', null, 'id')) {
         // редактируется.
         front::og('tpl')->edit = 1;
         $bp->GetRow($id, " AND user_id = {$this->uid}");
         $fm_val = $bp->sum / EXCH_TR;
         if (!$bp->id) {
             exit;
         }
     } else {
         // если нет, новый счет.
         $bp->bank_code = __paramInit('int', null, 'bc', bank_payments::BC_SB);
         $bp->sum = __paramInit('float', null, 'Sum');
         $bp_reqv = bank_payments::GetLastReqv($bp->bank_code, $this->uid);
         $bp->fio = $bp_reqv['fio'];
         $bp->address = $bp_reqv['address'];
     }
     if (!$bp->bill_num) {
         $bp->bill_num = bank_payments::GenBillNum($bp->bank_code, $this->uid, $this->account->id);
     }
     $bank = bank_payments::GetBank($bp->bank_code);
     if ($bp->accepted_time) {
         exit;
     }
     // подтверженные счета (уже перевели деньги) нельзя изменять.
     if ($_POST['act']) {
         $bp = new bank_payments();
         $bp->fio = substr(__paramInit('string', null, 'fio'), 0, 128);
         $bp->is_gift = false;
         $bp->address = substr(__paramInit('string', null, 'address'), 0, 255);
         $bp->bank_code = __paramInit('int', null, 'bc');
         $bp->sum = __paramInit('float', null, 'sum');
         setlocale(LC_ALL, 'en_US.UTF-8');
         // гребанная бета! (это не мое)
         $bp->fm_sum = $bp->sum / EXCH_TR;
         $id = __paramInit('int', null, 'id');
         /*
          * Проверка ошибок
          */
         if (!$bp->fio) {
             $alert['fio'] = 'Поле заполнено некорректно.';
         }
         if (!$bp->address) {
             $alert['address'] = 'Поле заполнено некорректно.';
         }
         if (!$bp->sum || $bp->sum < 0.01) {
             $alert['sum'] = 'Поле заполнено некорректно.';
         }
         //if($alert) break;
         if (!$alert) {
             if ($id) {
                 $bp->bank_code = null;
                 $bp->Update($id, " AND user_id = {$this->uid} AND accepted_time IS NULL");
             } else {
                 $bp->bill_num = bank_payments::GenBillNum($bp->bank_code, $this->uid, $this->account->id);
                 $bp->user_id = $this->uid;
                 $bp->op_code = 12;
                 $id = $bp->Add($error, true);
             }
             if (!$error) {
                 header('Location: /' . $this->name_page . "/print/{$id}/");
                 exit;
             }
         }
         front::og('tpl')->alert = $alert;
     }
     front::og('tpl')->bp = $bp;
     front::og('tpl')->fm_val = $fm_val;
     front::og('tpl')->display('bill/bill_sber.tpl');
 }
Ejemplo n.º 2
0
 /**
  * Выписывает счет для резервирования по безналу. Если счет на данную сделку уже существует и еще не принят, то реквизиты просто обновляются.
  * 
  * @param int     $form_type 1:юр. лицо, 2:физ. лицо.
  * @param array   $request   данные с реквизитами счета.
  * @param account $account   инициализированный экземпляр класса account текущего пользователя.
  *
  * @return bool успешно?
  */
 public function invoiceBank($form_type, $request, $account)
 {
     if ($form_type == self::FT_JURI) {
         $reqv = new reqv_ordered();
         $reqv->BindRequest(array_map('stripslashes', $request['ft' . self::FT_JURI]));
         if (!($this->error['reqv'] = $reqv->CheckInput(true))) {
             $reqv->user_id = $this->uid;
             $reqv->ammount = $this->reserve_sum;
             $reqv->op_code = self::OP_RESERVE;
             $reqv->op_date = 'now()';
             $reqv->sbr_id = $this->id;
             if ($reqv->id) {
                 $reqv->Update($reqv->id, "AND user_id = {$this->uid} AND payed_time IS NULL");
             } else {
                 unset($reqv->id);
                 $reqv->id = $reqv->Add($err, true);
             }
         }
     } elseif ($form_type == self::FT_PHYS) {
         $reqv = new bank_payments();
         $reqv->BindRequest(array_map('stripslashes', $request['ft' . self::FT_PHYS]));
         $reqv->sum = $this->reserve_sum;
         if (!($this->error['reqv'] = $reqv->CheckInput(true))) {
             $bank = $reqv->GetBank($reqv->bank_code);
             $reqv->bill_num = $bank['prefix'] . '-' . $this->getContractNum();
             // обновляем номер, т.к. схема может поменяться.
             $done = false;
             if (!$reqv->id) {
                 $reqv->user_id = $this->uid;
                 $reqv->op_code = self::OP_RESERVE;
                 $reqv->sbr_id = $this->id;
                 @($reqv->id = $reqv->Add($error, true));
                 if ($error || $reqv->id <= 0) {
                     // конфликт ключей, пытаемся обновить (с двух браузеров можно воспроизвести).
                     $reqv->id = null;
                     $this->getInvoiceReqv($form_type);
                     if ($this->reqv[sbr::FT_PHYS] && $this->reqv[sbr::FT_PHYS]->sbr_id == $this->id) {
                         $reqv->id = $this->reqv[sbr::FT_PHYS]->id;
                     }
                     $this->reqv = array();
                 } else {
                     $done = true;
                 }
             }
             if ($reqv->id && !$done) {
                 $reqv->bank_code = null;
                 $reqv->invoiced_time = 'now()';
                 $reqv->Update($reqv->id, " AND user_id = {$this->uid} AND accepted_time IS NULL");
             }
         }
     }
     $this->reqv[(int) $form_type] = $reqv;
     if ($this->error['reqv']['address']) {
         $this->error['reqv']['address'] = array('На этот адрес будут высланы все документы', 'Пример: ул. Самокатная, 1, стр. 21');
     }
     if (!$this->error['reqv'] && $request['save_finance']) {
         //@todo: запрещаем изменять финансы в старой СБР #29196
         $err = 'Прекращена поддержка СБР.';
         //parent::setUserReqv($this->uid, NULL, $form_type, $request['ft'.$form_type], $this->checkChangeFT());
         if ($err) {
             $this->error['reqv'] = $err;
         }
     }
     return !$this->error['reqv'];
 }
Ejemplo n.º 3
0
 /**
  * Уведомления обоим участникам о том, что деньги зарезервированы.
  * @param array $events   информация по событиям (если событий нескольлко, то содержит несколько элементов).
  */
 function SbrReserved($events)
 {
     $ev0 = $events[0];
     $url = $GLOBALS['host'] . '/' . sbr::NEW_TEMPLATE_SBR . '/';
     include_once dirname(__FILE__) . '/account.php';
     include_once dirname(__FILE__) . '/bank_payments.php';
     $reserved = account::getOperationInfo($ev0['reserved_id']);
     for ($e = 0; $e < 2; $e++) {
         $r = $e ? 'e_' : 'f_';
         $rcls = $e ? 'sbr_emp' : 'sbr_frl';
         $sbr = new $rcls($ev0[$r . 'uid'], $ev0[$r . 'login']);
         $sbr_name = sbr_meta::getNameForMail($ev0, 'sbr');
         $cnum = $sbr->getContractNum($ev0['sbr_id'], $ev0['scheme_type'], $ev0['posted']);
         $num = in_array((int) $reserved['payment_sys'], array(4, 5)) ? (int) $reserved['payment_sys'] == 4 ? '№ Б-' . $cnum : '№ ' . bank_payments::GetBillNum($ev0['reserved_id']) : '';
         $num_str = in_array((int) $reserved['payment_sys'], array(4, 5)) ? 'по счету ' . $num : '';
         if ($r == 'e_') {
             $fuserlink = $GLOBALS["host"] . "/users/" . $ev0['f_login'];
             $msg_e = "Информируем Вас о том, что деньги в Сделке «<a href='{$url}?id={$ev0['sbr_id']}{$this->_addUrlParams('e', '&')}'>{$sbr_name}</a>» успешно зарезервированы. Исполнителю <a href='{$fuserlink}'>{$ev0['f_uname']} {$ev0['f_usurname']}</a> [<a href='{$fuserlink}'>{$ev0['f_login']}</a>] отправлено уведомление о том, что ему необходимо начать выполнение работы по заданию.";
             $this->subject = "Денежные средства для {$cnum} зарезервированы";
             $this->message = $this->splitMessage($this->GetHtml($ev0['e_uname'], $msg_e, array('header' => 'simple', 'footer' => 'norisk_robot')));
             $this->recipient = $ev0['e_uname'] . " " . $ev0['e_usurname'] . " [" . $ev0['e_login'] . "] <" . $ev0['e_email'] . ">";
             $this->SmtpMail('text/html');
         } else {
             $msg_f = "Информируем Вас о том, что  деньги в Сделке «<a href='{$url}?id={$ev0['sbr_id']}{$this->_addUrlParams('f', '&')}'>{$sbr_name}</a>» успешно зарезервированы.<br/><br/>";
             $msg_f .= "Пожалуйста, приступите к выполнению задания.";
             $this->subject = "Резервирование денег в Безопасной Сделке (проект «{$ev0['sbr_name']}»)";
             $this->message = $this->splitMessage($this->GetHtml($ev0['f_uname'], $msg_f, array('header' => 'simple', 'footer' => 'norisk_robot')));
             $this->recipient = $ev0['f_uname'] . " " . $ev0['f_usurname'] . " [" . $ev0['f_login'] . "] <" . $ev0['f_email'] . ">";
             $this->SmtpMail('text/html');
         }
         /**
          * @deprecated 
          */
         /*
                     if(!$sbr->checkUserReqvs()) {
                         $msg =  "
                           Пожалуйста, внесите все необходимые данные на вкладке «<a href='{$GLOBALS['host']}/users/{$ev0[$r.'login']}/setup/finance/{$this->_addUrlParams($e ? 'e' : 'f')}'>Финансы</a>». Указанные во вкладке реквизиты требуются для составления договора
                           на оказание услуг и являются необходимым условием для работы через сервис «Сделка Без Риска».
                         ";//по проекту «<a href='{$url}?id={$ev0['sbr_id']}'>{$ev0['sbr_name']}</a>»
                         $this->subject = "Заполнение вкладки «Финансы»";
                         $this->message = $this->splitMessage($this->GetHtml($ev0[$r.'uname'], $msg, array('header'=>'simple', 'footer'=>'norisk_robot')));
                         $this->recipient = $ev0[$r.'uname']." ".$ev0[$r.'usurname']." [".$ev0[$r.'login']."] <".$ev0[$r.'email'].">";
                         $this->SmtpMail('text/html');
                     }*/
     }
 }
Ejemplo n.º 4
0
 /**
  * Инициализируем тип оплаты на странице.
  *
  * @todo: более данный механизм не используется, хотя можно было на его базе попробовать использовать ЯДКассу
  * 
  * @param string $type_payment Название тип оплаты (передается в $_GET['type'])
  */
 public function setPaymentMethod($type_payment)
 {
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/exrates.php';
     switch ($type_payment) {
         case 'sber_print':
             $this->payment_template = 'bank/tpl.bank_fiz_print.php';
             $this->type_menu_block = 'bank';
             $this->payment_type = exrates::BANK;
             break;
         case 'sber':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/bank_payments.php';
             $this->payment_template = 'bank/tpl.bank_fiz.php';
             $this->type_menu_block = 'bank';
             $this->payment_type = exrates::BANK;
             $this->pm = new bank_payments();
             $this->pm->bank_code = __paramInit('int', null, 'bc', bank_payments::BC_SB);
             $this->pm->sum = __paramInit('float', null, 'Sum');
             $bp_reqv = bank_payments::GetLastReqv($this->pm->bank_code, $this->user['uid']);
             $this->pm->fio = $bp_reqv['fio'];
             $this->pm->address = $bp_reqv['address'];
             if (!$this->pm->bill_num) {
                 $this->pm->bill_num = bank_payments::GenBillNum($this->pm->bank_code, $this->user['uid'], $this->acc['id']);
             }
             if (isset($_POST['action']) && $_POST['action'] == 'payment') {
                 $this->pm->fio = substr(__paramInit('string', null, 'fio'), 0, 128);
                 $this->pm->is_gift = false;
                 $this->pm->address = substr(__paramInit('string', null, 'address'), 0, 255);
                 $this->pm->bank_code = __paramInit('int', null, 'bc');
                 $this->pm->sum = __paramInit('float', null, 'sum');
                 setlocale(LC_ALL, 'en_US.UTF-8');
                 // гребанная бета! (это не мое)
                 $this->pm->fm_sum = $bp->sum / EXCH_TR;
                 $id = __paramInit('int', null, 'id');
                 if ($this->pm->sum < 10) {
                     $alert['sum'] = 'Минимальная сумма платежа 10 рублей';
                 }
                 if (!$this->pm->fio) {
                     $alert['fio'] = 'Поле заполнено некорректно.';
                 }
                 if (!$this->pm->address) {
                     $alert['address'] = 'Поле заполнено некорректно.';
                 }
                 if (!$alert) {
                     if ($id) {
                         $this->pm->bank_code = null;
                         $this->pm->Update($id, " AND user_id = {$this->user['uid']} AND accepted_time IS NULL");
                     } else {
                         $this->pm->bill_num = bank_payments::GenBillNum($this->pm->bank_code, $this->user['uid'], $this->acc['id']);
                         $this->pm->user_id = $this->user['uid'];
                         $this->pm->op_code = 12;
                         $id = $this->pm->Add($error, true);
                     }
                     if (!$error) {
                         $prepare = $this->preparePayments($this->getTotalAmmountOrders());
                         if ($prepare) {
                             header("Location: /bill/payment/print/?type=sber_print&id={$id}");
                             exit;
                         }
                     }
                 }
                 $this->error = $alert;
             }
             $this->bank = bank_payments::GetBank($bp->bank_code);
             break;
         case 'bank_print':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv_ordered.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
             if ($_GET['order'] > 0) {
                 $this->payment_template = 'bank/tpl.bank_jur_transfer.php';
                 $this->tid = intval($_GET['order']);
             } else {
                 $this->payment_template = 'bank/tpl.bank_jur_print.php';
             }
             $this->type_menu_block = 'bank';
             $this->payment_type = exrates::BANK;
             $this->bank_sum = $_SESSION['sum_bank_print'];
             $this->bank_id = $_SESSION['id_bank_print'];
             unset($_SESSION['sum_bank_print'], $_SESSION['id_bank_print']);
             break;
         case 'bank':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reqv_ordered.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
             $this->payment_template = 'bank/tpl.bank_jur.php';
             $this->type_menu_block = 'bank';
             $this->payment_type = exrates::BANK;
             $this->pm = new reqv();
             $reqvByUid = $this->pm->GetByUid($this->user['uid']);
             $reqvs_ord = new reqv_ordered();
             $this->pm->billNum = sizeof($reqvs_ord->GetByUid($this->user['uid']));
             $this->pm->BindRequest($reqvByUid[0]);
             if (isset($_POST['action']) && $_POST['action'] == 'payment') {
                 $_POST['country'] = country::getCountryName($_POST['country_db_id']);
                 $_POST['city'] = city::getCityName($_POST['city_db_id']);
                 $this->pm->BindRequest($_POST);
                 $this->error = $this->pm->CheckInput();
                 if ($_POST['sum'] < 10) {
                     $this->error['sum'] = 'Минимальная сумма платежа 10 рублей';
                 }
                 if (!$this->error) {
                     $this->pm->user_id = $this->user['uid'];
                     if ($reqvByUid[0]['id'] > 0) {
                         $id = $reqvByUid[0]['id'];
                         $this->pm->Update($id, " AND user_id= {$this->user['uid']}");
                     } else {
                         $id = $this->pm->Add($err, true);
                     }
                     $prepare = $this->preparePayments($this->getTotalAmmountOrders());
                     if ($prepare) {
                         $_SESSION['id_bank_print'] = $id;
                         $_SESSION['sum_bank_print'] = intval($_POST['sum']);
                         header('Location: /bill/payment/print/?type=bank_print');
                         exit;
                     }
                 }
             }
             break;
         case 'alphabank':
             $this->payment_template = 'bank/tpl.alphabank.php';
             $this->type_menu_block = 'bank';
             $this->payment_type = exrates::BANK;
             if (isset($_POST['action']) && $_POST['action'] == 'reserve') {
                 header('Location: /bill/');
                 exit;
             }
             break;
         case 'card':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/settings.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/card_account.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/cardpay.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr_meta.php';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/onlinedengi_cards.php';
             $this->payment_template = 'card/tpl.card.php';
             $this->type_menu_block = 'card';
             $this->payment_type = exrates::CARD;
             $this->card_merchant = settings::GetVariable('billing', 'card_merchant');
             if ($this->card_merchant) {
                 $card_account = new card_account();
                 $card_account->account_id = $this->acc['id'];
                 $this->pm = new onlinedengi_cards();
                 if (!$this->not_init_pm) {
                     $this->pm->order_id = $card_account->Add();
                 }
             } else {
                 $this->pm = new card_account();
                 $this->pm->account_id = $this->acc['id'];
                 if (!$this->not_init_pm) {
                     $this->pm->order_id = $this->pm->Add();
                 }
                 $this->pm->reqv = sbr_meta::getUserReqvs($this->user['uid']);
             }
             break;
         case 'qiwi':
             $this->payment_template = 'terminal/tpl.qiwi.php';
         case 'svyasnoy':
             $this->payment_template = $this->payment_template ? $this->payment_template : 'terminal/tpl.svyasnoy.php';
         case 'euroset':
             $this->payment_template = $this->payment_template ? $this->payment_template : 'terminal/tpl.euroset.php';
             $this->type_menu_block = 'terminal';
             $this->payment_type = exrates::OSMP;
             if ($_POST['action'] == 'osmp') {
                 $prepare = $this->preparePayments($this->getTotalAmmountOrders());
                 if (!$this->test && $prepare !== false) {
                     header('Location: /bill/');
                     exit;
                 }
             } else {
                 $this->error = 'Ошибка создания списка оплаты';
             }
             break;
         case 'megafon_mobile':
             $this->payment_template = 'mobile/tpl.m_megafon.php';
         case 'beeline_mobile':
             $this->payment_template = $this->payment_template ? $this->payment_template : 'mobile/tpl.m_beeline.php';
         case 'mts_mobile':
             $this->payment_template = $this->payment_template ? $this->payment_template : 'mobile/tpl.m_mts.php';
         case 'matrix_mobile':
             $this->payment_template = $this->payment_template ? $this->payment_template : 'mobile/tpl.m_matrix.php';
             $this->type_menu_block = 'mobilesys';
             $this->payment_type = exrates::MOBILE;
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/qiwipay.php';
             $this->pm = new qiwipay($this->user['uid']);
             if ($_POST['operator'] == 'megafon' || $_POST['operator'] == 'beeline' || $_POST['operator'] == 'mts' || $_POST['operator'] == 'matrix') {
                 $phone = __paramValue('string', $_POST['phone']);
                 $phone = str_replace(array('+7', '+77'), '', $phone);
                 $err = 0;
                 switch ($_POST['operator']) {
                     case 'megafon':
                         if (!(strpos($phone, '34') === 0 || strpos($phone, '62') === 0 || strpos($phone, '82') === 0 || strpos($phone, '92') === 0 || strpos($phone, '35') === 0 || strpos($phone, '63') === 0 || strpos($phone, '83') === 0 || strpos($phone, '93') === 0 || strpos($phone, '69') === 0 || strpos($phone, '99') === 0)) {
                             $this->error['phone'] = 'Проверьте, верно ли выбран оператор. Указанный номер не относится в сети Мегафон';
                             $err = 1;
                         }
                         break;
                     case 'beeline':
                         if (!(strpos($phone, '90') === 0 || strpos($phone, '96') === 0)) {
                             $this->error['phone'] = 'Проверьте, верно ли выбран оператор. Указанный номер не относится в сети Beeline';
                             $err = 1;
                         }
                         break;
                     case 'mts':
                         if (!(strpos($phone, '91') === 0 || strpos($phone, '98') === 0)) {
                             $this->error['phone'] = 'Проверьте, верно ли выбран оператор. Указанный номер не относится в сети МТС';
                             $err = 1;
                         }
                         break;
                     case 'matrix':
                         if (!(strpos($phone, '958') === 0)) {
                             $this->error['phone'] = 'Проверьте, верно ли выбран оператор. Указанный номер не относится в сети Matrix';
                             $err = 1;
                         }
                         break;
                 }
                 if (!$err) {
                     $sum = __paramValue('float', $_POST['sum']);
                     $request = array('phone' => $phone, 'sum' => $sum, 'oper_code' => $_POST['operator']);
                     $created = $this->pm->createBill($request);
                     if (!$created) {
                         $prepare = $this->preparePayments($this->getTotalAmmountOrders());
                         if (!$this->test && $prepare !== false) {
                             header('Location: /bill/');
                             exit;
                         }
                     } else {
                         $this->error = $created;
                     }
                 }
             }
             break;
         case 'webpay':
             $this->type_menu_block = 'psys';
             $this->payment_type = exrates::WEBM;
             $this->payment_template = 'psys/tpl.webpay.php';
             break;
         case 'qiwipurse':
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/qiwipay.php';
             $this->pm = new qiwipay($this->user['uid']);
             $this->type_menu_block = 'psys';
             $this->payment_type = exrates::QIWIPURSE;
             $this->payment_template = 'psys/tpl.qiwipurse.php';
             if ($_POST['action'] == 'qiwipurse') {
                 $phone = __paramValue('string', $_POST['phone']);
                 $phone = str_replace(array('+7', '+77'), '', $phone);
                 $sum = __paramValue('float', $_POST['sum']);
                 $request = array('phone' => $phone, 'sum' => $sum);
                 $created = $this->pm->createBill($request);
                 if (!$created) {
                     $prepare = $this->preparePayments($this->getTotalAmmountOrders());
                     if (!$this->test && $prepare !== false) {
                         header('Location: /bill/');
                         exit;
                     }
                 } else {
                     $this->error = $created;
                 }
             }
             break;
         case 'yandex':
             $this->type_menu_block = 'psys';
             $this->payment_type = exrates::YM;
             $this->payment_template = 'psys/tpl.yandex.php';
             break;
         case 'webmoney':
             $this->type_menu_block = 'psys';
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/pmpay.php';
             $this->payment_type = exrates::WMR;
             $this->payment_template = 'psys/tpl.webmoney.php';
             $this->pm = new pmpay();
             break;
         case 'okpay':
             $this->type_menu_block = 'psys';
             $this->payment_type = exrates::OKPAY;
             $this->payment_template = 'psys/tpl.okpay.php';
             break;
     }
     $this->type_payment = $type_payment;
 }
Ejemplo n.º 5
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/static_compress.php";
if (!defined('IN_SBR')) {
    // в СБР уже все есть.
    session_start();
    $uid = get_uid();
    $id = intval($_GET['id']);
    $print_mode = ${$print_mode};
}
if (!$_SESSION['login']) {
    header("Location: /fbd.php");
    exit;
}
$bp = new bank_payments();
if ($id) {
    $bp->GetRow($id, hasPermissions('bankpayments') && hasPermissions('adm') ? '' : " AND user_id = {$uid}");
}
if (!$bp->id) {
    header("Location: /404.php");
    exit;
}
if ($bp->sbr_id) {
    $sbr = new sbr_emp($bp->user_id);
    if ($sbr->initFromId($bp->sbr_id, false, false, NULL, false)) {
        $contract_num = $sbr->getContractNum();
        $sbr_nds = $sbr->getCommNds($sbr_comm);
    }
}
$bp->sum = round($bp->sum, 2);
$sum_rk = preg_split('/[.,]/', $bp->sum);