<?
foreach ($notes as $note) {
	$NoteId 		= $note->getAttribute('id');
	$NoteName		= $note->getElementsByTagName("notename")->item(0)->nodeValue;
	$NoteDescr		= $note->getElementsByTagName("notedescr")->item(0)->nodeValue;
	$NoteDescrSm 	= mb_substr(strip_tags($NoteDescr), 0, 70, 'UTF-8') . '...';
	$NoteDate		= $note->getElementsByTagName("notedate")->item(0)->nodeValue;
?>
	<tr id="<?php echo $NoteId; ?>">
		<td>
			<button onclick="javascript:document.location.href='/<?php echo $folder; ?>/notes/?view=<?php echo $NoteId; ?>'" class="btn btn-sm btn-link" title="Открыть заметку"><i class="fa fa-fw fa-file-text-o" aria-hidden="true"></i></button>
		</td>
		<td>
			<a href="/<?php echo $folder; ?>/notes/?view=<?php echo $NoteId; ?>"><?php echo $NoteName; ?></a>
			<?php if(glob('./crmdata/upload/'.$NoteId.'/*')){ echo '<i class="fa fa-fw fa-cloud-download" aria-hidden="true" title="Прикреплен файл"></i>';} ?>
			<small class="descrsm d-block">
				<?php echo $NoteDescrSm; ?>
			</small>
		</td>
		<td>
			<div class="rem_days_body" >
				<div class="txt"><?php echo $NoteDate; ?></div>
			</div>
		</td>
		<td>
			<a href="/<?php echo $folder . '/notes/?edit='.$NoteId; ?>" class="btn btn-sm btn-link" title="Редактировать"><i class="fa fa-fw fa-pencil" aria-hidden="true"></i></a>
		</td>
		<td>
			<form method="POST">
				<button class="btn btn-sm btn-link" type="submit" name="noteDelete" onclick="return confirm('Удалить заметку # <?php echo $NoteName; ?>?')" title="Удалить"><i class="fa fa-fw fa-times" aria-hidden="true"></i></button>
				<input type="text" class="hidden" name="noteDelId" value="<?php echo $NoteId; ?>" />
			</form>
		</td>
	</tr>
<?php } ?>