<div class="row">
    <div class="col-md-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title"><?php echo $title; ?> RSUP Dr. Kariadi</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    <a href="<?php echo base_url('admin/home'); ?>" class="btn btn-box-tool"><i class="fa fa-times"></i></a>
                </div>
            </div>
            <div class="box-body">
                <a href="<?php echo base_url('admin/kepuasanpelanggan/website'); ?>" class="btn btn-info">Kepuasan Website</a>
                <a href="<?php echo base_url('admin/kepuasanpelanggan/rs'); ?>" class="btn btn-info">Kepuasan Pelayanan RS</a>
                <div id="kp" class="chart"></div>
            </div>
            <div class="box-footer">
                <i class="fa fa-clock-o"></i> Data realtime
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
// ===== KEPUASAN PELANGGAN PELAYANAN RS =====
var kp = AmCharts.makeChart( "kp", {
  "type": "pie",
  "theme": "light",
  "dataProvider": [ 
    <?php foreach ($data as $content) {
          if ($content->tingkat_kepuasan == 1) {
            echo '{ "tingkat" : "Sangat Puas", "value" : '.$content->jumlah.'},';
          }
          elseif ($content->tingkat_kepuasan == 2) {
            echo '{ "tingkat" : "Puas", "value" : '.$content->jumlah.'},';
          }
          elseif ($content->tingkat_kepuasan == 3) {
            echo '{ "tingkat" : "Cukup Puas", "value" : '.$content->jumlah.'},';
          }
          else {
            echo '{ "tingkat" : "Tidak Puas", "value" : '.$content->jumlah.'},';
          }
    } ?>
  ],
  "valueField": "value",
  "titleField": "tingkat",
  "outlineAlpha": 0.4,
  "depth3D": 15,
  "balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
  "angle": 30,
  "export": {
    "enabled": true
  }
});
</script>