86 lines
2.7 KiB
PHP
86 lines
2.7 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_agency_name'] = $agency_name;
|
|
}
|
|
|
|
$firstBlockInfo = mysql_fetch_assoc(mysql_query("SELECT blocks.image
|
|
FROM blocks
|
|
LEFT JOIN apartments ON apartments.block_id = blocks.id
|
|
WHERE apartments.id IN (
|
|
SELECT id_object
|
|
FROM sended_pdf_newbuildings
|
|
WHERE sent_catalog_id = $catalog
|
|
)
|
|
GROUP BY blocks.id
|
|
ORDER BY blocks.id
|
|
LIMIT 1"));
|
|
|
|
if ($firstBlockInfo) {
|
|
$metaImage = $firstBlockInfo['image'];
|
|
|
|
$_SESSION['presentation_agency_logo'] = $metaImage;
|
|
}
|
|
} else {
|
|
$metaImage = $_SESSION['presentation_agency_logo'];
|
|
$agency_name = $_SESSION['presentation_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="ru">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
<meta name="description" content="Каталог новостроек" />
|
|
<meta name="keywords" content="" />
|
|
<?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="shortcut icon" type="image/x-icon" href="/presentation-vue/favicon.ico" />
|
|
<link rel="icon" href="/presentation-vue/favicon.ico" />
|
|
<title>JoyWork</title>
|
|
</head>
|
|
|
|
<script defer="defer" src="/presentation-vue/js/chunk-vendors.fe0488a6.js"></script>
|
|
<script defer="defer" src="/presentation-vue/js/app.6304af73.js"></script>
|
|
<link href="/presentation-vue/css/app.23421a69.css" rel="stylesheet">
|
|
|
|
<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>
|