<?php $this->load->view('admin/message'); ?>
<?php $this->load->view('admin/error'); ?>
<?php function buatrp($angka) { $jadi = "" . number_format($angka,0,',','.'); return $jadi; } ?>

<div class="row">


	<div class="col-md-4">
    <div class="box box-widget widget-user-2">
      <div class="widget-user-header bg-blue">
        <table>
          <tr>
            <td><i class="fa fa-building fa-5x" style="width: 20px;"></i></td>
            <td style="padding-bottom: 23%; padding-top: 23%;">
            <h3 class="widget-user-username">Pasien Rawat Inap</h3> 
            <h4 class="widget-user-desc"><?php echo date('d, F Y')?></h4>
            </td>
          </tr>
        </table>
            </div>
            <div class="box-footer">
            	<div class="table-responsive">
            		<table id="table_rincian" class="table table-bordered">  
	                      <thead>  
	                          <tr>  
	                               <th width="33.4%">Kelas</th>  
	                               <th width="33.4%">Ruangan</th>  
	                               <th width="33.4%" style="text-align: center;">Jumlah</th>
	                          </tr>
	                          <tbody>
	                            <?php foreach($resultstb as $row){ ?>
	                                <tr>
	                                    <td><?php echo $row->Class ?></td>
	                                    <td><?php echo $row->OfficeDescription ?></td>
	                                    <td style="text-align: center;"><?php echo $row->Jumlah ?></td>
	                                </tr>
	                            <?php } ?>
	                          </tbody>
	                      </thead>     
	                </table>
            	</div>
            </div>
        </div>
  </div>
  <div class="col-md-6">
    <div class="box box-widget widget-user-2">
      <div class="widget-user-header bg-yellow">
        <table>
          <tr>
            <td><i class="fa fa-building fa-5x" style="width: 20px;"></i></td>
            <td>
            <h3 class="widget-user-username">Kunjungan Pasien Rawat Jalan</h3>
            <h4 class="widget-user-desc"><?php echo $tanggal_from; ?> - <?php echo $tanggal_last; ?></h4> 
            <h4 class="widget-user-desc">
                                <form action="<?php echo site_url('welcome/tampil_table');?>" method = "post" class="form-horizontal">

                                  <div class="form-group">
                                    <label style="font-weight: 100; text-align: left;" class="col-sm-5 control-label">Tanggal Awal</label>
                                    <div class="col-sm-6">
                                      <input type="text" class="form-control" autofocuss id="date_from" value="" name="tanggal" placeholder="<?php echo date('d, F Y')?>">
                                    </div>
                                  </div>

                                  <div class="form-group">
                                    <label style="font-weight: 100; text-align: left;" class="col-sm-5 control-label">Tanggal Akhir</label>
                                    <div class="col-sm-6">
                                      <input type="text" class="form-control" autofocuss id="date_to" placeholder="<?php echo date('d, F Y')?>" value="" name="tanggal_to"> 
                                    </div>
                                  </div>

                                  <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> Tampilkan</button>
                                </form>
                            </h4>
            </td>
          </tr>
        </table>
            </div>
            <div class="box-footer">
            	<div class="table-responsive">
            		<table id="table_rincian" class="table table-bordered">  
	                      <thead>  
	                          <tr>  
	                               <th>Unit</th>  
	                               <th>Dokter</th>  
	                               <th style="text-align: center;">Total Kunjungan</th>
	                               <th style="text-align: center;">Rujuk Inap</th>
<th style="text-align: center;">Reg Status</th>
	                          </tr>
	                          <tbody>
	                            <?php foreach($table as $row){ ?>
	                                <tr>
	                                    <td><?php echo $row->Unit ?></td>
	                                    <td><?php echo $row->FirstName ?></td>
	                                    <td style="text-align: center;"><?php echo $row->TotalKunjungan ?></td>
	                                    <td style="text-align: center;"><?php echo $row->RujukInap ?></td>
<td style="text-align: center;"><?php echo $row->RegStatus ?></td>
	                                </tr>
	                            <?php } ?>
	                          </tbody>
	                      </thead>     
	                </table>
            	</div>
            </div>
        </div>
  </div>

</div>

<div class="row">
	


</div>