<?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" style="padding-bottom: 5px;">
        <table>
          <tr>
            <td style="padding-bottom: 10%; padding-top: 11%"><i class="fa fa-building fa-5x" style="width: 20px;"></i></td>
            <td style="padding-bottom: 10%; padding-top: 11%;">
            <h3 class="widget-user-username">Pasien Rawat Inap</h3> 
            <h4 class="widget-user-desc"><?php echo date('d, F Y');?></h4>
            </td>
          </tr>
          <tr>
            <table id="table_rincian" class="table">  
                  <thead>  
                      <tr>  
                           <th style="text-align: center;">BPJS</th>  
                           <th style="text-align: center;">Non BPJS</th>  
                           <th style="text-align: center;">Total Pasien</th>
                      </tr>
                      <tbody>
                        <?php foreach($resultstotal as $row){ ?>
                            <tr>
                                <td style="text-align: center; font-weight: bold; font-size: 1.5em;"><?php echo $row->BPJS ?></td>
                                <td style="text-align: center; font-weight: bold; font-size: 1.5em;"><?php echo $row->NONBPJS ?></td>
                                <td style="text-align: center; font-weight: bold; font-size: 1.5em;"><?php echo $row->Jumlah ?></td>
                            </tr>
                        <?php } ?>
                      </tbody>
                  </thead>     
            </table>
          </tr>
        </table>
            </div>
            <div class="box-footer">
            	<div class="table-responsive">
            		<table id="table_rincian" class="table table-bordered">  
	                      <thead>  
	                          <tr>  
	                               <th>Kelas</th>  
	                               <th>Ruangan</th>  
	                               <th 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 date('d, F Y');?></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="<?php echo date('Y/m/d')?>" name="tanggal">
                    </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" value="<?php echo date('Y/m/d')?>" 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>Kelas</th>  
	                               <th>Ruangan</th>  
	                               <th style="text-align: center;">Jumlah</th>
	                               <th style="text-align: center;">Rujuk Inap</th>
<th style="text-align: center;">Reg Status</th>
	                          </tr>
	                          <tbody>
	                            <?php foreach($table_now 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>