function PredDel() { $PredikatID = $_REQUEST['PredikatID']; $s = "delete from predikat where PredikatID = '{$PredikatID}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&mk=pred&sub=", 100); }
function AkademikSav() { // Cek Kelengkapan $_syarat = array(); $_syarat = $_REQUEST['PMBSyaratID']; $syarat = empty($_syarat) ? '' : '.' . implode('.', $_syarat) . '.'; // Cek Kelengkapan $mhsw = GetFields('mhsw', 'MhswID', $_REQUEST['mhswid'], 'StatusAwalID, ProdiID, Syarat, SyaratLengkap'); $s = "select PMBSyaratID, Nama\r\n from pmbsyarat\r\n where NA='N' and KodeID='{$_SESSION['KodeID']}'\r\n and INSTR(StatusAwalID, '.{$mhsw['StatusAwalID']}.') >0\r\n and INSTR(ProdiID, '.{$mhsw['ProdiID']}.') >0\r\n order by PMBSyaratID"; $r = _query($s); $lkp = True; if (!empty($_syarat)) { while ($w = _fetch_array($r)) { if (array_search($w['PMBSyaratID'], $_syarat) === false) { $lkp = false; } } } else { $lkp = false; } $Lengkap = $lkp == true ? 'Y' : 'N'; // Simpan $TahunID = sqling($_REQUEST['TahunID']); $s = "update mhsw \r\n set PenasehatAkademik='{$_REQUEST['PenasehatAkademik']}', ProgramID='{$_REQUEST['ProgramID']}',\r\n TahunID = '{$TahunID}',\r\n StatusAwalID='{$_REQUEST['StatusAwalID']}', StatusMhswID='{$_REQUEST['StatusMhswID']}',\r\n Syarat='{$syarat}', SyaratLengkap='{$Lengkap}', BatasStudi='{$_REQUEST['BatasStudi']}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul={$_SESSION['submodul']}", 10); }
function KurSav() { $md = $_REQUEST['md'] + 0; $KurikulumID = $_REQUEST['KurikulumID']; $KurikulumKode = $_REQUEST['KurikulumKode']; $Nama = sqling($_REQUEST['Nama']); $Sesi = sqling($_REQUEST['Sesi']); $JmlSesi = $_REQUEST['JmlSesi'] + 0; $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; // simpan if ($md == 0) { $s = "update kurikulum set KurikulumKode='{$KurikulumKode}',\r\n Nama='{$Nama}', Sesi='{$Sesi}', JmlSesi='{$JmlSesi}', NA='{$NA}', TglEdit=now(), LoginEdit='{$_SESSION['_Login']}'\r\n where KurikulumID='{$_REQUEST['KurikulumID']}' "; $r = _query($s); // update jika jadi aktif } else { $s = "insert into kurikulum (KurikulumKode, KodeID, ProdiID, Nama, Sesi, JmlSesi, NA, TglBuat, LoginBuat)\r\n values('{$KurikulumKode}', '{$_REQUEST['KodeID']}', '{$_SESSION['prodi']}', '{$Nama}', '{$Sesi}', '{$JmlSesi}', '{$NA}', now(), '{$_SESSION['_Login']}')"; $r = _query($s); $KurikulumID = GetLastID(); } // Non aktifkan yg lain /* ~~~ 03/11/2008 --> supaya bisa banyak kurikulum aktif if ($NA == 'N') { $s1 = "update kurikulum set NA='Y' where ProdiID='$_SESSION[prodi]' and KurikulumID<>$KurikulumID"; $r1 = _query($s1); } */ BerhasilSimpan("?mnux={$_SESSION['mnux']}", 100); }
function KampSav() { $md = $_REQUEST['md'] + 0; $KampusID = $_REQUEST['KampusID']; $Nama = sqling($_REQUEST['Nama']); $Alamat = sqling($_REQUEST['Alamat']); $Kota = sqling($_REQUEST['Kota']); $Telepon = sqling($_REQUEST['Telepon']); $Fax = sqling($_REQUEST['Fax']); $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; // simpan if ($md == 0) { $s = "update kampus set Nama='{$Nama}', KodeID='" . KodeID . "',\r\n Alamat='{$Alamat}', Kota='{$Kota}', Telepon='{$Telepon}', Fax='{$Fax}', NA='{$NA}'\r\n where KampusID='{$KampusID}' "; $r = _query($s); } else { $ada = GetFields('kampus', 'KampusID', $KampusID, '*'); if (!empty($ada)) { echo ErrorMsg("Gagal Simpan", "Kampus dengan kode: <b>{$KampusID}</b> telah ada dengan nama <b>{$ada['Nama']}</b>.<br>\r\n Gunakan kode kampus lain."); } else { $s = "insert into kampus (KampusID, Nama, KodeID,\r\n Alamat, Kota, Telepon, Fax, NA)\r\n values ('{$KampusID}', '{$Nama}', '" . KodeID . "',\r\n '{$Alamat}', '{$Kota}', '{$Telepon}', '{$Fax}', '{$NA}')"; $r = _query($s); } } BerhasilSimpan("?mnux={$_SESSION['mnux']}", 100); }
function SimpanPwd($_MhswID) { $_MhswID = sqling($_REQUEST['_MhswID']); $PWD1 = sqling($_REQUEST['PWD1']); $PWD2 = sqling($_REQUEST['PWD2']); $s = "update mhsw \r\n set `Password`=LEFT(PASSWORD('{$PWD1}'), 10) \r\n where KodeID = '" . KodeID . "'\r\n and MhswID = '{$_MhswID}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=&_MhswID={$_MhswID}", 1000); }
function BankSav() { $Autodebet = empty($_REQUEST['Autodebet']) ? 'N' : $_REQUEST['Autodebet']; $NamaBank = sqling($_REQUEST['NamaBank']); $NomerRekening = sqling($_REQUEST['NomerRekening']); $s = "update mhsw set Autodebet='{$Autodebet}',\r\n NamaBank='{$NamaBank}', NomerRekening='{$NomerRekening}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul={$_SESSION['submodul']}", 10); }
function SimpanPwd($_DosenID) { $_DosenID = sqling($_REQUEST['_DosenID']); $PWD1 = sqling($_REQUEST['PWD1']); $PWD2 = sqling($_REQUEST['PWD2']); $s = "update dosen\r\n set `Password`=LEFT(PASSWORD('{$PWD1}'), 10),\r\n LevelID = '100' \r\n where KodeID = '" . KodeID . "'\r\n and Login = '******' "; $r = _query($s); //die("<pre>$s</pre>"); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=&_DosenID={$_DosenID}", 1); }
function SekolahSav() { $AsalSekolah = $_REQUEST['AsalSekolah']; $JurusanSekolah = $_REQUEST['JurusanSekolah']; $TahunLulus = $_REQUEST['TahunLulus']; $NilaiSekolah = $_REQUEST['NilaiSekolah']; $JenisSekolahID = GetaField('asalsekolah', 'SekolahID', $AsalSekolah, 'JenisSekolahID'); // Simpan $s = "update mhsw set AsalSekolah='{$AsalSekolah}', JenisSekolahID='{$JenisSekolahID}',\r\n JurusanSekolah='{$JurusanSekolah}',\r\n TahunLulus='{$TahunLulus}', NilaiSekolah='{$NilaiSekolah}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul={$_SESSION['submodul']}", 100); }
function PTSav() { $AsalPT = $_REQUEST['AsalPT']; $ProdiAsalPT = $_REQUEST['ProdiAsalPT']; // Edit: Ilham $LulusAsalPT = empty($_REQUEST['LulusAsalPT']) ? 'N' : $_REQUEST['LulusAsalPT']; $TglLulusAsalPT = "{$_REQUEST['TL_y']}-{$_REQUEST['TL_m']}-{$_REQUEST['TL_d']}"; echo $TglLulusAsalPT; $IPKAsalPT = $_REQUEST['IPKAsalPT']; $s = "update mhsw set AsalPT='{$AsalPT}', ProdiAsalPT='{$ProdiAsalPT}', LulusAsalPT='{$LulusAsalPT}', \r\n TglLulusAsalPT='{$TglLulusAsalPT}', IPKAsalPT='{$IPKAsalPT}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul={$_SESSION['submodul']}", 100); }
function AlamatSav() { $AlamatAsal = sqling($_REQUEST['AlamatAsal']); $RTAsal = sqling($_REQUEST['RTAsal']); $RWAsal = sqling($_REQUEST['RWAsal']); $KotaAsal = sqling($_REQUEST['KotaAsal']); $KodePosAsal = sqling($_REQUEST['KodePosAsal']); $PropinsiAsal = sqling($_REQUEST['PropinsiAsal']); $NegaraAsal = sqling($_REQUEST['NegaraAsal']); $TeleponAsal = sqling($_REQUEST['TeleponAsal']); // Simpan $s = "update mhsw set AlamatAsal='{$AlamatAsal}',\r\n RTAsal='{$RTAsal}', RWAsal='{$RWAsal}',\r\n KotaAsal='{$KotaAsal}', KodePosAsal='{$KodePosAsal}',\r\n PropinsiAsal='{$PropinsiAsal}', NegaraAsal='{$NegaraAsal}', TeleponAsal='{$TeleponAsal}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul=almt&gos=", 100); }
function KonsSav() { $md = $_REQUEST['md']; $KonsentrasiKode = strtoupper(sqling($_REQUEST['KonsentrasiKode'])); $Nama = sqling($_REQUEST['Nama']); $Keterangan = sqling($_REQUEST['Keterangan']); $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; if ($md == 0) { $s = "update konsentrasi set KonsentrasiKode='{$KonsentrasiKode}',\r\n Nama='{$Nama}', Keterangan='{$Keterangan}', NA='{$NA}'\r\n where KonsentrasiID='{$_REQUEST['KonsentrasiID']}' "; } else { $s = "insert into konsentrasi (KonsentrasiKode, KodeID, ProdiID, Nama, Keterangan, NA)\r\n values('{$KonsentrasiKode}', '{$_REQUEST['KodeID']}', '{$_REQUEST['prodi']}',\r\n '{$Nama}', '{$Keterangan}', '{$NA}')"; } $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&mk=Kons", 100); }
function JenKurSav() { $md = $_REQUEST['md'] + 0; $Singkatan = sqling($_REQUEST['Singkatan']); $Nama = sqling($_REQUEST['Nama']); $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; if ($md == 0) { $JenisKurikulumID = $_REQUEST['JenisKurikulumID']; $s = "update jeniskurikulum set Singkatan='{$Singkatan}', Nama='{$Nama}', NA='{$NA}'\r\n where JenisKurikulumID='{$JenisKurikulumID}'"; $r = _query($s); } else { $s = "insert into jeniskurikulum (ProdiID, KodeID, Singkatan, Nama, NA)\r\n values ('{$_SESSION['prodi']}', '{$_SESSION['KodeID']}', '{$Singkatan}', '{$Nama}', '{$NA}')"; $r = _query($s); } BerhasilSimpan("?mnux={$_SESSION['mnux']}&mk=JenKur", 100); }
function HadirSKSSav() { $md = $_REQUEST['md'] + 0; $HadirSKSID = $_REQUEST['HadirSKSID'] + 0; $DefKehadiran = $_REQUEST['DefKehadiran'] + 0; $DefMaxAbsen = $_REQUEST['DefMaxAbsen'] + 0; $SKS = $_REQUEST['SKS'] + 0; $ProdiID = $_REQUEST['prodi']; if ($md == 0) { $s = "update hadirsks \r\n set DefKehadiran='{$DefKehadiran}', \r\n\t\t DefMaxAbsen='{$DefMaxAbsen}', \r\n SKS='{$SKS}',\r\n LoginEdit = '{$_SESSION['_Login']}', TanggalEdit = now()\r\n where HadirSKSID = {$HadirSKSID} "; $r = _query($s); } else { $s = "insert into hadirsks \r\n (KodeID, ProdiID, DefKehadiran, DefMaxAbsen, SKS,\r\n LoginBuat, TanggalBuat)\r\n values \r\n ('" . KodeID . "', '{$ProdiID}', '{$DefKehadiran}', '{$DefMaxAbsen}', '{$SKS}',\r\n '{$_SESSION['_Login']}', now())"; $r = _query($s); } BerhasilSimpan("?mnux={$_SESSION['mnux']}&mk=HadirSKS&sub=", 100); }
function MaxSKSSav() { $md = $_REQUEST['md'] + 0; $MaxSKSID = $_REQUEST['MaxSKSID'] + 0; $DariIP = $_REQUEST['DariIP'] + 0; $SampaiIP = $_REQUEST['SampaiIP'] + 0; $SKS = $_REQUEST['SKS'] + 0; $ProdiID = $_REQUEST['prodi']; if ($md == 0) { $s = "update maxsks \r\n set DariIP='{$DariIP}', \r\n SampaiIP='{$SampaiIP}', \r\n SKS='{$SKS}',\r\n LoginEdit = '{$_SESSION['_Login']}', TanggalEdit = now()\r\n where MaxSKSID = {$MaxSKSID} "; $r = _query($s); } else { $s = "insert into maxsks \r\n (KodeID, ProdiID, DariIP, SampaiIP, SKS,\r\n LoginBuat, TanggalBuat)\r\n values \r\n ('" . KodeID . "', '{$ProdiID}', '{$DariIP}', '{$SampaiIP}', '{$SKS}',\r\n '{$_SESSION['_Login']}', now())"; $r = _query($s); } BerhasilSimpan("?mnux={$_SESSION['mnux']}&mk=MaxSKS&sub=", 100); }
function JenSav() { $md = $_REQUEST['md'] + 0; $Urutan = $_REQUEST['Urutan'] + 0; $JenisMKID = $_REQUEST['JenisMKID']; $Singkatan = $_REQUEST['Singkatan']; $Nama = sqling($_REQUEST['Nama']); $KodeID = $_REQUEST['KodeID']; $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; // Simpan if ($md == 0) { $s = "update jenismk set Urutan='{$Urutan}', Singkatan='{$Singkatan}', Nama='{$Nama}', ProdiID='{$_REQUEST['prodi']}', NA='{$NA}' where JenisMKID='{$JenisMKID}' "; } else { $s = "insert into jenismk (Urutan, Singkatan, Nama, KodeID, ProdiID, NA)\r\n values('{$Urutan}', '{$Singkatan}', '{$Nama}', '{$KodeID}', '{$_REQUEST['prodi']}', '{$NA}')"; } $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&mk=Jen", 100); }
function OrtuSav() { $NamaAyah = sqling($_REQUEST['NamaAyah']); $NamaIbu = sqling($_REQUEST['NamaIbu']); $AlamatOrtu = sqling($_REQUEST['AlamatOrtu']); $RTOrtu = sqling($_REQUEST['RTOrtu']); $RWOrtu = sqling($_REQUEST['RWOrtu']); $KotaOrtu = sqling($_REQUEST['KotaOrtu']); $PropinsiOrtu = sqling($_REQUEST['PropinsiOrtu']); $NegaraOrtu = sqling($_REQUEST['NegaraOrtu']); $TeleponOrtu = sqling($_REQUEST['TeleponOrtu']); $HandphoneOrtu = sqling($_REQUEST['HandphoneOrtu']); $EmailOrtu = sqling($_REQUEST['EmailOrtu']); // Simpan $s = "update mhsw set NamaAyah='{$NamaAyah}', AgamaAyah='{$_REQUEST['AgamaAyah']}',\r\n PendidikanAyah='{$_REQUEST['PendidikanAyah']}',\r\n PekerjaanAyah='{$_REQUEST['PekerjaanAyah']}',\r\n HidupAyah='{$_REQUEST['HidupAyah']}',\r\n NamaIbu='{$_REQUEST['NamaIbu']}',\r\n AgamaIbu='{$_REQUEST['AgamaIbu']}',\r\n PendidikanIbu='{$_REQUEST['PendidikanIbu']}',\r\n PekerjaanIbu='{$_REQUEST['PekerjaanIbu']}',\r\n HidupIbu='{$_REQUEST['HidupIbu']}',\r\n AlamatOrtu='{$_REQUEST['AlamatOrtu']}',\r\n RTOrtu='{$_REQUEST['RTOrtu']}',\r\n RWOrtu='{$_REQUEST['RWOrtu']}',\r\n KotaOrtu='{$_REQUEST['KotaOrtu']}',\r\n KodePosOrtu='{$_REQUEST['KodePosOrtu']}',\r\n PropinsiOrtu='{$_REQUEST['PropinsiOrtu']}',\r\n NegaraOrtu='{$_REQUEST['NegaraOrtu']}',\r\n TeleponOrtu='{$_REQUEST['TeleponOrtu']}',\r\n HandphoneOrtu='{$_REQUEST['HandphoneOrtu']}',\r\n EmailOrtu='{$_REQUEST['EmailOrtu']}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul={$_SESSION['submodul']}", 10); }
function ProgSav() { $md = $_REQUEST['md'] + 0; $ProgramID = $_REQUEST['ProgramID']; $Nama = sqling($_REQUEST['Nama']); $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; if ($md == 0) { $s = "update program set Nama='{$Nama}', NA='{$NA}' where ProgramID='{$ProgramID}' and KodeID = '" . KodeID . "' "; _query($s); } else { $ada = GetFields('program', 'ProgramID', $ProgramID, '*'); if (empty($ada)) { $s = "insert into program(ProgramID, Nama, KodeID, NA)\r\n values('{$ProgramID}', '{$Nama}', '" . KodeID . "', '{$NA}')"; _query($s); } else { echo ErrorMsg('Kesalahan', "Kode program: <b>{$ProgramID}</b> telah dipakai oleh Program: <b>{$ada['Nama']}</b>.<br>\r\n Gunakan Kode Program lain."); } } BerhasilSimpan("?mnux={$_SESSION['mnux']}", 10); }
function KampSav() { $md = $_REQUEST['md'] + 0; $KampusID = $_REQUEST['KampusID']; $Alamat = sqling($_REQUEST['Alamat']); // simpan if ($md == 0) { $s = "update memo set MemoDesc='{$Alamat}'\r\n where MemoID='{$KampusID}' "; $r = _query($s); } else { $ada = GetFields('memo', 'MemoID', $KampusID, '*'); if (!empty($ada)) { echo ErrorMsg("Gagal Simpan", "Memo dengan kode: <b>{$KampusID}</b> telah ada dengan nama <b>{$ada['MemoID']}</b>.<br>\r\n Gunakan kode lain."); } else { $s = "insert into memo (MemoID, MemoDesc)\r\n values ('{$KampusID}', '{$Alamat}')"; $r = _query($s); } } BerhasilSimpan("?mnux={$_SESSION['mnux']}", 100); }
function PribadiSav() { $Nama = sqling($_REQUEST['Nama']); $TempatLahir = sqling($_REQUEST['TempatLahir']); $TanggalLahir = "{$_REQUEST['TanggalLahir_y']}-{$_REQUEST['TanggalLahir_m']}-{$_REQUEST['TanggalLahir_d']}"; $Kebangsaan = sqling($_REQUEST['Kebangsaan']); $Alamat = sqling($_REQUEST['Alamat']); $Kota = sqling($_REQUEST['Kota']); $KodePos = sqling($_REQUEST['KodePos']); $RT = sqling($_REQUEST['RT']); $RW = sqling($_REQUEST['RW']); $Propinsi = sqling($_REQUEST['Propinsi']); $Negara = sqling($_REQUEST['Negara']); $Telepon = sqling($_REQUEST['Telepon']); $Handphone = sqling($_REQUEST['Handphone']); $Email = sqling($_REQUEST['Email']); // Simpan $s = "update mhsw set Nama=upper('{$Nama}'),\r\n TempatLahir='{$TempatLahir}', TanggalLahir='{$TanggalLahir}',\r\n Agama='{$_REQUEST['Agama']}', StatusSipil='{$_REQUEST['StatusSipil']}',\r\n Kelamin='{$_REQUEST['Kelamin']}', WargaNegara='{$_REQUEST['WargaNegara']}', Kebangsaan='{$Kebangsaan}',\r\n Alamat='{$Alamat}', RT='{$RT}', RW='{$RW}',\r\n Kota='{$Kota}', KodePos='{$KodePos}', Propinsi='{$Propinsi}', Negara='{$Negara}',\r\n Telepon='{$Telepon}', Handphone='{$Handphone}', Email='{$Email}'\r\n where MhswID='{$_REQUEST['mhswid']}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&submodul=pri", 100); }
function Simpan() { $md = $_REQUEST['md'] + 0; $id = $_REQUEST['id']; $idgrade = $_REQUEST['idgrade'] + 0; $GradeNilai = $_REQUEST['GradeNilai']; $NilaiUjianMin = $_REQUEST['NilaiUjianMin'] + 0; $NilaiUjianMax = $_REQUEST['NilaiUjianMax'] + 0; $Lulus = $_REQUEST['Lulus'] == 'Y' ? 'Y' : 'N'; $Keterangan = sqling($_REQUEST['Keterangan']); $NA = $_REQUEST['NA'] == 'Y' ? 'Y' : 'N'; if ($md == 0) { $s = "update `pmbgrade` set GradeNilai='{$id}', NilaiUjianMin='{$NilaiUjianMin}', NilaiUjianMax='{$NilaiUjianMax}', \r\n\t\t\t\t\t\t\t\tLulus='{$Lulus}', \r\n\t\t\t\t\t\t\t\tKeterangan='{$Keterangan}', NA='{$NA}' where GradeNilaiID='{$idgrade}'"; $r = _query($s); } else { if ($md == 1) { $s = "insert `pmbgrade` set GradeNilai='{$id}', KodeID='" . KodeID . "', \r\n\t\t\t\t\t\t\t\t\tNilaiUjianMin='{$NilaiUjianMin}', NilaiUjianMax='{$NilaiUjianMax}',\r\n\t\t\t\t\t\t\t\t\tLulus='{$Lulus}',\r\n\t\t\t\t\t\t\t\t\tKeterangan='{$Keterangan}', NA='{$NA}'"; $r = _query($s); } } BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=pmbgrade&sub", 10); }
function RekSav() { $md = $_REQUEST['md'] + 0; $RekeningID = $_REQUEST['RekeningID']; $Nama = sqling($_REQUEST['Nama']); $Bank = sqling($_REQUEST['Bank']); $Cabang = sqling($_REQUEST['Cabang']); $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; if ($md == 0) { $s = "update rekening set Nama='{$Nama}', Bank='{$Bank}', Cabang='{$Cabang}', NA='{$NA}'\r\n where RekeningID='{$RekeningID}' "; $r = _query($s); } else { $ada = GetFields('rekening', 'RekeningID', $RekeningID, '*'); if (empty($ada)) { $s = "insert into rekening (RekeningID, KodeID, Nama, Bank, Cabang, NA)\r\n values('{$RekeningID}', '{$_SESSION['KodeID']}', '{$Nama}', '{$Bank}', '{$Cabang}', '{$NA}')"; $r = _query($s); } else { echo ErrorMsg('Rekening Tidak Dapat Disimpan', "<p>Nomer rekening sudah ada. Berikut adalah data rekening tersebut:</p>\r\n <p><table class=box cellspacing=1 cellpadding=4>\r\n <tr><td class=inp1>Nomer Rekening</td><td class=ul>{$ada['RekeningID']}</td></tr>\r\n <tr><td class=inp1>Kode Institusi</td><td class=ul>{$ada['KodeID']}</td></tr>\r\n <tr><td class=inp1>Nama Pemilik</td><td class=ul>{$ada['Nama']}</td></tr>\r\n <tr><td class=inp1>Nama Bank</td><td class=ul>{$ada['Bank']}</td></tr>\r\n <tr><td class=inp1>Tidak aktif?</td><td class=ul><img src='img/book{$ada['NA']}.gif'></td></tr>\r\n </table></p>"); } } BerhasilSimpan("?mnux={$_SESSION['mnux']}", 10); }
function SimpanTTD() { $PID = $_REQUEST['PID']; $KodeJabatan = sqling($_REQUEST['KodeJabatan']); $upf = $_FILES['foto']['tmp_name']; $arrNama = explode('.', $_FILES['foto']['name']); $tipe = $_FILES['foto']['type']; $arrtipe = explode('/', $tipe); $extensi = $arrtipe[1]; if ($extensi != 'gif') { die(ErrorMsg("Error", "File tanda tangan yang bisa diupload hanya yang berformat gif.<br />\r\n Hubunti Sysadmin untuk informasi lebih lanjut.\r\n <hr size=1 color=silver />\r\n <input type=button name='btnKembali' value='Kembali' onClick=\"location='?mnux={$_SESSION['mnux']}&gos='\" />")); } $dest = "ttd/" . $KodeJabatan . '.ttd.gif'; //echo $dest; if (move_uploaded_file($upf, $dest)) { $_rand = rand(); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=&_rnd=" . $_rand, 1); } else { echo ErrorMsg("Gagal Upload Foto", "Tidak dapat meng-upload file foto.<br />\r\n Periksa file yg di-upload, karena besar file dibatasi cuma: <b>{$_REQUEST['MAX_FILE_SIZE']}</b> byte."); } //print_r($_FILES); }
function SaveAll($MhswID, $mhsw) { /*$si = "select k.* from krs k left outer join khs h on h.KHSID = k.KHSID and h.KodeID = '".KodeID."' where k.MhswID = '$MhswID' order by k.TahunID, k.MKKode"; $ri = _query($si); $ni = _num_rows($ri); while($wi=_fetch_array($ri)) { $tempNum = substr($wi[MKKode],6,1); if($tempNum==1) $theYear = $InputTahun1.$tempNum; else if($tempNum==2) $theYear = $InputTahun1.$tempNum; else if($tempNum==3) $theYear = ($InputTahun1+1).($tempNum-2); else if($tempNum==4) $theYear = ($InputTahun1+1).($tempNum-2); else if($tempNum==5) $theYear = ($InputTahun1+2).($tempNum-4); else if($tempNum==6) $theYear = ($InputTahun1+2).($tempNum-4); else if($tempNum==7) $theYear = ($InputTahun1+3).($tempNum-6); else if($tempNum==8) $theYear = ($InputTahun1+3).($tempNum-6); else $theYear = ''; //echo "$wi[MKKode]: $theYear<br>"; $ss = "update `krs` set TahunID='$theYear', Setara = 'Y', SetaraKode = 'a', SetaraNama = 'a', SetaraGrade = 'a', Sah = 'Y', Final = 'Y', LoginEdit = '$_SESSION[_Login]', TanggalEdit = now() where KRSID = '$wi[KRSID]'"; $rr = _query($ss); }*/ $Siska = array($_REQUEST['Select1'], $_REQUEST['Select2'], $_REQUEST['Select3'], $_REQUEST['Select4'], $_REQUEST['Select5'], $_REQUEST['Select6'], $_REQUEST['Select7'], $_REQUEST['Select8'], $_REQUEST['Select9'], $_REQUEST['Select10'], $_REQUEST['Select11'], $_REQUEST['Select12'], $_REQUEST['Select13'], $_REQUEST['Select14'], $_REQUEST['Select15'], $_REQUEST['Select16'], $_REQUEST['Select17'], $_REQUEST['Select18'], $_REQUEST['Select19'], $_REQUEST['Select20'], $_REQUEST['Select21'], $_REQUEST['Select22'], $_REQUEST['Select23'], $_REQUEST['Select24'], $_REQUEST['Select25'], $_REQUEST['Select26'], $_REQUEST['Select27'], $_REQUEST['Select28'], $_REQUEST['Select29'], $_REQUEST['Select30'], $_REQUEST['Select31'], $_REQUEST['Select32'], $_REQUEST['Select33'], $_REQUEST['Select34'], $_REQUEST['Select35'], $_REQUEST['Select36'], $_REQUEST['Select37'], $_REQUEST['Select38'], $_REQUEST['Select39'], $_REQUEST['Select40'], $_REQUEST['Select41'], $_REQUEST['Select42'], $_REQUEST['Select43'], $_REQUEST['Select44'], $_REQUEST['Select45'], $_REQUEST['Select46'], $_REQUEST['Select47'], $_REQUEST['Select48'], $_REQUEST['Select49'], $_REQUEST['Select50'], $_REQUEST['Select51'], $_REQUEST['Select52'], $_REQUEST['Select53'], $_REQUEST['Select54'], $_REQUEST['Select55'], $_REQUEST['Select56'], $_REQUEST['Select57'], $_REQUEST['Select58'], $_REQUEST['Select59'], $_REQUEST['Select60'], $_REQUEST['Select61'], $_REQUEST['Select62'], $_REQUEST['Select63'], $_REQUEST['Select64'], $_REQUEST['Select65'], $_REQUEST['Select66'], $_REQUEST['Select67'], $_REQUEST['Select68'], $_REQUEST['Select69'], $_REQUEST['Select70']); $Siska2 = array($_REQUEST['Hidden1'], $_REQUEST['Hidden2'], $_REQUEST['Hidden3'], $_REQUEST['Hidden4'], $_REQUEST['Hidden5'], $_REQUEST['Hidden6'], $_REQUEST['Hidden7'], $_REQUEST['Hidden8'], $_REQUEST['Hidden9'], $_REQUEST['Hidden10'], $_REQUEST['Hidden11'], $_REQUEST['Hidden12'], $_REQUEST['Hidden13'], $_REQUEST['Hidden14'], $_REQUEST['Hidden15'], $_REQUEST['Hidden16'], $_REQUEST['Hidden17'], $_REQUEST['Hidden18'], $_REQUEST['Hidden19'], $_REQUEST['Hidden20'], $_REQUEST['Hidden21'], $_REQUEST['Hidden22'], $_REQUEST['Hidden23'], $_REQUEST['Hidden24'], $_REQUEST['Hidden25'], $_REQUEST['Hidden26'], $_REQUEST['Hidden27'], $_REQUEST['Hidden28'], $_REQUEST['Hidden29'], $_REQUEST['Hidden30'], $_REQUEST['Hidden31'], $_REQUEST['Hidden32'], $_REQUEST['Hidden33'], $_REQUEST['Hidden34'], $_REQUEST['Hidden35'], $_REQUEST['Hidden36'], $_REQUEST['Hidden37'], $_REQUEST['Hidden38'], $_REQUEST['Hidden39'], $_REQUEST['Hidden40'], $_REQUEST['Hidden41'], $_REQUEST['Hidden42'], $_REQUEST['Hidden43'], $_REQUEST['Hidden44'], $_REQUEST['Hidden45'], $_REQUEST['Hidden46'], $_REQUEST['Hidden47'], $_REQUEST['Hidden48'], $_REQUEST['Hidden49'], $_REQUEST['Hidden50'], $_REQUEST['Hidden51'], $_REQUEST['Hidden52'], $_REQUEST['Hidden53'], $_REQUEST['Hidden54'], $_REQUEST['Hidden55'], $_REQUEST['Hidden56'], $_REQUEST['Hidden57'], $_REQUEST['Hidden58'], $_REQUEST['Hidden59'], $_REQUEST['Hidden60'], $_REQUEST['Hidden61'], $_REQUEST['Hidden62'], $_REQUEST['Hidden63'], $_REQUEST['Hidden64'], $_REQUEST['Hidden65'], $_REQUEST['Hidden66'], $_REQUEST['Hidden67'], $_REQUEST['Hidden68'], $_REQUEST['Hidden69'], $_REQUEST['Hidden70']); $x = 0; while (!empty($Siska[$x])) { //echo "Select: $Siska[$x], KRSID: $Siska2[$x]<br>"; /*$ss = "update `krs` set TahunID='$Siska[$x]', Setara ='Y', SetaraKode = 'a', SetaraNama = 'a', SetaraGrade = 'a', Sah = 'Y', Final = 'Y', LoginEdit = '$_SESSION[_Login]', TanggalEdit = now() where KRSID='$Siska2[$x]'";*/ // cek khs $adakhs = GetaField('khs', "MhswID='{$MhswID}' and TahunID='{$Siska[$x]}' and KodeID", KodeID, 'KHSID') + 0; if ($adakhs == 0) { // create new TahunID $Sesi = GetaField('khs', "MhswID='{$MhswID}' and TahunID < '{$Siska[$x]}' and KodeID", KodeID, "Sesi") + 1; $s = "insert into khs\r\n (TahunID, KodeID, ProgramID, \r\n ProdiID, MhswID, StatusMhswID,\r\n Sesi, LoginBuat, TanggalBuat)\r\n values\r\n ('{$Siska[$x]}', '" . KodeID . "', '{$mhsw['ProgramID']}',\r\n '{$mhsw['ProdiID']}', '{$MhswID}', 'A',\r\n '{$Sesi}', '{$_SESSION['_Login']}', now())"; $r = _query($s); $adakhs = GetLastID(); } // update krs $ss = "update `krs` set TahunID='{$Siska[$x]}', KHSID='{$adakhs}' where KRSID='{$Siska2[$x]}'"; $rr = _query($ss); $x++; } UrutSesi($MhswID, $mhsw); BerhasilSimpan("?mnux={$_SESSION['mnux']}", 1000); }
function fn_0_save() { $mhswid = sqling($_REQUEST['mhswid']); $Alamat = sqling($_REQUEST['Alamat']); $Kota = sqling($_REQUEST['Kota']); $KodePos = sqling($_REQUEST['KodePos']); $RT = sqling($_REQUEST['RT']); $RW = sqling($_REQUEST['RW']); $Propinsi = sqling($_REQUEST['Propinsi']); $Negara = sqling($_REQUEST['Negara']); $Telepon = sqling($_REQUEST['Telepon']); $Handphone = sqling($_REQUEST['Handphone']); $Email = sqling($_REQUEST['Email']); // Simpan $s = "update alumni\r\n set Alamat = '{$Alamat}', Kota = '{$Kota}', KodePos = '{$KodePos}',\r\n RT = '{$RT}', RW = '{$RW}', Propinsi = '{$Propinsi}', Negara = '{$Negara}',\r\n Telepon = '{$Telepon}', Handphone = '{$Handphone}', Email = '{$Email}',\r\n TanggalEdit = now(), LoginEdit = '{$_SESSION['_Login']}'\r\n where MhswID = '{$mhswid}' and KodeID = '" . KodeID . "' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=", 1); }
function ProsesBIPOT($gels, $gel) { $PMBID = sqling($_REQUEST['PMBID']); $pmb = GetFields('pmb', "KodeID='" . KodeID . "' and PMBID", $PMBID, '*'); if (empty($pmb)) { die(ErrorMsg('Error', "Data Cama dengan nomer PMB: <b>{$PMBID}</b> tidak ditemukan.<br />\r\n Hubungi Sysadmin untuk informasi lebih lanjut.\r\n <hr size=1 color=silver />\r\n <input type=button name='Kembali' value='Kembali'\r\n onClick=\"location='{$_SESSION['mnux']}&gos='\" />")); } // Ambil BIPOT-nya $s = "select * \r\n from bipot2 \r\n where BIPOTID = '{$pmb['BIPOTID']}'\r\n and Otomatis = 'Y'\r\n\t and PerMataKuliah = 'N'\r\n\t and PerSKS = 'N'\r\n\t and PerLab = 'N'\r\n and NA = 'N'\r\n order by TrxID, Prioritas"; $r = _query($s); while ($w = _fetch_array($r)) { $oke = true; // Apakah sesuai dengan status awalnya? $pos = strpos($w['StatusAwalID'], "." . $pmb['StatusAwalID'] . "."); $oke = $oke && !($pos === false); // Apakah sesuai dengan status mahasiswanya? $pos = strpos($w['StatusMhswID'], ".A."); $oke = $oke && !($pos === false); // Apakah grade-nya? if ($oke) { if ($w['GunakanGradeNilai'] == 'Y') { $pos = strpos($w['GradeNilai'], "." . $pmb['GradeNilai'] . "."); $oke = $oke && !($pos === false); } } if ($oke) { if ($w['GunakanGradeIPK'] == 'Y') { $oke = false; } } // Apakah dimulai pada sesi 1? if ($oke) { if ($w['MulaiSesi'] <= 1) { $oke = true; } else { $oke = false; } } // Simpan data if ($oke) { // Cek, sudah ada atau belum? Kalau sudah, ambil ID-nya $ada = GetaField('bipotmhsw', "KodeID='" . KodeID . "' and PMBID = '{$pmb['PMBID']}'\r\n and TahunID='{$pmb['PMBPeriodID']}' and BIPOT2ID", $w['BIPOT2ID'], "BIPOTMhswID") + 0; // Cek apakah memakai script atau tidak? if ($w['GunakanScript'] == 'Y') { BipotGunakanScript($pmb, '', $w, $ada, 0); } else { // Jika tidak ada duplikasi, maka akan di-insert. Tapi jika sudah ada, maka dicuekin aja. if ($ada == 0) { // Simpan $Nama = GetaField('bipotnama', 'BIPOTNamaID', $w['BIPOTNamaID'], 'Nama'); // Cek Jumlah jika memiliki beasiswa /*if(GetaField('bipotnama', 'BIPOTNamaID', $w['BIPOTNamaID'], 'DipotongBeasiswa') == 'Y') { $Jumlah = (1 - ($pmb['Diskon']/100))*$w['Jumlah']; } else { $Jumlah = $w['Jumlah']; }*/ $s1 = "insert into bipotmhsw\r\n (KodeID, COAID, PMBMhswID, PMBID, TahunID,\r\n BIPOT2ID, BIPOTNamaID, Nama, TrxID,\r\n Jumlah, Besar, Dibayar,\r\n Catatan, NA,\r\n LoginBuat, TanggalBuat)\r\n values\r\n ('" . KodeID . "', '{$w['COAID']}', 0, '{$pmb['PMBID']}', '{$pmb['PMBPeriodID']}',\r\n '{$w['BIPOT2ID']}', '{$w['BIPOTNamaID']}', '{$Nama}', '{$w['TrxID']}',\r\n 1, '{$w['Jumlah']}', 0,\r\n 'Auto', 'N',\r\n '{$_SESSION['_Login']}', now())"; $r1 = _query($s1); } // end $ada=0 } // end if $ada } // end if $oke } // end while HitungUlangBIPOTPMB($PMBID); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=MhswBaruEdt&PMBID={$pmb['PMBID']}", 100); }
function Simpan() { $TAID = $_REQUEST['TAID']; $DosenID = sqling($_REQUEST['DosenID']); $TglUjian = "{$_REQUEST['TglUjian_y']}-{$_REQUEST['TglUjian_m']}-{$_REQUEST['TglUjian_d']}"; $s = "update ta\n set Penguji = '{$DosenID}', TglUjian = '{$TglUjian}',\n LoginEdit = '{$_SESSION['_Login']}', TanggalEdit = now()\n where TAID = '{$TAID}' "; $r = _query($s); echo <<<ESD <script> opener.location = "../index.php?mnux={$_SESSION['mnux']}&gos="; </script> ESD; BerhasilSimpan("../{$_SESSION['mnux']}.ujian.php?TAID={$TAID}", 1); }
function ModSav() { $md = $_REQUEST['md']; $MdlID = $_REQUEST['MdlID']; $MdlGrpID = $_REQUEST['MdlGrpID']; $Nama = sqling($_REQUEST['Nama']); $Script = $_REQUEST['Script']; $_levelid = TRIM($_REQUEST['LevelID'], '.'); if (empty($_levelid)) { $LevelID = ''; } else { $arrLevelID = explode('.', $_levelid); sort($arrLevelID); $LevelID = '.' . implode('.', $arrLevelID) . '.'; } $Web = !empty($_REQUEST['Web']) ? $_REQUEST['Web'] : 'N'; $Author = sqling($_REQUEST['Author']); $EmailAuthor = sqling($_REQUEST['EmailAuthor']); $Simbol = $_REQUEST['Simbol']; $Help = $_REQUEST['Help']; $NA = !empty($_REQUEST['NA']) ? $_REQUEST['NA'] : 'N'; $Keterangan = sqling($_REQUEST['Keterangan']); // Simpan if ($md == 0) { $s = "update mdl set Nama='{$Nama}', MdlGrpID='{$MdlGrpID}', Script='{$Script}',\r\n LevelID='{$LevelID}', Web='{$Web}',\r\n Author='{$Author}', EmailAuthor='{$EmailAuthor}', Simbol='{$Simbol}',\r\n Help='{$Help}', NA='{$NA}', Keterangan='{$Keterangan}'\r\n where MdlID='{$MdlID}'"; } else { $s = "insert into mdl (MdlGrpID, Nama, Script, LevelID, Web,\r\n Author, EmailAuthor, Simbol, Help, NA, Keterangan)\r\n values ('{$MdlGrpID}', '{$Nama}', '{$Script}', '{$LevelID}', '{$Web}',\r\n '{$Author}', '{$EmailAuthor}', '{$Simbol}', '{$Help}', '{$NA}', '{$Keterangan}')"; } _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=", 100); }
function ProdiSav() { $md = $_REQUEST['md'] + 0; $prid = $_REQUEST['prid']; $Nama = sqling($_REQUEST['Nama']); $Nama_en = sqling($_REQUEST['Nama_en']); $JenjangID = $_REQUEST['JenjangID']; $Gelar = sqling($_REQUEST['Gelar']); $FormatNIM = sqling($_REQUEST['FormatNIM']); $GunakanNIMSementara = empty($_REQUEST['GunakanNIMSementara']) ? 'N' : $_REQUEST['GunakanNIMSementara']; $FormatNIMSementara = sqling($_REQUEST['FormatNIMSementara']); $FakultasID = $_REQUEST['FakultasID']; $NA = empty($_REQUEST['NA']) ? 'N' : $_REQUEST['NA']; $arrpindah = array(); $arrpindah = $_REQUEST['ProdiID']; $pindah = empty($arrpindah) ? '' : '.' . implode('.', $arrpindah) . '.'; $NamaSesi = sqling($_REQUEST['NamaSesi']); $CekPrasyarat = empty($_REQUEST['CekPrasyarat']) ? "N" : $_REQUEST['CekPrasyarat']; $TotalSKS = $_REQUEST['TotalSKS'] + 0; $DefSKS = $_REQUEST['DefSKS'] + 0; $DefKehadiran = $_REQUEST['DefKehadiran'] + 0; $DefMaxAbsen = $_REQUEST['DefMaxAbsen'] + 0; $BatasStudi = $_REQUEST['BatasStudi'] + 0; $JumlahSesi = $_REQUEST['JumlahSesi'] + 0; $ProdiDiktiID = $_REQUEST['ProdiDiktiID']; $Akreditasi = $_REQUEST['Akreditasi']; $Pejabat = sqling($_REQUEST['Pejabat']); $Jabatan = sqling($_REQUEST['Jabatan']); $NoSKDikti = sqling($_REQUEST['NoSKDikti']); $TglSKDikti = "{$_REQUEST['TglSKDikti_y']}-{$_REQUEST['TglSKDikti_m']}-{$_REQUEST['TglSKDikti_d']}"; $NoSKBAN = sqling($_REQUEST['NoSKBAN']); $TglSKBAN = "{$_REQUEST['TglSKBAN_y']}-{$_REQUEST['TglSKBAN_m']}-{$_REQUEST['TglSKBAN_d']}"; $PajakHonorDosen = $_REQUEST['PajakHonorDosen'] + 0; if ($md == 0) { $s = "update prodi set Nama='{$Nama}', Nama_en='{$Nama_en}', FormatNIM='{$FormatNIM}',\r\n JenjangID='{$JenjangID}', DapatPindahProdi='{$pindah}', FakultasID='{$FakultasID}',\r\n Gelar='{$Gelar}', GunakanNIMSementara='{$GunakanNIMSementara}', FormatNIMSementara='{$FormatNIMSementara}',\r\n NamaSesi='{$NamaSesi}', CekPrasyarat='{$CekPrasyarat}',\r\n TotalSKS={$TotalSKS}, DefSKS={$DefSKS}, DefKehadiran={$DefKehadiran}, DefMaxAbsen={$DefMaxAbsen}, NA='{$NA}',\r\n ProdiDiktiID='{$ProdiDiktiID}', Akreditasi='{$Akreditasi}',\r\n BatasStudi='{$BatasStudi}', JumlahSesi='{$JumlahSesi}',\r\n Pejabat='{$Pejabat}', Jabatan='{$Jabatan}',\r\n NoSKDikti='{$NoSKDikti}', TglSKDikti='{$TglSKDikti}',\r\n NoSKBAN='{$NoSKBAN}', TglSKBAN='{$TglSKBAN}',\r\n PajakHonorDosen='{$PajakHonorDosen}'\r\n where ProdiID='{$prid}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=", 10); } else { $ada = GetFields('prodi', 'ProdiID', $prid, '*'); if (empty($ada)) { $s = "insert into prodi(ProdiID, Nama, Nama_en, KodeID, FormatNIM, GunakanNIMSementara, FormatNIMSementara, FakultasID, NamaSesi, CekPrasyarat,\r\n JenjangID, Gelar, DapatPindahProdi, TotalSKS, DefSKS, DefKehadiran, DefMaxAbsen, BatasStudi, JumlahSesi, \r\n Pejabat, Jabatan, NA, ProdiDiktiID,\r\n Akreditasi, NoSKDikti, TglSKDikti,\r\n NoSKBAN, TglSKBAN, PajakHonorDosen)\r\n values('{$prid}', '{$Nama}', '{$Nama_en}', '{$_SESSION['KodeID']}', '{$FormatNIM}', '{$GunakanNIMSementara}', '{$FormatNIMSementara}', '{$FakultasID}', '{$NamaSesi}', '{$CekPrasyarat}',\r\n '{$JenjangID}', '{$Gelar}', '{$pindah}', '{$TotalSKS}', '{$DefSKS}', '{$DefKehadiran}', '{$DefMaxAbsen}', '{$BatasStudi}', '{$JumlahSesi}', \r\n '{$Pejabat}', '{$Jabatan}', '{$NA}', '{$ProdiDiktiID}',\r\n '{$Akreditasi}', '{$NoSKDikti}', '{$TglSKDikti}',\r\n '{$NoSKBAN}', '{$TglSKBAN}', '{$PajakHonorDosen}')"; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=", 10); } else { return ErrorMsg('Kesalahan', "Kode Program Studi: <b>{$ProdiID}</b> telah digunakan oleh\r\n Program Studi: <b>{$ada['Nama']}</b>.<br>\r\n Gunakan kode program studi yang lain."); } } }
function Simpan($gel) { $AplikanID = $_REQUEST['AplikanID']; $Nama = $_REQUEST['Nama']; $TanggalLahir = "{$_REQUEST['TanggalLahir_y']}-{$_REQUEST['TanggalLahir_m']}-{$_REQUEST['TanggalLahir_d']}"; if (empty($AplikanID) or $AplikanID == '') { $aplikanid = GetNextAplikanID($gel); $s = "insert into aplikan set AplikanID='{$aplikanid}', Nama='{$Nama}', TanggalLahir='{$TanggalLahir}', Login='******', Password=PASSWORD('{$TanggalLahir}'), \n\t\t\t\t\t\t\t\tKodeID='" . KodeID . "', PMBPeriodID='{$gel}', \n\t\t\t\t\t\t\t\tLoginBuat='{$_SESSION['_Login']}', TanggalBuat=now(), LoginEdit='{$_SESSION['_Login']}', TanggalEdit=now()"; $r = _query($s); $page = 0; } else { $aplikanid = $AplikanID; $s = "update aplikan set Nama='{$Nama}', TanggalLahir='{$TanggalLahir}',\n\t\t\t\t\t\t\t\tLoginEdit='{$_SESSION['_Login']}', TanggalEdit=now() where AplikanID='{$aplikanid}' and KodeID='" . KodeID . "'"; $r = _query($s); $ttl2 = GetaField('aplikan', "PMBPeriodID='{$gel}' and LEFT(AplikanID, 5)=LEFT('{$AplikanID}', 5) and AplikanID <= '{$AplikanID}' and KodeID", KodeID, 'count(AplikanID)'); $ttl = GetaField('pmb', "PMBPeriodID='{$gel}' and LEFT(AplikanID, 5)=LEFT('{$AplikanID}', 5) and KodeID", KodeID, 'count(AplikanID)'); $page = ceil(($ttl - $ttl2) / 10); } BerhasilSimpan("?mnux={$_SESSION['mnux']}&gos=&_pmbLoginAplikanID={$aplikanid}&_pmbLoginPage={$page}", 10); }
function Simpan($gel, $id) { include_once "statusaplikan.lib.php"; $Nama = sqling($_REQUEST['Nama']); $TempatLahir = sqling($_REQUEST['TempatLahir']); $Kelamin = sqling($_REQUEST['Kelamin']); $TanggalLahir = "{$_REQUEST['TanggalLahir_y']}-{$_REQUEST['TanggalLahir_m']}-{$_REQUEST['TanggalLahir_d']}"; $GolonganDarah = sqling($_REQUEST['GolonganDarah']); $Agama = sqling($_REQUEST['Agama']); $StatusSipil = sqling($_REQUEST['StatusSipil']); $TinggiBadan = sqling($_REQUEST['TinggiBadan']); $BeratBadan = sqling($_REQUEST['BeratBadan']); $WargaNegara = sqling($_REQUEST['WargaNegara']); $Kebangsaan = sqling($_REQUEST['Kebangsaan']); $Alamat = sqling($_REQUEST['Alamat']); $RT = sqling($_REQUEST['RT']); $RW = sqling($_REQUEST['RW']); $KodePos = sqling($_REQUEST['KodePos']); $Kota = sqling($_REQUEST['Kota']); $Propinsi = sqling($_REQUEST['Propinsi']); $Telepon = sqling($_REQUEST['Telepon']); $Handphone = sqling($_REQUEST['Handphone']); $Email = sqling($_REQUEST['Email']); $TinggalDengan = $_REQUEST['TinggalDengan']; $JarakRumah = $_REQUEST['JarakRumah']; $PendidikanTerakhir = sqling($_REQUEST['PendidikanTerakhir']); $AsalSekolah = sqling($_REQUEST['AsalSekolah']); $TahunLulus = sqling($_REQUEST['TahunLulus']); $NilaiSekolah = sqling($_REQUEST['NilaiSekolah']); $arrPT = array(); for ($i = 1; $i <= 3; $i++) { $arrPT[] = str_replace('~', '-', sqling($_REQUEST['PrestasiTambahan' . $i])); } foreach ($arrPT as $PT) { $PrestasiTambahan = implode('~', $arrPT); } $NamaAyah = sqling($_REQUEST['NamaAyah']); $AgamaAyah = $_REQUEST['AgamaAyah']; $PendidikanAyah = $_REQUEST['PendidikanAyah']; $PekerjaanAyah = sqling($_REQUEST['PekerjaanAyah']); $AlamatAyah = sqling($_REQUEST['AlamatAyah']); $PenghasilanAyah = $_REQUEST['PenghasilanAyah'] + 0; $HidupAyah = $_REQUEST['HidupAyah']; $NamaIbu = sqling($_REQUEST['NamaIbu']); $AgamaIbu = $_REQUEST['AgamaIbu']; $PendidikanIbu = $_REQUEST['PendidikanIbu']; $PekerjaanIbu = sqling($_REQUEST['PekerjaanIbu']); $AlamatIbu = sqling($_REQUEST['AlamatIbu']); $PenghasilanIbu = $_REQUEST['PenghasilanIbu'] + 0; $HidupIbu = $_REQUEST['HidupIbu']; $AlamatOrtu = sqling($_REQUEST['AlamatOrtu']); $RTOrtu = sqling($_REQUEST['RTOrtu']); $RWOrtu = sqling($_REQUEST['RWOrtu']); $KodePosOrtu = sqling($_REQUEST['KodePosOrtu']); $KotaOrtu = sqling($_REQUEST['KotaOrtu']); $PropinsiOrtu = sqling($_REQUEST['PropinsiOrtu']); $TeleponOrtu = sqling($_REQUEST['TeleponOrtu']); $HandphoneOrtu = sqling($_REQUEST['HandphoneOrtu']); $EmailOrtu = sqling($_REQUEST['EmailOrtu']); $PMBFormulirID = $_REQUEST['PMBFormulirID']; $ProgramID = sqling($_REQUEST['ProgramID']); $frm = GetFields('pmbformulir', 'PMBFormulirID', $PMBFormulirID, '*'); $pil = array(); $vpil = array(); $epil = array(); for ($i = 1; $i <= $frm['JumlahPilihan']; $i++) { $pil[] = 'Pilihan' . $i; $vpil[] = "'" . sqling($_REQUEST['Pilihan' . $i]) . "'"; $epil[] = 'Pilihan' . $i . "='" . $_REQUEST['Pilihan' . $i] . "'"; } $_pil = implode(', ', $pil); $_vpil = implode(', ', $vpil); $_epil = implode(', ', $epil); // simpan if ($md == 0) { $s = "update pmb\r\n set \r\n Nama = '{$Nama}',\r\n TempatLahir = '{$TempatLahir}', TanggalLahir = '{$TanggalLahir}',\r\n Kelamin = '{$Kelamin}', GolonganDarah = '{$GolonganDarah}',\r\n Agama = '{$Agama}', StatusSipil = '{$StatusSipil}',\r\n TinggiBadan = '{$TinggiBadan}', BeratBadan = '{$BeratBadan}',\r\n WargaNegara = '{$WargaNegara}', Kebangsaan = '{$Kebangsaan}',\r\n Alamat = '{$Alamat}',\r\n RT = '{$RT}', RW = '{$RW}', KodePos = '{$KodePos}',\r\n Kota = '{$Kota}', Propinsi = '{$Propinsi}',\r\n Telepon = '{$Telepon}', Handphone = '{$Handphone}', Email = '{$Email}',\r\n PendidikanTerakhir = '{$PendidikanTerakhir}',\r\n AsalSekolah = '{$AsalSekolah}', TahunLulus = '{$TahunLulus}', NilaiSekolah = '{$NilaiSekolah}', PrestasiTambahan = '{$PrestasiTambahan}',\r\n\t\t \r\n\t\t NamaAyah = '{$NamaAyah}', PendidikanAyah = '{$PendidikanAyah}', AgamaAyah = '{$AgamaAyah}', \r\n PekerjaanAyah = '{$PekerjaanAyah}', HidupAyah = '{$HidupAyah}', PenghasilanAyah = '{$PenghasilanAyah}',\r\n NamaIbu = '{$NamaIbu}', PendidikanIbu = '{$PendidikanIbu}', AgamaIbu = '{$AgamaIbu}',\r\n PekerjaanIbu = '{$PekerjaanIbu}', HidupIbu = '{$HidupIbu}', PenghasilanIbu = '{$PenghasilanIbu}',\r\n \r\n\t\t AlamatOrtu = '{$AlamatOrtu}',\r\n RTOrtu = '{$RTOrtu}', RWOrtu = '{$RWOrtu}', KodePosOrtu = '{$KodePosOrtu}',\r\n KotaOrtu = '{$KotaOrtu}', PropinsiOrtu = '{$PropinsiOrtu}',\r\n TeleponOrtu = '{$TeleponOrtu}', HandphoneOrtu = '{$HandphoneOrtu}', EmailOrtu = '{$EmailOrtu}',\r\n PMBFormulirID = '{$PMBFormulirID}', ProgramID = '{$ProgramID}',\r\n\t\t \r\n {$_epil},\r\n LoginEdit = '{$_SESSION['_Login']}', TanggalEdit = now()\r\n where PMBID = '{$id}' "; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}", 1000); } elseif ($md == 1) { // Cek jika ID manual if (!empty($id)) { $ada = GetaField('pmb', "KodeID='" . KodeID . "' and PMBID", $id, 'PMBID'); if (!empty($ada)) { die(ErrorMsg('Error', "Nomer PMB sudah ada.<br />\r\n Anda harus memasukkan nomer PMB yang lain.<br />\r\n Atau kosongkan untuk mendapatkan nomer secara otomatis.<br />\r\n Hubungi Sysadmin untuk informasi lebih lanjut.\r\n <hr size=1 color=silver />\r\n Opsi: <input type=button name='Kembali' value='Kembali'\r\n onClick=\"javascript:history.go(-1)\" />\r\n <input type=button name='Tutup' value='Tutup'\r\n onClick=\"window.close()\" />")); } } else { $id = GetNextPMBID($gel); } // Baru kemudian disimpan $ProdiID = $_REQUEST['Pilihan1']; $s = "insert into pmb\r\n (PMBID, PMBPeriodID, KodeID, Nama, \r\n TempatLahir, TanggalLahir, Kelamin, GolonganDarah,\r\n Agama, StatusSipil, TinggiBadan, BeratBadan,\r\n WargaNegara, Kebangsaan,\r\n Alamat, RT, RW, KodePos, Kota, Propinsi, \r\n Telepon, Handphone, Email,\r\n PendidikanTerakhir, AsalSekolah,\r\n TahunLulus, NilaiSekolah, PrestasiTambahan, \r\n NamaAyah, AgamaAyah, PendidikanAyah, PekerjaanAyah, HidupAyah, \r\n NamaIbu, AgamaIbu, PendidikanIbu, PekerjaanIbu, HidupIbu, \r\n AlamatOrtu, RTOrtu, RWOrtu, KodePosOrtu, KotaOrtu, PropinsiOrtu,\r\n TeleponOrtu, HandphoneOrtu, EmailOrtu,\r\n PMBFormulirID, ProgramID, ProdiID, {$_pil},\r\n\t \r\n LoginBuat, TanggalBuat)\r\n values\r\n ('{$id}', '{$gel}', '" . KodeID . "', '{$Nama}', \r\n '{$TempatLahir}', '{$TanggalLahir}', '{$Kelamin}', '{$GolonganDarah}',\r\n '{$Agama}', '{$StatusSipil}', '{$TinggiBadan}', '{$BeratBadan}',\r\n '{$WargaNegara}', '{$Kebangsaan}',\r\n '{$Alamat}', '{$RT}', '{$RW}', '{$KodePos}', '{$Kota}', '{$Propinsi}', \r\n '{$Telepon}', '{$Handphone}', '{$Email}',\r\n '{$PendidikanTerakhir}', '{$AsalSekolah}',\r\n '{$TahunLulus}', '{$NilaiSekolah}', '{$PrestasiTambahan}', \r\n '{$NamaAyah}', '{$AgamaAyah}', '{$PendidikanAyah}', '{$PekerjaanAyah}', '{$HidupAyah}', \r\n '{$NamaIbu}', '{$AgamaIbu}', '{$PendidikanIbu}', '{$PekerjaanIbu}', '{$HidupIbu}', \r\n '{$AlamatOrtu}', '{$RTOrtu}', '{$RWOrtu}', '{$KodePosOrtu}', '{$KotaOrtu}', '{$PropinsiOrtu}',\r\n '{$TeleponOrtu}', '{$HandphoneOrtu}', '{$EmailOrtu}',\r\n '{$PMBFormulirID}', '{$ProgramID}', '{$ProdiID}', {$_vpil},\r\n\t \r\n '{$_SESSION['_Login']}', now())"; $r = _query($s); BerhasilSimpan("?mnux={$_SESSION['mnux']}", 1000); } else { die(ErrorMsg('Error', "Terjadi kesalahan mode edit.<br />\r\n Mode <b>{$md}</b> tidak dikenali oleh sistem.\r\n <hr size=1 color=silver />\r\n <input type=button name='Tutup' value='Tutup' onClick=\"window.close()\" />")); } }