83 lines
2.8 KiB
PHP
83 lines
2.8 KiB
PHP
|
|
<?php
|
||
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
|
||
|
|
|
||
|
|
$catalog = (int)$_GET['catalog'];
|
||
|
|
|
||
|
|
if ($catalog) {
|
||
|
|
$agent_info = mysql_fetch_assoc(mysql_query("SELECT users.agency_name FROM users
|
||
|
|
JOIN sent_catalog on sent_catalog.agent_id = users.id and sent_catalog.id = $catalog"));
|
||
|
|
|
||
|
|
$agency_name = $agent_info['agency_name'];
|
||
|
|
|
||
|
|
if ($agent_info) {
|
||
|
|
$_SESSION['presentation_complex_agency_name'] = $agency_name;
|
||
|
|
}
|
||
|
|
|
||
|
|
$firstComplex = mysql_fetch_assoc(mysql_query
|
||
|
|
("SELECT cl.id FROM complex_list cl
|
||
|
|
JOIN complex_houses ch ON ch.complex_id = cl.id
|
||
|
|
JOIN complex_entrances ce ON ce.complex_house_id = ch.id
|
||
|
|
JOIN complex_floors cf ON cf.complex_entrance_id = ce.id
|
||
|
|
JOIN complex_rooms cr ON cr.floor_id = cf.id
|
||
|
|
WHERE cr.id IN (SELECT id_object FROM sended_pdf_complexes WHERE sent_catalog_id = $catalog)
|
||
|
|
LIMIT 1"));
|
||
|
|
|
||
|
|
if ($firstComplex) {
|
||
|
|
$id = $firstComplex['id'];
|
||
|
|
|
||
|
|
$firstImage = mysql_fetch_assoc(mysql_query("SELECT image FROM complex_images WHERE complex_id = $id LIMIT 1"));
|
||
|
|
|
||
|
|
if ($firstImage) {
|
||
|
|
$metaImage = $firstImage['image'];
|
||
|
|
$_SESSION['presentation_complex_agency_logo'] = $metaImage;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
$metaImage = $_SESSION['presentation_complex_agency_logo'];
|
||
|
|
$agency_name = $_SESSION['presentation_complex_agency_name'];
|
||
|
|
}
|
||
|
|
|
||
|
|
function getRemoteMimeType($url)
|
||
|
|
{
|
||
|
|
$ch = curl_init($url);
|
||
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||
|
|
curl_exec($ch);
|
||
|
|
|
||
|
|
# get the content type
|
||
|
|
return curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
|
||
|
|
}
|
||
|
|
if ($metaImage) {
|
||
|
|
$imageMemeType = getRemoteMimeType($metaImage);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
?>
|
||
|
|
|
||
|
|
<!doctype html>
|
||
|
|
<html lang="">
|
||
|
|
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8">
|
||
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
|
<?php if ($metaImage) { ?>
|
||
|
|
<meta property="og:image:type" content="<?php echo ($imageMemeType); ?>" />
|
||
|
|
<meta property="og:image:width" content="300" />
|
||
|
|
<meta property="og:image:height" content="300" />
|
||
|
|
<meta property="og:image" itemprop="image" content="<?php echo $metaImage; ?>" />
|
||
|
|
<?php } ?>
|
||
|
|
<meta property="og:description" content="Каталог комплексов" />
|
||
|
|
<meta property="og:title" content="<?php echo $agency_name; ?>" />
|
||
|
|
<meta property="og:type" content="article" />
|
||
|
|
<link rel="icon" href="/presentation-complexes/favicon.ico">
|
||
|
|
<title>Каталог комплексов</title>
|
||
|
|
<script defer="defer" src="/presentation-complexes/js/chunk-vendors.2c0fea7e.js"></script>
|
||
|
|
<script defer="defer" src="/presentation-complexes/js/app.90b61727.js"></script>
|
||
|
|
<link href="/presentation-complexes/css/app.04a00d4e.css" rel="stylesheet">
|
||
|
|
</head>
|
||
|
|
|
||
|
|
<body><noscript><strong>We're sorry but jw_land-main doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript>
|
||
|
|
<div id="app"></div>
|
||
|
|
</body>
|
||
|
|
|
||
|
|
</html>
|