// echo '<pre>'; print_r($agreement); echo '</pre>';
		// echo '<pre>'.$agreement['client_requisit_id']; print_r($client_firm); echo '</pre>';
		// exit; 
		
		
		
		
		
		
		// если флаг открыть - открываем все или одну спецификацию
		if(isset($_GET['open']))
		{
		
		    if($_GET['open'] == 'all')
			{
				$specifications =  Agreement::fetch_specifications($client_id,$agreement_id);
				while($row = $specifications->fetch_assoc())
				{
					if(!isset($specifications_arr[$row['specification_num']])) $specifications_arr[$row['specification_num']]= array();
					array_push($specifications_arr[$row['specification_num']],$row);
				
				}
			}
			else if($_GET['open'] == 'empty')
			{
				$specifications_arr = array();
			}
			else if($_GET['open'] == 'specification')
			{
			    $specification =  Agreement::fetch_specification($client_id,$agreement_id,(int)$_GET['specification_num']);
				while($row = $specification->fetch_assoc())