<?php 
$domain = "http://$_SERVER[HTTP_HOST]";

function char_15($string)
{
  $length = strlen($string);
  $show = substr($string, 0, 15);

  if($length > 15) $show .= ' ...';

  return $show;
}

?>

<div class="card" id="content-box-1" style="background-color: blue; color: white">
  <div class="card-header" style="padding-top: 3px; padding-bottom: 1px">      
    <center>
      <h3>
        <?php echo strtoupper($data_tampilan->poliklinik_1_value) ?>
      </h3>
    </center>
  </div>
</div>

<div class="row">

  <?php $urut = 0; foreach ($poliklinik_1 as $key){ $urut++; ?>         
    <div class="col-4">
      <div class="info-box" style="min-height: 20px">
        <span style="width: 50px" class="info-box-icon bg-<?php if($urut <= 4){ echo 'success'; } else if($urut <= 8){ echo 'warning'; } else echo 'info'; ?> elevation-1"><?php echo substr($key->no_reg, -2) ?></span>
        <div class="info-box-content">
          <span style="font-size: 25px; line-height: 1;"><?php echo strtoupper(char_15($key->nm_pasien)) ?></span>
        </div>
        <!-- /.info-box-content -->
      </div>
    </div>
  <?php } ?>

  <?php if(sizeof($poliklinik_1) == 0){ ?>     
    <div class="col-12">
      <div class="info-box">

        <div class="info-box-content">
          <center>
            <p style="font-size: 25px; line-height: 1;">TIDAK ADA PASIEN</p>
          </center>
        </div>
        <!-- /.info-box-content -->
      </div>
    </div>
  <?php } ?>
</div>
