<?php
/**
 * COmanage Match Matchgrid Pending Template
 *
 * Portions licensed to the University Corporation for Advanced Internet
 * Development, Inc. ("UCAID") under one or more contributor license agreements.
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.
 *
 * UCAID licenses this file to you under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @link          http://www.internet2.edu/comanage COmanage Project
 * @package       match
 * @since         COmanage Match v1.0.0
 * @license       Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 */

declare(strict_types = 1);
  
// $flashArgs pass banner messages to the flash element container
$flashArgs = [];
if(!empty($indexBanners)) {
  $flashArgs['vv_index_banners'] = $indexBanners;
}
if(!empty($banners)) {
  $flashArgs['vv_banners'] = $banners;
}
?>

<div class="pageTitleContainer">
  <div class="pageTitle">
    <h1><?= $vv_title; ?></h1>
  </div>
</div>

<?= $this->element('flash', $flashArgs); ?>

<h2><?= __('match.rs.pending', [count($vv_pending)]); ?></h2>

<table>
  <tr>
    <th><?= __('match.fd.sorid'); ?></th>
    <th><?= __('match.fd.sor'); ?></th>
    <th><?= __('match.fd.request_time'); ?></th>
  </tr>
  <?php foreach($vv_pending as $p): ?>
  <tr class="linked-row spin">
    <td class="row-link">
      <?= $this->Html->link(
        $p['sorid'],
        ['action' => 'reconcile',
          $vv_matchgrid_id,
          '?' => [ 'rowid' => $p['id'] ] ]
      ); ?>
    </td>
    <td>
      <?= $p['sor']; ?>
    </td>
    <td>
      <?= $p['request_time']; ?>
    </td>
  </tr>
  <?php endforeach; // $vv_pending ?>
</table>