<?

if (!$type) {
	?>  <a class="link div2 text-center" href="/apanel/razd?type=create_razd" style="color:#55b145"><i class="fa fa-plus-square" aria-hidden="true"></i> <b>Создать раздел</b></a><br/><?
	$z = 2;
	foreach($razd AS $p) {
		$z = ($z % 2 ? 1 : 2);
		?>
			<a href="/apanel/razd/?type=<?=$p['link']?>">
			   <div class="post_<?=$z?>" style="margin: 5px;">
				<i style="color:#cac9c9;" class="fa fa-retweet fa-lg" aria-hidden="true"></i> 
				<b><?=$p['name']?></b><br/>
				<?=$p['text']?>
			   </div>	
			</a>
		<?	
		$z++;
	}
	?> </div> </div><?
}

if ($type AND $type !='create_razd') {
?>
  <a class="link div2 text-center" href="/apanel/razd?delete=<?=$type?>" style="color:#d03636"><i class="fa fa-trash-o" aria-hidden="true"></i> <b>Удалить раздел</b></a><br/>
 
<form method="post" name="save" action="?type=<?=$type?>" enctype="multipart/form-data">
  <div class="form-group">
    <input type="text" class="form-control" value="<?=$razdpost['name']?>" placeholder="Название" name="name">
    <small class="form-text text-muted">max 128 симв.</small>
  </div>
  
   <div class="form-group">
    <input type="text" class="form-control" value="<?=$razdpost['link']?>" placeholder="Персональная ссылка" name="link">
    <small class="form-text text-muted">max 128 симв. рус/анг</small>
  </div> 
  
   <div class="form-group">
    <input type="text" class="form-control" value="<?=$razdpost['sort']?>" placeholder="Позиция в списке" name="sort">
    <small class="form-text text-muted"></small>
  </div> 

    <div class="form-group">
    <textarea placeholder="Описание раздела" style="height: 220px;" class="form-control" name="text"><?=$razdpost['text']?></textarea>
    <small class="form-text text-muted">max 30k симв.</small>
  </div> 
  
   <div class="form-group">
    <textarea placeholder="Keywords" class="form-control" name="keywords"><?=$razdpost['keywords']?></textarea>
    <small class="form-text text-muted">max 256 симв.</small>
  </div>  
  
   <div class="form-group">
    <textarea placeholder="Description" class="form-control" name="description"><?=$razdpost['description']?></textarea>
    <small class="form-text text-muted">max 256 симв.</small>
  </div>  

  <button type="submit" name="save" class="btn btn-primary">Сохранить</button>
</form>
<?
}
