Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- require_once "../../Config/setup.php";
- require_once "../../Includes/2006/function/func_getKelompok.php";
- include "../../includes/2006/function/func_viewNasional1.php";
- include "../../includes/2006/array/arr_getMapel_id1.php";
- include "../../includes/2006/function/func_viewProduktip.php";
- if (isset($_POST['status']) && isset($_POST['ptk'])) {
- if ($_POST['status'] === "0") {
- $status = ">= 1";
- $stat = "SEMUA";
- } elseif($_POST['status'] === "1") {
- $status = "= 1";
- $stat = "NEGERI";
- } else {
- $status = "= 2";
- $stat = "SWASTA";
- }
- if ($_POST['ptk'] === "0") {
- $ptk = "> 1";
- $pt = "SEMUA";
- } elseif($_POST['ptk'] === "1"){
- $ptk = "<= 3";
- $pt = "PNS";
- } else {
- $ptk = "> 3";
- $pt = "NON PNS";
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Angka Kebutuhan Guru - <?php echo $site_name?></title>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
- <?php include('../../Config/css.php');?>
- </head>
- <body>
- <div class="blog-masthead">
- <div class="container">
- <?php include('../../Template/nav.php'); ?>
- </div>
- </div>
- <div class="container">
- <h4 class="blog-header">ADAPTIF/NORMATIF/BK</h4>
- <?php
- $mapel = array(
- 'agama'=>'Agama & Budi Pekerti',
- 'pkn'=>'PKN',
- 'indo'=>'B. Indo',
- 'penjas'=>'Penjas',
- 'senibudaya'=>'Seni Budaya',
- 'inggris'=>'B. Inggr',
- 'mtk'=>'MTK',
- 'ipa'=>'IPA',
- 'fisika'=>'Fisika',
- 'kimia'=>'Kimia',
- 'biologi'=>'Biologi',
- 'ips'=>'IPS',
- 'kkpi'=>'KKPI',
- 'mulok'=>'Mulok',
- 'wirausaha'=>'Wirausaha',
- 'BK'=>'BK');
- ?>
- <div class="table-responsive">
- <table id="mapel" class="table table-bordered table-striped table-hover">
- <thead>
- <tr>
- <th align="center" rowspan="2" class="active">NO</th>
- <th align="center" rowspan="2" class="active">PROPINSI</th>
- <?php foreach($mapel as $mp) echo "<th align='center' colspan='3' class='active'>{$mp}</th>";?>
- <th align="center" colspan="3" class="success">Total KG</th>
- </tr>
- <tr>
- <?php str_repeat("<th>A</th><th>I</th><th>LK</th>",16);?>
- <th align="center" class="success">A</th>
- <th align="center" class="success">I</th>
- <th align="center" class="success">LK</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $no=1;
- $jenis=array('a','i','lk');
- $data=array();
- $total=array();
- foreach($jenis as $j) $data[$j]=array();
- $results = tampilNasional($conn, $status, $ptk);
- while($row = sqlsrv_fetch_array($results, SQLSRV_FETCH_ASSOC))
- {
- foreach($mapel as $m=>$v)
- foreach($jenis as $j)
- $data[$j][$m]=(isset($data[$j][$m])?$data[$j][$m]:0)+$row[$j.'_'.$m];
- foreach($jenis as $j)
- $total[$j]=(isset($total[$j])?$total[$j]:0)
- +(isset($row['total_'.$j])?$row['total_'.$j]:$row['total_a']-$row['total_i']);
- ?>
- <tr>
- <td><?php echo $no++;?></td>
- <td style="min-width:200px"><a href="propinsi.php?propinsi=<?php echo $row['kode_wilayah']?>">
- <?php echo $row['propinsi']?></a></td>
- <?php
- foreach($mapel as $m=>$v)
- foreach($jenis as $j)
- echo "<td>".round($row[$j.'_'.$m])."</td>";
- ?>
- <td class="success"><?php echo round($row['total_a']);?>{</td>
- <td class="success"><?php echo round($row['total_i']);?></td>
- <td class="success"><?php echo round($row['total_a']-$row['total_i'])?></td>
- <?php
- }
- ?>
- </tr>
- <tr>
- <th class = "success" align="center"></th>
- <th class = "success" align="center">TOTAL/MAPEL</th>
- <?php
- foreach($mapel as $m=>$v)
- foreach($jenis as $j)
- echo "<th class='success'>".round($data[$j][$m])."</th>";
- foreach($jenis as $j) echo "<th class='success'>".round($total[$j])."</th>";
- ?>
- </tr>
- </tbody>
- </table>
- </div><!-- /.box-body -->
- </div>
- <br />
- <div class="container">
- <h4>PRODUKTIF</h4>
- <div class="table-responsive">
- <table id="prodi" class="table table-bordered table-striped table-hover">
- <?php
- $prov = '';
- $data = array();
- $jur= array();
- $result = viewProduktip($conn);
- while($row = sqlsrv_fetch_array($result)){
- if($prov != $row['propinsi']){
- $prov = $row['propinsi'];
- $data[$prov]=array();
- }
- $data[$prov][$row['jurusan_id']] = array(
- "a"=>$row['a_produktif'],
- "i"=>$row['i_produktip'],
- "lk"=>$row['a_produktif']-$row['i_produktif']);
- $jur[$row['jurusan_id']]=$row['nama_jurusan'];
- }
- ?>
- <thead>
- <tr>
- <th align="center" rowspan="2" class="active">NO</th>
- <th align="center" rowspan="2" class="active" style="min-width:200px">SEKOLAH</th>
- <?php foreach($jur as $j) echo "<th align='center' colspan='3' class='active'>{$j}</th>";?>
- <th align="center" colspan="3" class="success">TOTAL/PROPINSI</th>
- </tr>
- <tr>
- <?php echo str_repeat("<th>A</th><th>I</th><th>LK</th>",count($jur)); ?>
- <th align="center" class="success">A</th>
- <th align="center" class="success">I</th>
- <th align="center" class="success">LK</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $no = 0;
- $type=array('a','i','lk');
- $subtotal=array();
- $total=array();
- foreach ($data as $prov => $jurusan){
- $subtotal[$prov]=array();
- echo "
- <tr>
- <td align='center' class='active'>".($no++)."</td>
- <td class='active' style='min-width:200px'>{$prov}</td>";
- foreach ($jurusan as $j=>$jrs){
- if(!isset($total[$j])) $total[$j]=array();
- foreach($type as $t)
- {
- $subtotal[$prov][$t]=(isset($subtotal[$prov][$t])?$subtotal[$prov][$t]:0)+$jrs[$t];
- $total[$j][$t]=(isset($total[$j][$t])?$total[$j][$t]:0)+$jrs[$t];
- echo "<td>".round($jrs[$t])."</td>";
- }
- foreach($type as $t) echo "<td align='center' class='success'>{$subtotal[$prov][$t]}</td>";
- }
- echo "</tr>";
- }
- ?>
- <tr>
- <td align="center" class="success"></td>
- <td align="center" class="success"> TOTAL/JURUSAN </td>
- <!-- TOTAL BAWAH -->
- <?php
- $grandtotal=array();
- foreach($jur as $j=>$v)
- foreach($type as $t)
- {
- echo "<td align='center' class='success'>{$total[$j][$t]}</td>";
- $grandtotal[$t]=(isset($grandtotal[$t])?$grandtotal[$t]:0)+$total[$j][$t];
- }
- foreach($type as $t) echo "<td align='center' class='success'>{$grandtotal[$t]}</td>";
- ?>
- </tr>
- </tbody>
- </table>
- </div><!-- /.box-body -->
- </div><!-- /.container -->
- <?php include('../../Template/footer.php'); ?>
- <?php include('../../Config/js.php'); ?>
- <script type="text/javascript">
- $(document).ready(function() {
- var table = $('#mapel').DataTable( {
- scrollY: "400px",
- scrollX: true,
- scrollCollapse: true,
- paging: false,
- bSort: false,
- bFilter: true
- } );
- new $.fn.dataTable.FixedColumns( table, {
- leftColumns: 2
- } );
- } );
- $(document).ready(function() {
- var table = $('#prodi').DataTable( {
- scrollY: "400px",
- scrollX: true,
- scrollCollapse: true,
- paging: false,
- bSort: false,
- bFilter: true
- } );
- new $.fn.dataTable.FixedColumns( table, {
- leftColumns: 2
- } );
- } );
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement