<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=moderation.page.mnotfind
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

if(in_array('certificates', $moderauth)) {
  require_once cot_incfile('certificates', 'module');

  $publiccertificates = $db->query("SELECT COUNT(*) FROM $db_certificates WHERE item_state='0'");
  $publiccertificates = $publiccertificates->fetchColumn();

  $certificatesqueued = $db->query("SELECT COUNT(*) FROM $db_certificates WHERE item_state='2'");
  $certificatesqueued = $certificatesqueued->fetchColumn();

  $t->assign(array(
  	'ADMIN_HOME_CERTIFICATES_QUEUED_URL' => cot_url('moderation', 'm=certificates&state=2'),
  	'ADMIN_HOME_CERTIFICATES_PUBLIC_URL' => cot_url('moderation', 'm=certificates&state=0'),
  	'ADMIN_HOME_CERTIFICATES_QUEUED' => $certificatesqueued,
  	'ADMIN_HOME_CERTIFICATES_PUBLIC' => $publiccertificates,
  ));

  $t->parse('MAIN.LINE_CERTIFICATES');
}