2025-06-16 18:28:08 +05:00

42 lines
1.4 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
switch( @$_POST['act'] ) {
case 'get_bank':
unset ( $_POST['act'] );
$bank = $db -> get_val ( 'bic', $_POST, 'bank' );
if ( $bank )
echo '<div class="alert alert-success" role="alert">' . $bank . '</div>';
else
echo '<div class="alert alert-danger" role="alert">Банк не найден</div>';
break;
case 'add_org':
unset ( $a );
//Узнаем по ИНН - может такая организация уже добавлена
$a['inn'] = $_POST['inn'];
$id=$db->get_val('org_list', $a, 'id');
if($id)die('<div class="alert alert-danger" role="alert">Эта организация уже присутствует в Базе данных, запросите у администратора доступ</div>');
$a['type_org'] = $_POST['type_org'];
$a['short_name'] = $_POST['short_name'];
$a['long_name'] = $_POST['long_name'];
$a['kpp'] = $_POST['kpp'];
$a['ogrn'] = $_POST['ogrn'];
$a['data'] = base64_encode ( serialize ( $_POST ) );
$db->add('org_list', $a);
$c['inn']=$a['inn'];
$id = $db->get_val('org_list', $c, 'id');
unset ($b);
$b['user_id']=$_SESSION['user_id'];
$b['org_list']=$id;
$db->add('users_org', $b);
echo '<div class="alert alert-success" role="alert">Организация успешно добавлена</div>';
break;
default:
}
?>