<?php
include '../wap/config.php';
if ($id==0) exit;
if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass"))) {
echo ("пЫЙВЛБ РПДЛМАЮЕОЙС Л вд!\n");
exit;
};
if ($delete==1) {
pg_query($conn, "delete from downloads where midi=$id;");
pg_query($conn, "delete from midi where id=$id;");
pg_close($conn);
header("Location: files.php");
exit;
}
if (($name_eng=='')||($path=='')) {
print "<html><head><title>пЫЙВЛБ</title></head><body>оЕ ЧУЕ ДБООЩЕ ЧЧЕДЕОЩ</body></html>";
pg_close($conn);
exit;
}
if ($enabled=='') $enabled=0;
$res=pg_query($conn,"SET CLIENT_ENCODING TO 'KOI8';");
$res=pg_query($conn,"update midi set name_eng='$name_eng',name_rus='$name_rus',category='$category',path='$path',enabled='$enabled' where id='$id';");
header("Location: files.php");
pg_close($conn);
?>