Example #1
0
function JalankanProses($_pmbJumlah, $_pmbProses)
{
    $tmr = 1;
    include_once "../baa/mhswbaru.lib.php";
    // Tampilan proses
    echo "\r\n  <p align=center>\r\n  <font size=+1>{$_pmbProses}</font> <sup>~{$_pmbJumlah}</sup><br />" . $_SESSION['_pmbPMBID_' . $_pmbProses] . "<br />" . $_SESSION['_pmbNama_' . $_pmbProses] . "</p>";
    // Ambil data Cama
    $pmb = GetFields('pmb', "KodeID='" . KodeID . "' and PMBID", $_SESSION['_pmbPMBID_' . $_pmbProses], "*");
    if ($pmb['BIPOTID'] == 0) {
        SetBIPOTID($pmb);
    }
    ProsesBIPOT2($pmb['PMBID']);
    HitungUlangBIPOTPMB($pmb['PMBID']);
    // Ambil BIPOT yg sudah diupdate
    $pmb = GetFields('pmb', "KodeID='" . KodeID . "' and PMBID", $_SESSION['_pmbPMBID_' . $_pmbProses], "*");
    $prodi = GetaField('prodi', "KodeID='" . KodeID . "' and ProdiID", $pmb['ProdiID'], 'Nama');
    $smt = GetaField('semester', 'Semester', $_SESSION['_pmbSemester'], 'Nama');
    $smt = substr($smt, 0, 6);
    $smt = str_pad($smt, 6, ' ', STR_PAD_RIGHT);
    // Tuliskan ke file
    $fn = "../" . $_SESSION['_pmbFile'];
    $f = fopen($fn, 'a');
    fwrite($f, $_SESSION['_pmbTahun'] . '-' . $smt . '|' . '000000|00000|' . str_pad($pmb['PMBID'], 16, ' ', STR_PAD_RIGHT) . '|' . str_pad(substr($pmb['Nama'], 0, 21), 21, ' ', STR_PAD_RIGHT) . '|' . str_pad(' ', 25, ' ', STR_PAD_RIGHT) . '|' . str_pad($pmb['ProdiID'], 10, ' ', STR_PAD_RIGHT) . '|' . str_pad(substr($prodi, 0, 25), 25, ' ', STR_PAD_RIGHT) . '|' . substr($pmb['PMBPeriodID'], 0, 4) . '|' . '00000004201390002572|' . str_pad(' ', 20, ' ', STR_PAD_RIGHT) . '|' . str_pad($pmb['TotalBiaya'] - $pmb['TotalBayar'], 10, '0', STR_PAD_LEFT) . '|' . '0000000000|0000000000|0000000000|0000000000|0000000000|0000000000|0000000000|0000000000|' . '01|' . $_SESSION['_pmbKodeInstitusi'] . '|' . $_SESSION['_pmbKodePembayaran'] . '|' . str_pad(substr($pmb['PMBID'], 0, 10), 10, '0', STR_PAD_LEFT) . '|' . 'F' . "\n");
    fclose($f);
    // Next...
    $_SESSION['_pmbProses']++;
    echo <<<SCR
    <script>
    window.onload=setTimeout("window.location='../{$_SESSION['mnux']}.proses.php'", {$tmr});
    </script>
SCR;
}
function JalankanProses($_byaJumlah, $_byaProses)
{
    $tmr = 1;
    include_once "../keu/biayamhsw.lib.php";
    // Parameters
    $MhswID = $_SESSION['_byaMhswID_' . $_byaProses];
    $Nama = $_SESSION['_byaNama_' . $_byaProses];
    $ProdiID = $_SESSION['_byaProdiID_' . $_byaProses];
    $ProgramID = $_SESSION['_byaProgramID_' . $_byaProses];
    $BIPOTID = $_SESSION['_byaBIPOTID_' . $_byaProses];
    $TahunID = $_SESSION['_byaTahun'];
    // Tampilan proses
    $persen = $_byaJumlah > 0 ? $_byaProses / $_byaJumlah * 100 : 0;
    $persen = number_format($persen);
    $sisa = 100 - $persen;
    echo "\n  <p align=center>\n  <b>{$_byaProses}</b> <sup>~{$_byaJumlah}</sup><br />\n  <img src='../img/B1.jpg' width=1 height=20 /><img src='../img/B2.jpg' width={$persen} height=20 /><img src='../img/B3.jpg' width={$sisa} height=20 /><img src='../img/B1.jpg' width=1 height=20 /><br />\n  <font size=+2>{$persen} %</font>\n  " . $_SESSION['_byaPMBID_' . $_byaProses] . "<br />" . $_SESSION['_byaNama_' . $_byaProses] . "</p>";
    if ($BIPOTID == 0) {
        $BIPOTID = SetBIPOTID($mhsw, $ProdiID, $ProgramID);
    }
    //ProsesBIPOT2($mhsw['MhswID']);
    //HitungUlangBIPOTPMB($mhsw['MhswID']);
    // Ambil BIPOT yg sudah diupdate
    $Total = VirtualBipotMhsw($MhswID, $BIPOTID);
    echo "<p align=center><font size=+2>{$Total} (Bipot: {$BIPOTID})</font></p>";
    if ($BIPOTID > 0 && $Total > 0) {
        $_SESSION['_byaDiproses']++;
        $prodi = GetaField('prodi', "KodeID='" . KodeID . "' and ProdiID", $ProdiID, 'Nama');
        $smt = GetaField('semester', 'Semester', $_SESSION['_byaSemester'], 'Nama');
        $smt = substr($smt, 0, 6);
        $smt = str_pad($smt, 6, ' ', STR_PAD_RIGHT);
        // Tuliskan ke file
        $fn = "../" . $_SESSION['_byaFile'];
        $f = fopen($fn, 'a');
        fwrite($f, $_SESSION['_byaTahun'] . '-' . $smt . '|' . '000000|00000|' . str_pad($MhswID, 16, ' ', STR_PAD_RIGHT) . '|' . str_pad(substr($Nama, 0, 21), 21, ' ', STR_PAD_RIGHT) . '|' . str_pad(' ', 25, ' ', STR_PAD_RIGHT) . '|' . str_pad($ProdiID, 10, ' ', STR_PAD_RIGHT) . '|' . str_pad(substr($prodi, 0, 25), 25, ' ', STR_PAD_RIGHT) . '|' . substr($TahunID, 0, 4) . '|' . '00000004201390002572|' . str_pad(' ', 20, ' ', STR_PAD_RIGHT) . '|' . str_pad($Total, 10, '0', STR_PAD_LEFT) . '|' . '0000000000|0000000000|0000000000|0000000000|0000000000|0000000000|0000000000|0000000000|' . '01|' . $_SESSION['_byaKodeInstitusi'] . '|' . $_SESSION['_byaKodePembayaran'] . '|' . str_pad(substr($MhswID, 0, 10), 10, '0', STR_PAD_LEFT) . '|' . 'F' . "\n");
        fclose($f);
    }
    echo "<p align=center>Berhasil diproses: <b>{$_SESSION['_byaDiproses']}</b></p>";
    // Next...
    $_SESSION['_byaProses']++;
    echo <<<SCR
    <script>
    window.onload=setTimeout("window.location='../{$_SESSION['mnux']}.proses.php'", {$tmr});
    </script>
SCR;
}