<div class="cc_hubadm_content">
<?php if($msg) { ?>
<div class="cc_hubadm_success"><?php echo $msg; ?></div>
<?php } ?>

    <div class="cc_hubadm_box cc_hubadm_full">
    <div class="cc_hubadm_boxtitle">Hub Administration Documents</div>
    On this page hub staff can find documents and administration guides.
        <br /><br />
    <div class="cc_hubadm_boxtitle">Available Documents</div>
        <br /><br />
<?php if(!$documentsA && !$documentsB) { echo "No Documents are available at the moment!"; } else { ?>
        <?php if($documentsA) { ?>
        <table class="cc_hubadm_tablea">
    <tr>
        <th width="50%">Document</th>
        <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $permissions->editdocs == '1') { ?>
        <th width="25%">Edit</th>
        <th width="25%">Delete</th>
        <?php } ?>
        </tr>
        <?php foreach($documentsA as $doc){ ?>
        <tr>
            <td><a href="<?php echo SITE_URL ?>/core/modules/HubOps/uploads/<?php echo $doc->filename ?>" target="_blank"><?php echo $doc->title; ?></a></td>
            <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $permissions->editdocs == '1') { ?>
            <td>N/A</td>
            <td><a href="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/deletedoc/<?php echo $doc->id ?>" class="cc_hubadm_redbutt">Delete</a></td>
            <?php } ?>
        </tr>
        <?php } ?>
    </table>
   <?php } ?>
<br />
        <hr />
        <br />
        
        <?php if($documentsB) { ?>
        <table class="cc_hubadm_tablea">
        <?php foreach($documentsB as $doc){ ?>
        <tr>
            <td width="50%"><a href="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/viewdoc/<?php echo $doc->id ?>"><?php echo $doc->title; ?></a></td>
            <?php if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN) || $permissions->editdocs == '1') { ?>
            <td width="25%"><a href="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/editdoc/<?php echo $doc->id ?>" class="cc_hubadm_greenbutt">Edit</a></td>
            <td width="25%"><a href="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/deletedoc/<?php echo $doc->id ?>" class="cc_hubadm_redbutt">Delete</a></td>
            <?php } ?>
        </tr>
        <?php } ?>
    </table>
   <?php } ?>
        <?php } ?>
    </div>
</div>