<?php 
	require_once('./functions/crm_settings.php');
	$pageTitle 	= 'Поиск по сделкам';
	require_once(ROOT . 'templates/header.php'); 
	if( isset( $_GET['type'] ) ) {
		if( $_GET['type'] == 'deal-a' ) {$getStatus = 'Активные сделки ';} elseif( $_GET['type'] == 'deal-c' ) {$getStatus = 'Завершенные сделки ';} else {$getStatus = 'Предложение ';}
	}
	$pageTitleBack 	= 'Поиск <i class="fa fa-fw fa-angle-right" aria-hidden="true"></i> ' . $getStatus . $getClient;
	require_once(ROOT . 'templates/main-menu.php');
	require_once(ROOT . 'modules/deals/list-deals-archive.php'); 
?>
<div class="container<?php global $designView; echo $designView; ?>">
	<div class="row">
		<div class="col-lg-12">
			<h1><a href="javascript: ;" onclick="history.go(-1)"><i class="fa fa-fw fa-angle-double-left" aria-hidden="true" title="Вернуться к списку"></i></a> <?php echo $pageTitleBack; ?><span class="list-num"><i class="fa fa-fw fa-angle-double-down" aria-hidden="true"></i> <?php echo $countDeal; ?></span></h1>
			<div class="table-responsive">
				<table id="all-deals-search" class="table table-hover all-deals deals-inwork">
					<thead> 
						<tr> 
							<th width="6%"></th> 
							<th>Наименование</th>
							<th width="15%">Сумма</th>
							<th width="6%" title="Рентабельность"><i class="fa fa-fw fa-line-chart" aria-hidden="true"></i></th>
							<th width="15%">Заключена</th> 
							<th width="15%">Завершена</th>
							<th width="6%" title="Время выполнения, дней"><i class="fa fa-hourglass-half" aria-hidden="true"></i></th> 
							<th width="6%"></th>
							<th width="6%"></th>
						</tr> 
					</thead> 
					<tbody>
						<?php require_once(ROOT . 'modules/deals/list-deals-m.php'); ?>
					</tbody>
				</table>
			</div>
			<?php require_once(ROOT . 'templates/table-pager.php'); ?>
		</div>
	</div>
</div>
<?
	require_once(ROOT . 'templates/modal-wind.php');
	require_once(ROOT . 'templates/footer.php');
?>
	</body>
</html>