<?php 
include 'config/rupiah.php';



$hari = date('d');
$query_hari=mysql_query("SELECT SUM(debit) as jumlah_debit, SUM(kredit) as jumlah_kredit FROM transaksi WHERE DATE_FORMAT((tanggal),'%m') like '%$bulan%'");
$saldo_h = mysql_fetch_array($query_hari);
$saldo_hari= $saldo_h['jumlah_debit'] - $saldo_h['jumlah_kredit'];

$ta = mysql_fetch_array(mysql_query("SELECT * FROM tahun_ajaran where idTahunAjaran='$_GET[tahun]'"));
$idTahun = $ta['idTahunAjaran'];
$tahun = $ta['nmTahunAjaran'];

$idt = mysql_fetch_array(mysql_query("SELECT * FROM identitas where npsn='10700295'"));
$pos = mysql_fetch_array(mysql_query("SELECT * FROM pos_bayar where idPosBayar='$_GET[pos]'"));

$idsiswa = $_GET['siswa'];
$dtsiswa = mysql_fetch_array(mysql_query("SELECT * FROM view_detil_siswa where nisnSiswa='$_SESSION[ids]'"));
$nissiswa = $dtsiswa['nisSiswa'];
$namasiswa = $dtsiswa['nmSiswa'];
$namakelas = $dtsiswa['nmKelas'];

$apa = mysql_query("SELECT * FROM siswa where nisnSiswa='$_SESSION[ids]' ");
$ra = mysql_fetch_array($apa);

$edit = mysql_query("SELECT * FROM identitas ");
$record = mysql_fetch_array($edit);
?>

<div class="col-xs-12">
<?php if ($_SESSION[lvl]=='ketuakelas'){ ?>
			<div class="alert alert-warning alert-dismissible text-center" role="alert">
			<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			<p>Anda login sebagai <?php echo $ra['level'];?>, silahkan kelola kas kelas anda dengan baik :) </p>
		</div>
	<?php } ?>
		
 
  <div class="box box-primary box-solid">
	<div class="box-header with-border">
	  <h3 class="box-title">
	  <?php date_default_timezone_set('Asia/Jakarta');
//Menampilkan tanggal hari ini dalam bahasa Indonesia dan English
$namaHari = array("Ahad", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu","Minggu");
$namaBulan = array("Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
$today = date('l, F j, Y');
$sekarang = $namaHari[date('N')] . ", " . date('j') . " " . $namaBulan[(date('n')-1)] . " " . date('Y'); ?>

<?php echo $sekarang; ?> | <?php
date_default_timezone_set('Asia/Jakarta');//Menyesuaikan waktu dengan tempat kita tinggal
echo $timestamp = date('H:i:s');//Menampilkan Jam Sekarang
?> |       
	      <SCRIPT language=JavaScript>var d = new Date();
			var h = d.getHours();
			if (h < 11) { document.write('Selamat pagi, '); }
			else { if (h < 15) { document.write('Selamat siang, '); }
			else { if (h < 19) { document.write('Selamat sore, '); }
			else { if (h <= 23) { document.write('Selamat malam,'); }
			}}}</SCRIPT><?php echo $ra['nmSiswa']?><div class="col" role="main"> </h3>
			
	</div><!-- /.box-header -->
	<section class="content">
    <div class="row">
      <div class="col-md-6 col-sm-6 col-xs-12">
        <div class="info-box">
          <span class="info-box-icon bg-aqua"><i class="fa fa-bank"></i></span>

          <div class="info-box-content">
            <span class="info-box-text dash-text">Nama Sekolah</span>
            <span class="info-box-number"><?php echo $record['nmSekolah']; ?> </span>
          </div>
          <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
      </div>
      <!-- /.col -->
      <div class="col-md-6 col-sm-6 col-xs-12">
        <div class="info-box">
          <span class="info-box-icon bg-red"><i class="fa fa-user"></i></span>
		  

          <div class="info-box-content">
            <span class="info-box-text dash-text">Nama Kepala Sekolah</span>
            <span class="info-box-number"><?php echo $record['nmKepsek']; ?> </span>
          </div>
          <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
      </div>
      <!-- /.col -->
<?php 
                $query_pegawai=mysql_query("SELECT *  FROM users");
                $num_pegawai = mysql_num_rows($query_pegawai);
                $query_nasabah=mysql_query("SELECT *  FROM siswa");
                $num_nasabah = mysql_num_rows($query_nasabah);

                
                ?>
      <!-- fix for small devices only -->
	  <div class="col-md-6 col-sm-6 col-xs-12">
        <div class="info-box">
          <span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span>

          <div class="info-box-content">
            <span class="info-box-text dash-text">Nama Siswa</span>
            <span class="info-box-number"><?php echo $ra['nmSiswa']?> / <?php echo $ra['nisSiswa'];?></span>
          </div>
          <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
      </div>
	  <div class="col-md-6 col-sm-6 col-xs-12">
        <div class="info-box">
          <span class="info-box-icon bg-blue"><i class="fa fa-bank"></i></span>

          <div class="info-box-content">
            <span class="info-box-text dash-text">nama kelas </span>
            <span class="info-box-number"> <?php echo $dtsiswa['nmKelas'];?></span>

          </div>
          <!-- /.info-box-content -->
        </div>
		 </div>
		 <div class="clearfix visible-sm-block"></div>

      <div class="col-md-6 col-sm-6 col-xs-12">
        <div class="info-box">
          <span class="info-box-icon bg-blue"><i class="fa fa-usd"></i></span>

          <div class="info-box-content">
            <span class="info-box-text dash-text">Saldo Tabungan Anda</span>
            <span class="info-box-number">Rp. <?php echo rupiah ($ra['saldo']);?></span>
          </div>
          <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
      </div>
      <div class="clearfix visible-sm-block"></div>

      <div class="col-md-6 col-sm-6 col-xs-12">
        <div class="info-box">
          <span class="info-box-icon bg-green"><i class="fa fa-credit-card"></i></span>

          <div class="info-box-content">
            
            <span class="info-box-text dash-text">Nomor Rekening Tabungan </span>
            <span class="info-box-number"><?php echo $ra['nisnSiswa'];?></span>
          </div>
          <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
      </div>
      <!-- /.col -->
		
      
      <!-- /.col -->
      
        <!-- /.info-box -->
      
	  
      <!-- /.col -->
	  
        <!-- /.info-box -->
   
      <!-- /.col -->
	 
	 
          <!-- /.info-box-content -->
        </div>
        <!-- /.info-box -->
      </div>
      <!-- /.col -->
	   
	
	
 
	