You are on page 1of 17

Dim i As Integer

i=1

For i = 1 To 31

Combo1.AddItem i

Next i

Dim i As Integer

Do While i < 10

List1.AddItem ("Baris" & i)

i=i+1

Loop

Dim i As Integer

Do Until i >= 10

List1.AddItem i

Dim i As Integer

i=0

While i < 10

List2.AddItem i

i=i+1

Wend

If Text1.Text = >= 75 Then

Text2.Text = "Lulus"

Else

Text2.Text = "Gagal"

End If
If Text1.Text >= 85 Then

Text2.Text = "A"

ElseIf Text1.Text >= 75 Then

Text2.Text = "B"

ElseIf Text1.Text >= 65 Then

Text2.Text = "C"

Else

Text2.Text = "ERROR"

End If

If Text2.Text = "B" Then

MsgBox "Selamat Anda Lulus", vbInformation, "Kabar Penting!!!"

Else

MsgBox "Anda Gagal", vbInformation, "Kabar penting!!!"

If Combo1 = 1 Or Combo1 = 3 Or Combo1 = 5 Or Combo1 = 7 Or Combo1 = 9 Then

Text1.Text = "Ganjil"

Else

Text1.Text = "Genap"

End If

Dim i As Integer

i=1

For i = 1 To 10

Combo1.AddItem i

Next i

Private Sub Command1_Click()

If Text1.Text = 1 Then
Text2.Text = "ganjil"

ElseIf Text1.Text = 2 Then

Text2.Text = "genap"

ElseIf Text1.Text = 3 Then

Text2.Text = "ganjil"

ElseIf Text1.Text = 4 Then

Text2.Text = "genap"

ElseIf Text1.Text = 5 Then

Text2.Text = "ganjil"

ElseIf Text1.Text = 6 Then

Text2.Text = "genap"

ElseIf Text1.Text = 7 Then

Text2.Text = "ganjil"

ElseIf Text1.Text = 8 Then

Text2.Text = "genap"

ElseIf Text1.Text = 9 Then

Text2.Text = "ganjil"

ElseIf Text1.Text = 10 Then

Text2.Text = "genap"

End If

Sub kosong()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Combo1.Text = ""

End Sub
Sub mati()

Text1.Enabled = False

Text2.Enabled = False

Text3.Enabled = False

Text4.Enabled = False

Combo1.Enabled = False

End Sub

Sub hidup()

Text1.Enabled

Text2.Enabled

Text3.Enabled

Text4.Enabled

Combo1.Enabled

End Sub

Sub kondisiawal()

kosong

mati

Command1.Caption = "tambah"

Command2.Caption = "ubah"

Command3.Caption = "hapus"

Command4.Caption = "keluar"

Command1.Caption = True

Command2.Caption = True

Command3.Caption = True
End Sub

Private Sub Form_Load()

kondisiawal

End Sub

Sub simpan()

Adodc1.Recordset.Fields(0) = Text1.Text

Adodc1.Recordset.Fields(1) = Combo1.Text

Adodc1.Recordset.Fields(2) = Text2.Text

Adodc1.Recordset.Fields(3) = Text3.Text

Adodc1.Recordset.Fields(4) = Text4.Text

Adodc1.Recordset.Update

MsgBox "data berhasil di simpan", vbInformation, "sukses"

kondisiawal

End Sub

Private Sub About_Click()

MsgBox "aplikasi pembuat xi rpl.a", vbInformation, "info"

End Sub

Private Sub Datasiswa_Click()

Form2.Show

End Sub
Private Sub Login_Click()

Unload Me

Form1.Show

End Sub

Private Sub Logout_Click()

Unload Me

End Sub

Private Sub Command1_Click()

Unload Me

MDIForm1.Show

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

If Text1.Text = "admin" Then

Text2.SetFocus

Else

MsgBox "Sorry You Have The Username Wrong", vbCritical, "konfirmasi"

Text1.Text = ""
Text1.SetFocus

End If

End If

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

If Text2.Text = "root" Then

Command1.Enabled = True

Command1.SetFocus

Else

MsgBox "Sorry You are Wrong Password", vbCritical, "konfirmasi"

Text2.Text = ""

Text2.SetFocus

End If

End If

End Sub

Sub kosong()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Combo1.Text = ""

End Sub

Sub mati()
Text1.Enabled = False

Text2.Enabled = False

Text3.Enabled = False

Text4.Enabled = False

Combo1.Enabled = False

End Sub

Sub hidup()

Text1.Enabled

Text2.Enabled

Text3.Enabled

Text4.Enabled

Combo1.Enabled

End Sub

Sub kondisiawal()

kosong

mati

Command1.Caption = "tambah"

Command2.Caption = "ubah"

Command3.Caption = "hapus"

Command4.Caption = "keluar"

Command1.Caption = True

Command2.Caption = True

Command3.Caption = True

End Sub
Private Sub Command1_Click()

If Command1.Caption = "tambah" Then

comman1.Caption = "simpan"

Command2.Caption = False

Command3.Caption = False

Command4.Caption = "Batal"

kosong

hidup

Else

End If

End Sub

Private Sub Form_Load()

kondisiawal

End Sub

Sub simpan()

Adodc1.Recordset.Fields(0) = Text1.Text

Adodc1.Recordset.Fields(1) = Combo1.Text

Adodc1.Recordset.Fields(2) = Text2.Text

Adodc1.Recordset.Fields(3) = Text3.Text

Adodc1.Recordset.Fields(4) = Text4.Text

Adodc1.Recordset.Update

MsgBox "data berhasil di simpan", vbInformation, "sukses"

kondisiawal

End Sub
Sub koneksi()

Adodc1.ConnectionString = "PROVIDER=microsoft.jet.oledb.4.0;data source=" & App.Path &


"\sekolah.mdb"

Adodc1.RecordSource = "select * from mata_diklat"

Adodc1.Refresh

Set DataGrid1.DataSource = Adodc1

DataGrid1.Refresh

End Sub

Private Sub Command1_Click()

If Command1.Caption = "tambah" Then

Command1.Caption = "simpan"

Command2.Enabled = False

Command3.Enabled = False

Command4.Caption = "batal"

kosong

hidup

Text1.SetFocus

ElseIf Command1.Caption = "simpan" Then

If Text1.Text = "" Or Text2.Text = "" Then

MsgBox "data belum lengkap", vbCritical, "konfirmasi"

Else

simpan

MsgBox "data berhasil disimpan", vbInformation, "sukses"

kondisiawal
End If

End If

End Sub

Private Sub Command2_Click()

If Command2.Caption = "ubah" Then

Command2.Caption = "simpan"

Command3.Enabled = False

Command1.Enabled = False

Command4.Caption = "batal"

hidup

kosong

Text1.SetFocus

ElseIf Command2.Caption = "simpan" Then

ubah

MsgBox "Data berhasil disimpan", vbInformation, "sukses"

kondisiawal

End If

End Sub

Private Sub Command3_Click()

If Command3.Caption = "hapus" Then

Command1.Enabled = False

Command2.Enabled = False

Command4.Caption = "batal"
hidup

Text1.SetFocus

Else

End If

End Sub

Private Sub Command4_Click()

If Command4.Caption = "keluar" Then

Unload Me

ElseIf Command4.Caption = "batal" Then

Form_Activate

kondisiawal

End If

End Sub

Private Sub Form_Activate()

koneksi

kosong

mati

kondisiawal

End Sub

Sub kosong()

Text1.Text = ""

Text2.Text = ""

End Sub

Sub mati()

Text1.Enabled = False
Text2.Enabled = False

Command1.Enabled = True

Command2.Enabled = False

Command3.Enabled = False

Command4.Enabled = False

End Sub

Sub hidup()

Text1.Enabled = True

Text2.Enabled = True

End Sub

Sub kondisiawal()

kosong

mati

Command1.Caption = "tambah"

Command2.Caption = "ubah"

Command3.Caption = "hapus"

Command4.Caption = "keluar"

Command1.Enabled = True

Command2.Enabled = True

Command3.Enabled = True

Command4.Enabled = True

End Sub

Sub simpan()

Adodc1.Recordset.AddNew

Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Fields(1) = Text2.Text

Adodc1.Recordset.Update

End Sub

Sub ubah()

Adodc1.Recordset.Fields(0) = Text1.Text

Adodc1.Recordset.Fields(1) = Text2.Text

Adodc1.Recordset.Update

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

If Command1.Caption = "simpan" Then

Adodc1.RecordSource = "select * from mata_diklat where kode_mata_diklat='" & Text1.Text &


"'"

Adodc1.Refresh

If Adodc1.Recordset.EOF = False Then

Text1.Text = Adodc1.Recordset!Kode_Mata_Diklat

Text2.Text = Adodc1.Recordset!Nama_Mata_Diklat

MsgBox "Data Telah Dipakai", vbcrtical, "Konfirmasi"

kosong

Text1.SetFocus

Else

Text2.SetFocus

End If

ElseIf Command2.Caption = "simpan" Then

Adodc1.RecordSource = "select * from mata_diklat where kode_mata_diklat='" & Text1.Text &


"'"
Adodc1.Refresh

If Adodc1.Recordset.EOF = False Then

Text1.Text = Adodc1.Recordset!Kode_Mata_Diklat

Text2.Text = Adodc1.Recordset!Nama_Mata_Diklat

Else

MsgBox "Data Yang Anda Cari Tidak Terdaftar", vbCritical, "konfirmasi"

kosong

Text1.SetFocus

End If

Else

End If

End If

End Sub

<?php

$host="localhost";

$name="root";

$password="";

$Database="akademi";

$koneksi=mysql_connect($host,$name,$password);

$caridb=mysql_select_db("$Database");

if($koneksi and $caridb){

}else{
?>

<script language="javascript">alert("Koneksi Gagal")</script>

<?php

?>

<html>

<head>

<title> Form Input Kajur </title>

</head>

<body>

<?php

include("koneksi.php");

if(isset($_POST['input'])){

$id_kajur=$_POST['id_kajur'];

$nama_kajur=$_POST['nama_kajur'];

$alamat_kajur=$_POST['alamat_kajur'];

$tlpn_kajur=$_POST['tlpn_kajur'];

$simpan=mysql_query("insert into Kajur


values('$id_kajur','$nama_kajur','$alamat_kajur','$tlpn_kajur')");

if($simpan){

?>

<script language="javascript">alert("Data Berhasil Disimpan")</script>

<?php

}else{
?>

<script language="javascript">alert("Data Gagal Disimpan")</script>

<?php

?>

<form method="post" name="input" action="">

<style>

table tr td{padding:5px;}

</style>

<table>

<tr> <td>Id Kepala Jurusan</td> <td>:</td> <td><input type="text" name="id_kajur"


size="10"></td> </tr>

<tr> <td>Nama Kepala Jurusan</td> <td>:</td> <td><input type="text" name="nama_kajur"


size="25"></td> </tr>

<tr> <td valign="top"> Alamat Kajur</td> <td valign="top"> :</td> <td> <textarea rows="5%"
cols="30%" name="alamat_kajur"></textarea></td> </tr>

<tr><td> No. Tlpn/Hp </td> <td>: </td> <td><input type="text" name="tlpn_kajur" size="12"></td>
</tr>

<tr> <td></td> <td></td> <td><input type="submit" name="input" value="Simpan"> </td> </tr>

</table>

</form>

</body>

</html>

You might also like