- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
<?php
$tmp = mcc_get_contacts();
if (!empty($tmp)) {
$i = 0;
foreach ($tmp as $k => $v) {
if (empty($v['coords'])) {
echo '<div class="s_adr" style="width: 275px;">' . "\r\n";
echo 'г. <span>' . $v['city'] . '</span><br /><br />' . "\r\n";
if (!empty($v['telfax'])) foreach ($v['telfax'] as $v_t) {
echo 'Тел/факс: <span>' . $v_t . '</span><br />' . "\r\n";
}
if (!empty($v['tel'])) foreach ($v['tel'] as $v_t) {
echo 'Телефон: <span>' . $v_t . '</span><br />' . "\r\n";
}
echo 'e-mail: <a href="mailto:' . $v['email'] . '">' . $v['email'] . '</a><br />' . "\r\n";
echo '</div>' . "\r\n";
} else {
echo '<div class="s_cont">' . "\r\n";
if ($i === 0) {
echo '<div class="print-icon"><a href="#print" onclick="window.print(); return false;">Печать</a></div>' . "\r\n";
}
echo '<div class="map" id="map' . $k . '">' . $v['coords'] . '</div>' . "\r\n";
echo '<div class="s_adr" >' . "\r\n";
echo 'г. <span>' . $v['city'] . '</span><br /><br />' . "\r\n";
echo '<p>';
if (!empty($v['telfax'])) foreach ($v['telfax'] as $v_t) {
echo 'Тел/факс: <span>' . $v_t . '</span><br />' . "\r\n";
}
if (!empty($v['tel'])) foreach ($v['tel'] as $v_t) {
echo 'Телефон: <span>' . $v_t . '</span><br />' . "\r\n";
}
echo 'e-mail: <a href="mailto:' . $v['email'] . '">' . $v['email'] . '</a></p>' . "\r\n";
echo '<p>';
if (!empty($v['metro'])) {
echo 'м. "' . implode('" / "', $v['metro']) . '",<br />' . "\r\n";
}
echo $v['address'] . '</p>' . "\r\n";
echo '</div>' . "\r\n";
echo '</div>' . "\r\n";
echo '<div class="hr"></div>' . "\r\n";
}
$i++;
}
}
?>
<div class="hr"></div>
<script src="<?php bloginfo('stylesheet_directory'); ?>/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAY78XWK5-Zy3qhkiV3w_m0hTPoZqTU4uhKIMSNHImBFQOd4WjahSr_Q8JwRSdhkeCWJkgoFFnVWj2Aw" type="text/javascript"></script>
<script type="text/javascript"><!--
$(document).ready(function(){
var show_map = function(o, p3, p2, p1, p0, p4) {
if (o.length) {
o.empty().show();
var s = $('<img class="print" />').attr('alt', '');
s.attr('src', 'http://maps.google.com/staticmap?center=' + p0 + ',' + p1 + '&zoom=' + p4 + '&size=580x312&maptype=roadmap&markers=' + p2 + ',' + p3 + '&hl=ru&key=ABQIAAAAY78XWK5-Zy3qhkiV3w_m0hTPoZqTU4uhKIMSNHImBFQOd4WjahSr_Q8JwRSdhkeCWJkgoFFnVWj2Aw');
o.next().after(s);
var map = new GMap2(o.get(0));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(p0, p1), p4);
var marker = new GMarker(new GLatLng(p2, p3));
map.addOverlay(marker);
}
};
if (GBrowserIsCompatible()) {
$('div.map').each(function () {
var p = $(this).text().split(',');
show_map($(this), parseFloat(p[1]), parseFloat(p[0]), parseFloat(p[3]), parseFloat(p[2]), parseInt(p[4]));
});
}
});
//--></script>
Nemoden 01.12.2011 13:55 # +9
-1
guest8 09.04.2019 12:16 # −999