<!-- BEGIN: MAIN -->

<div class="moderation-page centerwrap clearfix pt30 pb20 page-offer">
  <div class="" style="margin: auto">
    <h1 class="semibold font-OpenSans f32">
      Модерация
    </h1>

    <div class="block-response mb15">
      <i class="ico-arrow-left dib v-align-m"></i>
      <a class="dib v-align-m f14 color-gray color-text" href="{PHP|cot_url('moderation')}">На главную</a>
    </div>

    <div class="query-card white-bg-border">
      <h1>Сертификаты</h1>

      <div class="mb20">
      	<form action="{SEARCH_ACTION_URL}" method="get">
      		<input type="hidden" name="m" value="{PHP.m}" />
      		<input type="hidden" name="p" value="{PHP.p}" />
      		<input type="hidden" name="c" value="{PHP.c}" />
      		<table width="100%" cellpadding="5" cellspacing="0">
      			<tr>
      				<td width="100">{PHP.L.Search}:</td>
      				<td>{SEARCH_SQ}</td>
      			</tr>
      			<tr>
      				<td></td>
      				<td>{SEARCH_STATE}<br/></td>
      			</tr>
      			<tr>
      				<td></td>
      				<td><input type="submit" name="search" class="btn green-btn" value="{PHP.L.Search}" /></td>
      			</tr>
      		</table>
      	</form>
      </div>

      <div id="listcertificates">
      	<!-- BEGIN: PRD_ROWS -->
        	<div class="media mt10">
        		<!-- IF {PRD_ROW_IMAGE_CROP} -->
        		<div class="pull-left mr10 cursor--zoom-in" data-certificates-id="{PRD_ROW_ID}">
        		  <div class="thumbnail"><img src="{PRD_ROW_IMAGE_CROP}" width="100" height="100" /></div>
        		</div>
        		<!-- ENDIF -->
        		<div class="pull-right">
              <!-- IF {PRD_ROW_STATE} == 2 -->
                <a href="{PRD_ROW_VALIDATE_URL}" class="button btn green-btn">Утвердить</a>
              <!-- ELSE -->
                <a href="{PRD_ROW_UNVALIDATE_URL}" class="button btn orange-btn">Вернуть на модерацию</a>
              <!-- ENDIF -->
        			<a href="{PRD_ROW_DELETE_URL}" class="button btn red-btn">{PHP.L.Delete}</a>
        		</div>
        		<p class="owner">{PRD_ROW_OWNER_NAME} <span class="date">[{PRD_ROW_DATE}]</span> &nbsp;{PRD_ROW_COUNTRY} {PRD_ROW_REGION} {PRD_ROW_CITY} &nbsp; {PRD_ROW_ADMIN_EDIT}</p>
            <p class="title"><b>{PRD_ROW_SHORTTITLE}</b></p>
            <p class="text">{PRD_ROW_SHORTTEXT}</p>
        	</div>
          <div class="clearfix"></div>
       	<!-- END: PRD_ROWS -->
      </div>

      <!-- IF {PAGENAV_COUNT} > 0 -->
        <div class="paging">
          <div class="p1">
            <ul>{PAGENAV_PAGES}</ul>
          </div>
        </div>
      <!-- ELSE -->
        <div class="alert mb0">Сертификатов не найдено</div>
      <!-- ENDIF -->

    </div>

  </div>
</div>

<script>
  $('.moderation-page').find('input[type="text"], input[type="password"], select').addClass('input-styled');
</script>

<script src="themes/itbirja/js/pages/certificates.js" type="text/javascript"></script>
<script>
jQuery(function() {
	var certificatesCount = jQuery('#listcertificates').find('[data-certificates-id]').length;

	$('#listcertificates').on('click', '[data-certificates-id]', function() {
		var $el = $(this);

		if (!$el.length) {
			return false;
		}

    var certificatesId = $el.data('certificatesId');

  	if (certificatesId) {
  		certificatesCard.getCertificates(certificatesId);
  	}
	});
});
</script>

<!-- END: MAIN -->