<?
$pass2="password2";
if (isset($ok)):
$ok = $ok == 1 ? "Успешное зачисление средств":"Действие отменено";
?>
<html>
<head>
       <title><?=$ok?></title>
</head>
<body>
<?=$ok?>.<br>
Вы можете закрыть это окно.
</body>
</html>
<?
exit;
endif;
include('connect_to_base.php');
$mycrc=md5("$out_summ:$inv_id:$pass2:shp_item=$shp_item");
if (strcasecmp ($crc,$mycrc)) {
//   $result=mysql_query("update invest_invoice set sum='0', result='!' where id=$inv_id");
   exit ("ERROR - CRC");
}
$result=mysql_query("select user_id from invest_invoice where (id=$inv_id) and (result='0')");
if (mysql_num_rows($result) == 1) {
   list($user_id)=mysql_fetch_row($result);
   if (
    mysql_query("update invest_invoice set sum='$out_summ', result='1' where (id=$inv_id) and (result='0')")
&&  mysql_query("update invest_users set balance=balance+$out_summ where id=$user_id")
   ) {
     echo "OK$inv_id";
     exit;
   }
}
echo "error - DB";
?>
