<?php

	$data=Yii::app()->db->createCommand("SELECT
loket.nama_loket,loket.inisial,
max(antrian.nomor) as NOMOR
FROM
loket
LEFT JOIN antrian ON loket.id = antrian.id_jenis where antrian.`status`='finish' GROUP BY `loket`.id")->queryAll()
?>


  <div class="col-lg-12">
  	<center>
<h2><b><?php echo date('d F Y'); ?></b></h2>
<center>
</div>

<?php
$i = 0;
foreach($data  as $row):
$i++;
 ?>

    <div class="col-lg-4 col-xs-6">
          <!-- small box -->

          <div class="panel panel-default">
			  <div class="panel-heading"><center><B>ANTRIAN <?php echo $row['nama_loket'];?></B></center></div>
			  <div class="panel-body">
			  	<center><H1><b><?php echo $row['inisial'];?><?php echo $row['NOMOR'];?></b></H1></center>
			</div>
		  </div>
	</div>	  

<?php endforeach ?>
