Example #1
0
    $pagu = pagu_menteri($th);
} else {
    $pagu = pagu_satker($th, $kdsatker);
}
for ($i = 1; $i <= 12; $i++) {
    if ($kdsatker == '') {
        $real_r[$i] = real_menteri_spm_sdbulan($th, $kddept, $kdunit, $i);
        if ($pagu != 0) {
            $real_p[$i] = real_menteri_spm_sdbulan($th, $kddept, $kdunit, $i) / $pagu * 100;
        } else {
            $real_p[$i] = 0;
        }
    } else {
        $real_r[$i] = real_satker_spm_sdbulan($th, $kdsatker, $i);
        if ($pagu != 0) {
            $real_p[$i] = real_satker_spm_sdbulan($th, $kdsatker, $i) / $pagu * 100;
        } else {
            $real_p[$i] = 0;
        }
    }
    if (Date("m") < $i) {
        $real_p[$i] = '';
    }
    if (Date("m") < $i) {
        $real_r[$i] = '';
    }
}
$leg = array("", "Jan", "Peb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agt", "Sep", "Okt", "Nop", "Des");
$pagu_p = array("", $pagu_1, $pagu_2, $pagu_3, $pagu_4, $pagu_5, $pagu_6, $pagu_7, $pagu_8, $pagu_9, $pagu_10, $pagu_11, $pagu_12);
mysql_query("DELETE FROM das_real_ang_dept WHERE tahun = '{$th}' and kdsatker = '{$kdsatker}'");
for ($i = 1; $i <= 12; $i++) {
        $kdsatker = $col[1][$k];
        $sql = "select \tsum(RPHPAGU) as RPHPAGU,\r\n\t\t\t\t\tsum(JML01) as JML01,\r\n\t\t\t\t\tsum(JML01+JML02) as JML02,\r\n\t\t\t\t\tsum(JML01+JML02+JML03) as JML03,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04) as JML04,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05) as JML05,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06) as JML06,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06+JML07) as JML07,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06+JML07+JML08) as JML08,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06+JML07+JML08+JML09) as JML09,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06+JML07+JML08+JML09+JML10) as JML10,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06+JML07+JML08+JML09+JML10+JML11) as JML11,\r\n\t\t\t\t\tsum(JML01+JML02+JML03+JML04+JML05+JML06+JML07+JML08+JML09+JML10+JML11+JML12) as JML12\r\n\t\t\t\t\tfrom d_trktrm WHERE THANG='{$th}' AND KDSATKER = '{$kdsatker}' group by KDSATKER";
        $aTarik = mysql_query($sql);
        $Tarik = mysql_fetch_array($aTarik);
        $real_satker_bulan_1 = real_satker_spm_sdbulan($th, $col[1][$k], 1) / 1000000;
        $real_satker_bulan_2 = real_satker_spm_sdbulan($th, $col[1][$k], 2) / 1000000;
        $real_satker_bulan_3 = real_satker_spm_sdbulan($th, $col[1][$k], 3) / 1000000;
        $real_satker_bulan_4 = real_satker_spm_sdbulan($th, $col[1][$k], 4) / 1000000;
        $real_satker_bulan_5 = real_satker_spm_sdbulan($th, $col[1][$k], 5) / 1000000;
        $real_satker_bulan_6 = real_satker_spm_sdbulan($th, $col[1][$k], 6) / 1000000;
        $real_satker_bulan_7 = real_satker_spm_sdbulan($th, $col[1][$k], 7) / 1000000;
        $real_satker_bulan_8 = real_satker_spm_sdbulan($th, $col[1][$k], 8) / 1000000;
        $real_satker_bulan_9 = real_satker_spm_sdbulan($th, $col[1][$k], 9) / 1000000;
        $real_satker_bulan_10 = real_satker_spm_sdbulan($th, $col[1][$k], 10) / 1000000;
        $real_satker_bulan_11 = real_satker_spm_sdbulan($th, $col[1][$k], 11) / 1000000;
        $real_satker_bulan_12 = real_satker_spm_sdbulan($th, $col[1][$k], 12) / 1000000;
        ?>
      <td width="6%" rowspan="2" align="center"><strong><?php 
        echo $col[1][$k];
        ?>
</strong></td>
      <td width="54%" rowspan="2" align="left"><strong><?php 
        echo nm_satker($col[1][$k]);
        ?>
</strong></td>
      <td width="12%" rowspan="2" align="right"><strong><?php 
        echo number_format($col[2][$k] / 1000000, "0", ",", ".");
        ?>
</strong></td>
      <td width="11%" align="right" valign="top"><strong><?php 
        echo number_format($real_satker_bulan_1, "0", ",", ".");
    <?php 
} else {
    foreach ($col[1] as $k => $val) {
        if ($k % 2 == 1) {
            $class = "row0";
        } else {
            $class = "row0";
        }
        ?>
    <tr class="<?php 
        echo $class;
        ?>
">
      <?php 
        $real_satker_bulan = real_satker_spm_bulan($th, $col[1][$k], $kdbulan);
        $real_satker_sdbulan = real_satker_spm_sdbulan($th, $col[1][$k], $kdbulan);
        ?>
      <td width="6%" align="center" valign="top"><strong><?php 
        echo $col[1][$k];
        ?>
</strong></td>
      <td width="54%" align="left"><strong><?php 
        echo nm_satker($col[1][$k]);
        ?>
</strong></td>
      <td width="12%" align="right" valign="top"><strong><?php 
        echo number_format($col[2][$k], "0", ",", ".");
        ?>
</strong></td>
      <td width="11%" align="right" valign="top"><strong><?php 
        echo number_format($real_satker_bulan, "0", ",", ".");
}
if ($kdsatker == '') {
    $pagu = pagu_menteri($th);
} else {
    $pagu = pagu_satker($th, $kdsatker);
}
for ($i = 1; $i <= 12; $i++) {
    if ($kdsatker == '') {
        $real_r[$i] = real_menteri_spm_sdbulan($th, $kddept, $kdunit, $i);
        if ($pagu != 0) {
            $real_p[$i] = $real_r[$i] / $pagu * 100;
        } else {
            $real_p[$i] = 0;
        }
    } else {
        $real_r[$i] = real_satker_spm_sdbulan($th, $kdsatker, $i);
        if ($pagu != 0) {
            $real_p[$i] = $real_r[$i] / $pagu * 100;
        } else {
            $real_p[$i] = 0;
        }
    }
    if ($th == Date("Y")) {
        if (Date("m") < $i) {
            $real_p[$i] = '';
        }
        if (Date("m") < $i) {
            $real_r[$i] = '';
        }
    }
}
Example #5
0
$pagu_4 = $Giat['JML_4'] / $Giat['RPHPAGU'] * 100;
$pagu_5 = $Giat['JML_5'] / $Giat['RPHPAGU'] * 100;
$pagu_6 = $Giat['JML_6'] / $Giat['RPHPAGU'] * 100;
$pagu_7 = $Giat['JML_7'] / $Giat['RPHPAGU'] * 100;
$pagu_8 = $Giat['JML_8'] / $Giat['RPHPAGU'] * 100;
$pagu_9 = $Giat['JML_9'] / $Giat['RPHPAGU'] * 100;
$pagu_10 = $Giat['JML_10'] / $Giat['RPHPAGU'] * 100;
$pagu_11 = $Giat['JML_11'] / $Giat['RPHPAGU'] * 100;
$pagu_12 = $Giat['JML_12'] / $Giat['RPHPAGU'] * 100;
for ($i = 1; $i <= 12; $i++) {
    if ($kdsatker == '') {
        $real_r[$i] = real_menteri_spm_sdbulan($th, $kddept, $kdunit, $i);
        $real_p[$i] = real_menteri_spm_sdbulan($th, $kddept, $kdunit, $i) / $Giat['RPHPAGU'] * 100;
    } else {
        $real_r[$i] = real_satker_spm_sdbulan($th, $kdsatker, $i);
        $real_p[$i] = real_satker_spm_sdbulan($th, $kdsatker, $i) / $Giat['RPHPAGU'] * 100;
    }
    if (Date("m") < $i) {
        $real_p[$i] = '';
    }
    if (Date("m") < $i) {
        $real_r[$i] = '';
    }
}
$leg = array("", "Jan", "Peb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agt", "Sep", "Okt", "Nop", "Des");
$pagu_p = array("", $pagu_1, $pagu_2, $pagu_3, $pagu_4, $pagu_5, $pagu_6, $pagu_7, $pagu_8, $pagu_9, $pagu_10, $pagu_11, $pagu_12);
mysql_query("DELETE FROM das_real_ang_dept WHERE tahun = '{$th}' and kdsatker = '{$kdsatker}'");
for ($i = 1; $i <= 12; $i++) {
    $pagu_r = 'JML_' . $i;
    mysql_query("INSERT INTO das_real_ang_dept ( tahun , kdsatker , kdbulan , nmbulan , pagu_r , pagu_p , real_r , real_p)\r\n\t\t\t\t\t\t\tVALUES ( '{$th}' , '{$kdsatker}' , '{$i}' , '{$leg[$i]}' , '{$Giat[$pagu_r]}' , '{$pagu_p[$i]}' , '{$real_r[$i]}' , '{$real_p[$i]}' )");
}