<?php

/* ====================
  [BEGIN_COT_EXT]
 * Hooks=users.edit.update.delete
  [END_COT_EXT]
  ==================== */


defined('COT_CODE') or die('Wrong URL');
require_once cot_incfile('certificates', 'module');

$extpl = cot_getextplugins('certificates.users.edit.update.delete');
$certsql = $db->query("SELECT * FROM $db_certificates WHERE item_userid=".$urr['user_id'])->fetchAll();

foreach($certsql as $item) {
  /* === Hook === */
  foreach ($extpl as $pl)
  {
  	include $pl;
  }
  /* ===== */

  $db->delete($db_certificates, "item_id='" . $item['item_id'] . "'");
}