require_once("engine/config.php");
require_once("lang/$id_lang.inc");
require_once("cccconnfig.php");
$tit = 'Параметры настройки оборудования';
$root_menu = '
';
$connect_str = "host=$c_host user=$c_user2 password=$c_password2 dbname=$c_dbname2 port=$c_port2";
if (isset($_GET['ds_id']))
{
$_GET['ds_id'] = Del_hacks($_GET['ds_id'], 'int');
$link2 = pg_connect ($connect_str);
pg_set_client_encoding($link2, UTF8);
$q = pg_query($link2, "SELECT ds_file, ds_filename FROM description_files WHERE ds_id='".pg_escape_string($_GET['ds_id'])."'");
if($q)
{
$r = pg_fetch_array($q);
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$r['ds_filename'].'"');
echo pg_unescape_bytea($r['ds_file']);
die();
}
else{
die("Server error\n
';
$res3 = pg_query($link2, "SELECT m_id, ds_id, h_comment FROM helps WHERE h_id=$_GET[h_id]");
$ds_id = pg_fetch_result($res3,0,'ds_id');
$main .= '
Модель: '.pg_fetch_result(pg_query($link2, "SELECT m_name FROM models WHERE m_id=".pg_fetch_result($res3,0,'m_id')),0,'m_name').'
';
$res4 = pg_query($link2, "SELECT ds_id, ds_comment FROM description_files WHERE h_id=$_GET[h_id]");
if (pg_num_rows($res4) > 0)
{
while($my = pg_fetch_array($res4))
{
$main .= '
Файл:
'.$my['ds_comment'].'';
}
}
/*
if (!empty($ds_id))
{
$res4 = pg_query($link2, "SELECT ds_id, ds_comment FROM description_files WHERE ds_id=$ds_id");
if (pg_num_rows($res4) > 0)
$main .= '
Файл:
'.@pg_fetch_result($res4,0,'ds_comment').'';
}
*/
$main .= nl2br(pg_fetch_result($res3,0,'h_comment')).'
';
$main .='
';
$res3 = pg_query($link2, "SELECT h_id, h_name FROM helps WHERE isp_id=$_GET[isp_id]");
if (pg_num_rows($res3) > 0)
{
$main .= '
Инструкции:';
while($my = pg_fetch_array($res3))
{
$main .= '
'.$my['h_name'].'';
}
}
$main .='