    <div class="l-center">
      <div class="l-sort clearfix noselect">
        <div class="l-unit-toolbar__buttonstrip">
          <a href="/add/db/" id="btn-create" class="ui-button cancel" title="<?=__('Add Database')?>"><i class="fas fa-plus-circle status-icon green"></i> <?=__('Add Database')?></a>
          <?
            $mysql = 0;
            $pgsql = 0;

            list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");

            foreach ($data as $key => $value) {
              if ($data[$key]['TYPE'] == 'mysql'){
                $mysql = 1;
                $db_myadmin_link = "//".$http_host."/phpmyadmin/";
                if (!empty($_SESSION['DB_PMA_ALIAS']))
                  $db_myadmin_link = "//".$http_host."/".$_SESSION['DB_PMA_ALIAS'];
              }
              if ($data[$key]['TYPE'] == 'pgsql'){
                $pgsql = 1;
                $db_pgadmin_link = "//".$http_host."/phppgadmin/";
                if (!empty($_SESSION['DB_PGA_ALIAS']))
                  $db_pgadmin_link = "//".$http_host."/".$_SESSION['DB_PGA_ALIAS'];
              }
            }
            if($mysql){
              echo '<a class="ui-button cancel" href="'.$db_myadmin_link.'" target="_blank"><i class="fas fa-database status-icon orange"></i> phpMyAdmin</a>';
            }
            if($pgsql){
              echo '<a class="ui-button cancel" href="'.$db_pgadmin_link.'" target="_blank"><i class="fas fa-database status-icon orange"></i> phpPgAdmin</a>';
            }
          ?>
        </div>
        <ul class="context-menu sort-order animated fadeIn" style="display:none;">
          <li entity="sort-date" sort_as_int="1"><span class="name active"><?=__('Date')?> <i class="fas fa-sort-amount-down"></i></span><span class="up"><i class="fas fa-sort-amount-up"></i></span></li>
          <li entity="sort-name"><span class="name"><?=__('Database')?> <i class="fas fa-sort-amount-down"></i></span><span class="up"><i class="fas fa-sort-amount-up"></i></span></li>
          <li entity="sort-disk" sort_as_int="1"><span class="name"><?=__('Disk')?> <i class="fas fa-sort-amount-down"></i></span><span class="up"><i class="fas fa-sort-amount-up"></i></span></li>
          <li entity="sort-user"><span class="name"><?=__('User')?> <i class="fas fa-sort-amount-down"></i></span><span class="up"><i class="fas fa-sort-amount-up"></i></span></li>
          <li entity="sort-server"><span class="name"><?=__('Host')?> <i class="fas fa-sort-amount-down"></i></span><span class="up"><i class="fas fa-sort-amount-up"></i></span></li>
        </ul>
        <div class="l-sort-toolbar clearfix">
          <table>
            <tr>
              <td class="sort-by">
                <?=__('sort by');?>: <span><b><?=__('Date')?> <i class="fas fa-sort-amount-down"></i></b></span>
              </td>
              <td class="l-sort-toolbar__search-box">
                <form action="/search/" method="get">
                  <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
                  <input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" />
                  <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value=""><i class="fas fa-search"></i></button>
                </form>
              </td>
              <td>
                <form action="/bulk/db/" method="post" id="objects">
                <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
                <div class="l-select">
                  <select name="action" id="">
                    <option value=""><?=__('apply to selected')?></option>
                    <option value="suspend"><?=__('suspend')?></option>
                    <option value="unsuspend"><?=__('unsuspend')?></option>
                    <option value="delete"><?=__('delete')?></option>
                  </select>
                </div>
                <button type="submit" class="l-sort-toolbar__filter-apply" value=""><i class="fas fa-arrow-right"></i></button>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>

    <div class="l-separator"></div>

    <div class="l-center units animated fadeIn">
        <div class="header table-header">
            <div class="l-unit__col l-unit__col--right">
                  <div class="clearfix l-unit__stat-col--left super-compact">
                      <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" onChange="checkedAll('objects');">
                  </div>
                  <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print __('Database');?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-right compact-2"><b>&nbsp;</b></div>
                  <div class="clearfix l-unit__stat-col--left text-center compact"><b><?php print __('Type');?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?php print __('Username');?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Hostname');?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Disk');?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Charset');?></b></div>
             </div>
          </div>
          
      <?
        list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
        foreach ($data as $key => $value) {
          ++$i;
          if ($data[$key]['SUSPENDED'] == 'yes') {
            $status = 'suspended';
            $spnd_action = 'unsuspend';
            $spnd_icon = 'fa-play';
            $spnd_confirmation = 'UNSUSPEND_DATABASE_CONFIRMATION' ;
          } else {
            $status = 'active';
            $spnd_action = 'suspend';
            $spnd_icon = 'fa-pause';
            $spnd_confirmation = 'SUSPEND_DATABASE_CONFIRMATION' ;
          }
          if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST'];
          if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
          if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "https://".$http_host."/phpmyadmin/";
          if (($data[$key]['TYPE'] == 'mysql') && (!empty($_SESSION['DB_PMA_ALIAS']))) $db_admin_link = $_SESSION['DB_PMA_ALIAS'];
          if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
          if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "https://".$http_host."/phppgadmin/";
          if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_ALIAS']))) $db_admin_link = $_SESSION['DB_PGA_ALIAS'];
      ?>


      <div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_SESSION['favourites']['DB'][$key] == 1) echo ' l-unit--starred'; ?>" v_unit_id="<?=$key?>" v_section="db"
sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>" sort-name="<?=$key?>" sort-disk="<?=$data[$key]['U_DISK']?>"
sort-user="<?=$data[$key]['DBUSER']?>" sort-server="<?=$data[$key]['HOST']?>" sort-star="<? if($_SESSION['favourites']['DB'][$key] == 1) echo '1'; else echo '0'; ?>">
            <div class="l-unit__col l-unit__col--right">
              <div>
                <div class="clearfix l-unit__stat-col--left super-compact">
                  <input id="check<?php echo $i ?>" class="ch-toggle" type="checkbox" name="database[]" value="<?php echo $key ?>">
                </div>
                <div class="clearfix l-unit__stat-col--left wide-3"><b><a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=__('Editing Database')?>"><?=$key?></a></b></div>
                <!-- START QUICK ACTION TOOLBAR AREA -->
                <div class="clearfix l-unit__stat-col--left text-right compact-2">
                      <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
                          <div class="actions-panel clearfix">
                            <div class="actions-panel__col actions-panel__logs shortcut-enter" key-action="href"><a href="/edit/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=__('Editing Database')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim"></i></a></div>
                            <div class="actions-panel__col actions-panel__suspend shortcut-s" key-action="js">
                              <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_<?=$spnd_action?>" title="<?=__($spnd_action)?>">
                                <i class="fas <?=$spnd_icon?> status-icon highlight status-icon dim do_<?=$spnd_action?>"></i>
                                <input type="hidden" name="<?=$spnd_action?>_url" value="/<?=$spnd_action?>/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" />
                                <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-suspention hidden" title="<?=__('Confirmation')?>">
                                  <p class="confirmation"><?=__($spnd_confirmation,$key)?></p>
                                </div>
                              </a>
                            </div>
                            <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
                              <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=__('delete')?>">
                                <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
                                <input type="hidden" name="delete_url" value="/delete/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>" />
                                <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=__('Confirmation')?>">
                                  <p class="confirmation"><?=__('DELETE_DATABASE_CONFIRMATION',$key)?></p>
                                </div>
                              </a>
                            </div>
              
                          </div>
                        </div>
                  </div>
                  <!-- END QUICK ACTION TOOLBAR AREA -->
                  <div class="clearfix l-unit__stat-col--left text-center compact"><?=$data[$key]['TYPE']?></div>
                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?=$data[$key]['DBUSER']?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-center"><b><?=$data[$key]['HOST']?></b></div>
                  <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
                  <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['CHARSET']?></div>
               </div>
            </div>
      </div>
      <?}?>
    </div>

    <div id="vstobjects">
      <div class="l-separator"></div>
      <div class="l-center">
        <div class="l-unit-ft">
          <table class='data'></table>
          <div class="data-count l-unit__col l-unit__col--right clearfix">
            <?php
              if ( $i == 1) {
                echo __('1 SQL database');
              } else {
                echo __('%s SQL databases',$i);
              }
            ?>
          </div>
        </div>
      </div>
    </div>
