<?php
defined('BASEPATH') OR exit('No direct script access allowed');

$jml_data = sizeof($data);

if($jml_data < 20)
{
  $jml_kolom = '12';
} 
else if($jml_data < 40)
{
  $jml_kolom = '6';
}
else $jml_kolom = '3';

?>

<div class="row">
  
  <?php if(empty($data)){ ?>     
    <div class="col-12">
      <div class="info-box">
        <div class="info-box-content">
          <center>
            <p style="font-size: 25px; line-height: 1;">BELUM ADA PASIEN</p>
          </center>
        </div>
      </div>
    </div>
  <?php } else { ?>

    <?php foreach ($data as $key){ ?>         
      <div class="col-<?php echo $jml_kolom ?>">
        <div class="info-box" style="min-height: 10px; padding: 5px; margin-bottom: 5px; height: 40px">
          <span style="width: 55px" class="info-box-icon bg-primary elevation-1"><?php echo $key->urut ?></span>
          <div class="info-box-content">
            <span style="font-size: 18px; line-height: 1;"><?php echo strtoupper(substr($key->nama, 0, 15)) ?></span>
          </div>
        </div>
      </div>
    <?php } ?>      
  <?php } ?>

</div>
