<div class="col-lg-12 col-md-12 col-sm-12">
	<h1>Онлайн запрос #<? echo $_GET["view"];?></h1>
	<div class="row">
		<div class="col-lg-3">
			<div class="row">
				<div class="col-lg-12 col-md-12 col-sm-12 col-xs-4">
					<? if($company != '') {?>
					<div class="big-photo empty satur50" style="background:<? echo get_color2($company); ?>"><? echo mb_substr($company, 0, 1,'utf-8'); ?><img id="qrImage" src=""/></div>
					<? } else { ?>
					<div class="big-photo empty satur50" style="background:<? echo get_color2($name); ?>"><? echo mb_substr($name, 0, 1,'utf-8'); ?><img id="qrImage" src=""/></div>
					<? } ?>
					
					<script type="text/javascript">
						$(document).ready(function() {
							var startNode="BEGIN:VCARD"+"\n"+"VERSION:3.0"+"\n";
							var endNode="END:VCARD";
							startNode+="N:"+"<? if($company == ''){echo $name;} else {echo $company;} ?>"+"\n";
							startNode+="EMAIL:"+"<? echo $email; ?>"+"\n";
							startNode+="ORG:"+"<? if($company != ''){echo $company;} ?>"+"\n";
							startNode+="URL:"+"<? echo $web; ?>"+"\n";
							startNode+="TEL:"+"<? echo $phone; ?>"+"\n";
							startNode+="ADR:"+"<? echo $addr; ?>"+"\n";
							startNode+=endNode;
							$("#qrImage").attr("src" , "https://chart.googleapis.com/chart?cht=qr&choe=UTF-8&chs=160x160&chl="+encodeURIComponent(startNode));
						});
					</script>
				</div>
				<div class="col-lg-12 col-md-12 col-sm-12 col-xs-8">
					<form method="POST" style="display:block;">
						<div class="input-group" style="width:100%;margin:0px 0px 10px 0px;">
							<span class="input-group-addon" style="width:50px;"><i class="fa fa-fw fa-qrcode" aria-hidden="true"></i></span>
							<div class="input-group-btn" style="width:calc(100% - 50px);"><a href="javascript: ;" style="width:100%;" onclick="$('#qrImage').toggle(0);" class="btn btn-default">QR <span class="hidden-xs">Визитная карточка</span><span class="hidden-lg hidden-md hidden-sm">Визитка</span></a></div>
						</div>
						<div class="input-group" style="width:100%;margin:0px 0px 10px 0px;">
							<span class="input-group-addon" style="width:50px;"><i class="fa fa-fw fa-save" aria-hidden="true"></i></span>
							<div class="input-group-btn" style="width:calc(100% - 50px);"><a href="/<? echo $folder.'/clients/?new&name='.$name.' '.$sname.'&company='.$company.'&source='.$source.'&phone='.$phone.'&mail='.$email.'&web='.$web.'&addr='.$addr.'&date='.$date; ?>" style="width:100%;" class="btn btn-default"><span class="hidden-xs">Сохранить контакт</span><span class="hidden-lg hidden-md hidden-sm">Сохранить контакт</span></a></div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="col-lg-9" id="to_print">
		
			<ul class="nav nav-tabs" id="admin-tabs">
				<li class="active"><a data-toggle="tab" href="#info">Информация</a></li>
			</ul>
			<div class="tab-content" id="to_print">
				<div id="info" class="tab-pane fade in active">
					<table class="table view_table_mobile">
						<tbody>
							<? if($company == '') {?>
							<tr>
								<td width="35%" style="border:none;"><i class="fa fa-fw fa-user" aria-hidden="true"></i> Клиент:</td>
								<td style="border:none;"><? echo $name; ?> <? echo $sname; ?></td>
							</tr>
							<? } else { ?>
							<tr>
								<td width="35%" style="border:none;"><i class="fa fa-fw fa-users" aria-hidden="true"></i> Компания:</td>
								<td style="border:none;"><? echo $company; ?></td>
							</tr>
							<tr>
								<td><i class="fa fa-fw fa-user" aria-hidden="true"></i> Представитель:</td>
								<td><? echo $name; ?> <? echo $sname; ?></td>
							</tr>
							<? } ?>
							<tr>
								<td><i class="fa fa-fw fa-map-marker" aria-hidden="true"></i> Адрес:</td>
								<td><?php if($addr != ''){echo '<a target="_blank" href="https://yandex.ru/maps/2/saint-petersburg/?source=serp_navig&mode=search&text=' . $addr . '">' . $addr . '</a>';}else{echo 'Нет данных';}?></td>
							</tr>
							<tr>
								<td><i class="fa fa-fw fa-phone" aria-hidden="true"></i> Рабочий телефон:</td>
								<td><? if($phone != ''){echo $phone;}else{echo 'Нет данных';}?></td>
							</tr>
							<tr>
								<td><i class="fa fa-fw fa-envelope-o" aria-hidden="true"></i> Контактный email:</td>
								<td><? if($email != ''){echo $email;}else{echo 'Нет данных';}?></td>
							</tr>
							<tr>
								<td><i class="fa fa-fw fa-globe" aria-hidden="true"></i> Веб-сайт:</td>
								<td><? if($web != ''){echo '<a href="' . $web . '" target="_blank">' . $web . '</a>';}else{echo 'Нет данных';}?></td>
							</tr>
							<tr>
								<td><i class="fa fa-fw fa-bullhorn" aria-hidden="true"></i> Откуда узнали:</td>
								<td><? if($source != ''){echo $source;}else{echo 'Нет данных';}?></td>
							</tr>
							<tr>
								<td><i class="fa fa-fw fa-calendar" aria-hidden="true"></i> Дата запроса:</td>
								<td><? if($date != ''){echo $date;}else{echo 'Нет данных';}?></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>