SMK Binawiyata Sragen

  • This is default featured slide 1 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 2 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 3 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 4 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 5 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Perintah DOS (Disk Operating System Command)

APPEND : Causes MS-DOS to look in other directories when editing a file or running a command.

ARP : Displays, adds, and removes arp information from network devices
ASSIGN : Assign a drive letter to an alternate letter
ASSOC : View the file associations
AT : Schedule a time to execute commands or programs.
ATMADM : Lists connections and addresses seen by Windows ATM call manager.
ATTRIB : Display and change file attributes.
BATCH : NRecovery console command that executes a series of commands in a file.
BOOTCFG : Recovery console command that allows a user to view, modify, and rebuild the boot.ini
BREAK : Enable / disable CTRL + C feature.
CACLS : View and modify file ACL's.
CALL : Calls a batch file from another batch file.
CD : Changes directories.
CHCP : Supplement the International keyboard and character set information.
CHDIR Changes directories.
CHKDSK : Check the hard disk drive running FAT for errors.
CHKNTFS : Check the hard disk drive running NTFS for errors.
CHOICE : Specify a listing of multiple options within a batch file.
CLS : Clears the screen.
CMD : Opens the command interpreter.
COLOR : Easily change the foreground and background color of the
MS-DOS window.
COMP : Compares files.
COMPACT : Compresses and uncompress files.
CONTROL : Open control panel icons from the MS-DOS prompt.
CONVERT : Convert FAT to NTFS.
COPY : Copy one or more files to an alternate location.
CTTY : Change the computers input/output devices.
DATE : View or change the systems date.
DEBUG : Debug utility to create assembly programs to modify hardware settings.
DEFRAG : Re-arrange the hard disk drive to help with loading programs.
DEL : Deletes one or more files.
DELETE : Recovery console command that deletes a file.
DELTREE : Deletes one or more files and/or directories.
DIR : List the contents of one or more directory.
DISABLE : Recovery console command that disables Windows system services or drivers.
DISKCOMP : Compare a disk with another disk.
DISKCOPY : Copy the contents of one disk
DOSKEY : Command to view and execute commands that have been run in the past.
DOSSHELL : A GUI to help with early MS-DOS users.
DRIVPARM : Enables overwrite of original device drivers.
ECHO : Displays messages and enables and disables echo.
EDIT : View and edit files.
EDLIN : View and edit files.
EMM386 : Load extended Memory Manager.
ENABLE : Recovery console command to enable a disable service or driver.
ENDLOCAL : Stops the localization of the environment changes
enabled by the setlocal command.
ERASE : Erase files
EXPAND : Expand a Microsoft Windows file back to it's original format.
EXIT : Exit from the command interpreter.
EXTRACT : Extract files from the Microsoft Windows cabinets.
FASTHELP : Displays a listing of MS-DOS commands and information about them
FC : Compare files.
FDISK : Create the partitions on the hard disk drive.
FIND : Search for text within a file.
FINDSTR : Searches for a string of text within a file.
FIXBOOT : Writes a new boot sector.
FIXMBR : Writes a new boot record to a disk drive.
FOR : Boolean used in batch files.
FORMAT : Command to erase and prepare a disk drive.
FTP : Command to connect and operate on a FTP server.
FTYPE : Displays or modifies file types used in file extension
asociations.
GOTO : Moves a batch file to a specific label or location.
GRAFTABL : Show extended characters in graphics mode.
HELP : Display a listing of commands and brief explanation.
IF : Allows for batch files to perform conditional processing.
IFSHLP.SYS : 32-bit file manager.
IPCONFIG : Network command to view network adapter settings and assigned values.
KEYB : Change layout of keyboard.
LABEL : Change the label of a disk drive.
LH : Load a device driver in to high memory.
LISTSVC : Recovery console command that displays the services and drivers.
LOADFIX : Load a program above the first 64k.
LOADHIGH : Load a device driver in to high memory.
LOCK : Lock the hard disk drive.
LOGON : Recovery console command to list installations and enable administrator login.
MAP : Displays the device name of a drive.
MD : Command to create a new directory.
MEM : Display memory on system.
MKDIR : Command to create a new directory.
MODE : Modify the port or display settings.
MORE : Display one page at a time.
MOVE : Move one or more files from one directory to another DIRECTORY
MSAV : Early Microsoft Virus scanner.
MSD : Diagnostics utility.
MSCDEX : Utility used to load and provide access to the CD-ROM.
NBTSTAT : Displays protocol statistics and current TCP/IP connections using NBT
NET : Update, fix, or view the network or network settings
NETSH : Configure dynamic and static network information from MS-DOS.
NETSTAT : Display the TCP/IP network protocol statistics and information.
NLSFUNC : Load country specific information.
NSLOOKUP : Look up an IP address of a domain or host on a network.
PATH : View and modify the computers path location
PATHPING : View and locate locations of network latency
PAUSE : command used in batch files to stop the processing of a command.
PING : Test / send information to another network computer or network device .
POPD : Changes to the directory or network path stored by the pushd command.
POWER : Conserve power with computer portables.
PRINT : Prints data to a printer port.
PROMPT : View and change the MS-DOS prompt.
PUSHD : Stores a directory or network path in memory so it can be returned to at any time.
QBASIC : Open the QBasic.
RD : Removes an empty directory.
REN : Renames a file or directory.
RENAME : Renames a file or directory.
RMDIR : Removes an empty directory.
ROUTE : View and configure windows network route tables.
RUNAS : Enables a user to execute a program on another
computer.
SCANDISK : Run the scandisk utility.
SCANREG : Scan registry and recover registry from errors.
SET : Change one variable or string to another.
SETLOCAL : Enables local environments to be changed without affecting anything else.
SHARE : Installs support for file sharing and locking capabilities.
SETVER : Change MS-DOS version to trick older MS-DOS programs.
SHIFT : Changes the position of replaceable parameters in a batch program.
SHUTDOWN : Shutdown the computer from the MS-DOS prompt.
SMARTDRV : Create a disk cache in conventional memory or extended memory.
SORT : Sorts the input and displays the output to the screen.
START : Start a separate window in Windows from the MS-DOS prompt.
SUBST : Substitute a folder on your computer for another drive letter.
SWITCHES : Remove add functions from MS-DOS.
SYS : Transfer system files to disk drive.
TELNET : Telnet to another computer / device from the prompt.
TIME : View or modify the system time.
TITLE : Change the title of their MS-DOS window.
TRACERT : Visually view a network packets route across a network.
TREE : View a visual tree of the hard disk drive.
TYPE : Display the contents of a file.
UNDELETE : Undelete a file that has been deleted.
UNFORMAT : Unformat a hard disk drive.
UNLOCK : Unlock a disk drive.
VER : Display the version information.
VERIFY : Enables or disables the feature to determine if files have been written properly.
VOL : Displays the volume information about the designated drive.
XCOPY : Copy multiple files, directories, and/or drives from one location to another.
TRUENAME : When placed before a file, will display the whole directory in which it exists
TASKKILL : It allows you to kill those unneeded or locked up applications
Share:

Mengembalikan Task Manager Windows

Seperti halnya mengembalikan atau menampilkan Folder Options yang hilang, atau Run begitu juga dengan Task Manager yang tidak bisa ditampilkan karena sengaja disembunyikan oleh admin komputer maupun karena serangan virus.
Bila komputer anda mengalami masalah Task Manager tidak bisa di ampilkan dan pada saat anda menekan CTRL + ALT + DEL (tanpa plus) muncul pesan seperti berikut



sudah tentu bahwa DWORD value dalam regedit yang bernilai 0 (nol) sudah di ubah menjadi 1 (satu), nah untuk mengembalikannya ikuti langkah-langkah atau tips dari belajar ilmu komputer berikut :

Langkah pertama

Ini dilakukan dengan asusmi bahwa komputer anda sudah terbebas dari virus (lakukan pembersihan virus pada komputer anda terlebih dahulu)
Masuk regedit dengan cara ketik regedit pada run menu, caranya klik start - run kemudian ketik regedit dan tekan Enter atau klik OK

Langkah kedua

Klik menu Edit kemudian pilih Find dan ketikkan kata DisableTaskMgr (penulisan tidak tegantung huruf kecil/besar) kemudian klik Find Next hingga menemukan data seperti berikut

bila sudah menemukan data seperti di atas maka ikuti langkah berikut ini

Langkah ketiga

Mengubah Value data DisableTaskMgr dengan cara double klik pada kata DisableTaskMgr dan ubah angka 1 (satu) menjadi 0 (nol) dan tekan ENTER atau klik OK dengan maksud agar Task Manager di enable kan

Langkah keempat

Tutup regedit dan coba tekan CTRL + ALT+ DEL (tanpa plus ya..)

Meski artikelnya singkat namun blog belajar ilmu komputer mengharapkan agar tips ini dapat membantu para pengunjung setia blog BIK Pemula.
Share:

Kontrol Motor Stepper

Rangkaian :
Code List :
 ORG    0H
 JMP    MAIN
 ORG    0BH
 JMP    TMR0 
 OK    EQU  7FH
 N1    EQU  7EH 
 N2    EQU  7DH ; BA ARZESH TARIN 
 N21   EQU  7CH
 DN    EQU  7BH   
 TMP   EQU  7AH 
 DHTMP EQU  79H
 DLTMP EQU  78H
 DTMP1  EQU  77H
 DTMP2  EQU  76H
 MDTMP1  EQU  75H
 MDTMP2  EQU  74H
 STEPM  EQU  73H
 KEYNUM EQU 72H
 SROTATION BIT 2FH  
 PKEY  EQU  P1  
 ORG 30H
MAIN: MOV    P0,#0H
 MOV    IE,#82H
 MOV    TMOD,#1H 
 MOV    N1,#0
 MOV    N2,#0 
 SETB   TR0
 CLR    SROTATION
 MOV    STEPM,#99H
M1: CALL   KEY
 JNB    SROTATION,M1
 CALL   BCD2DEC 
M2: CALL   ROTAION
 DJNZ   N21,M2
 CLR    SROTATION
 JMP    M1
 
;--------------------------- ROTAION
ROTAION:
 CALL   MDELAY
 MOV    A,STEPM
 RR     A
 MOV    P0,A
 MOV   STEPM,A
 CALL   MDELAY 
 RET 
;--------------------------- TIMER 0
TMR0: MOV    TMP,A
 MOV    DHTMP,DPH
 MOV    DLTMP,DPL
 MOV    TH0,#0ECH
 MOV    TL0,#077H
 CLR    TR0
 CALL   DISPLAY
 SETB   TR0
 MOV    DPH,DHTMP
 MOV    DPL,DLTMP
 MOV    A,TMP
 RETI
;--------------------------- DISPALY
DISPLAY:
 MOV    DN,N1
 CALL   NUM2SEG
 MOV    A,DN
 CPL    A
 MOV    P2,A
 SETB    P3.7 
 CALL   DELAY
 CLR   P3.7
 MOV    DN,N2
 CALL   NUM2SEG
 MOV    A,DN
 CPL    A
 MOV    P2,A 
 SETB    P3.6
 CALL   DELAY
 CLR    P3.6 
 RET
;---------------------------KEYBOARD
KEY:  MOV   PKEY,#0FH
 MOV   A,PKEY
 ANL   A,#0FH
 CJNE  A,#0FH,KEY2 ;KEY1
 JMP   KFNL
KEY2: CALL  MDELAY
 MOV   A,PKEY
 ANL   A,#0FH
 CJNE  A,#0FH,KEY3
 JMP   KFNL
KEY3: MOV   R0,#4
KEY31: RRC   A
 JNC   KEY4
 DJNZ  R0,KEY31
 JMP   KFNL
KEY4: CJNE  R0,#4,KEY42
 MOV   DPTR,#ROW_1
 JMP   KEY5
KEY42: CJNE  R0,#3,KEY43
 MOV   DPTR,#ROW_2
 JMP   KEY5
KEY43: CJNE  R0,#2,KEY44
 MOV   DPTR,#ROW_3
 JMP   KEY5
KEY44: CJNE  R0,#1,KFNL
 MOV   DPTR,#ROW_4
 JMP   KEY5
;----------
KEY5: MOV   PKEY,#0FFH
 MOV   PKEY,#0F0H
 NOP
 NOP
 NOP
 NOP
 MOV   A,PKEY
 SWAP  A 
 ANL   A,#0FH
 MOV   R0,#4
KEY51: RRC   A
 JNC   KEY6
 DJNZ  R0,KEY51
 JMP   KFNL
KEY6: CJNE  R0,#4,KEY61
 JMP   KEY7
KEY61: CJNE  R0,#3,KEY62
 INC   DPTR
 JMP   KEY7
KEY62: CJNE  R0,#2,KEY63
 INC   DPTR
 INC   DPTR 
 JMP   KEY7
KEY63: CJNE  R0,#1,KFNL
 INC   DPTR
 INC   DPTR 
 INC   DPTR
 JMP   KEY7
;----------
KEY7: MOV    A,#0
 MOVC   A,@A+DPTR
 MOV    KEYNUM,A
 MOV    A,#N2
 ADD    A,R1
 MOV    R0,A
 MOV    @R0,KEYNUM
KEY8: MOV    PKEY,#0FH
 MOV    A,PKEY
 CJNE   A,#0FH,KEY8
 INC    R1
 CJNE   R1,#2,KFNL
 MOV    R1,#0 
 SETB   SROTATION 
 JMP    KFNL
KFNL: RET   

;------------------------------------------------
NUM2SEG:MOV   DPTR,#TABLE
 MOV   A,DN
 MOVC  A,@A+DPTR
 MOV   DN,A

 RET
;--------------------------- DELAY
DELAY: MOV    DTMP1,#25
DD2: MOV    DTMP2,#25
DD1: DJNZ   DTMP2,DD1
 DJNZ   DTMP1,DD2
 RET
;--------------------------- MOTOR DELAY
MDELAY: MOV    MDTMP1,#50
MDD2: MOV    MDTMP2,#250
MDD1: DJNZ   MDTMP2,MDD1
 DJNZ   MDTMP1,MDD2
 RET
;--------------------------- DED2DEC
BCD2DEC:
 MOV   B,#10
 MOV   A,N2
 MUL   AB
 ADD   A,N1
 ADD   A,#1
 MOV   N21,A 
 RET
;------------------------------------------------
TABLE: DB    3FH,06H,5BH,4FH,66H,6DH,7DH,27H,7FH,6FH,00H,80H,40H
;------------------------------------------------
ROW_1: DB   1,2,3
ROW_2:  DB   4,5,6
ROW_3: DB   7,8,9
ROW_4: DB   '*',0,'#'
 
END 
Share:

Membuat Control Relay dengan Atmega8

Rangkaian Kontrol Relay :

Code List :
$regfile = "m8def.dat"
$crystal = 1000000
$hwstack = 64
$swstack = 64
$framesize = 64
Config Kbd = Portb , Debounce = 150 , Delay = 200
Config Portb = Input
Config Portc = Output
Config Portd = Output
Dim A As Byte
Speaker Alias Pinc.0

Main:
Wait 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80

Do
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A

Case 0:
Sound Speaker , 120 , 20
Goto Main0


Case 1:
Sound Speaker , 120 , 20
Goto Main1


Case 2:
Sound Speaker , 120 , 20
Goto Main2


Case 3:
Sound Speaker , 120 , 20
Goto Main3


Case 4:
Sound Speaker , 120 , 20
Goto Main4


Case 5:
Sound Speaker , 120 , 20
Goto Main5


Case 6:
Sound Speaker , 120 , 20
Goto Main6


Case 7:
Sound Speaker , 120 , 20
Goto Main7


Case 8:
Sound Speaker , 120 , 20
Goto Main8


Case 9:
Sound Speaker , 120 , 20
Goto Main9

Case 11:
Sound Speaker , 120 , 20
Goto Main11

Case 10:
Sound Speaker , 120 , 20
Goto Main10
End Select
End If
Loop
End
'_______________________________________________________________________________
Read_key:
Data 1 , 4 , 7 , 11 , 2 , 5 , 8 , 0 , 3 , 6 , 9 , 10
'_______________________________________________________________________________
Main0:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portc.5 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portc.5 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main0

Main1:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portc.4 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portc.4 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main1

Main2:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portc.3 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portc.3 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main2

Main3:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portc.2 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portc.2 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main3

Main4:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portc.1 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portc.1 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main4

Main5:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portd.0 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portd.0 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main5
'www.bargh20.com
Main6:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portd.1 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portd.1 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main6

Main7:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portd.2 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portd.2 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main7

Main8:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portd.3 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portd.3 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main8

Main9:
A = Getkbd()
A = Lookup(a , Read_key)
If A < 12 Then
Select Case A
Case 0 To 9:
Sound Speaker , 120 , 500
Case 11:
Portd.4 = 1
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Goto Main
Case 10:
Portd.4 = 0
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Goto Main
End Select
End If
jmp main9

Main11:
Wait 3
A = Getkbd()
A = Lookup(a , Read_key)
If A = 11 Then
Sound Speaker , 120 , 100
Sound Speaker , 120 , 80
Sound Speaker , 120 , 60
Portc.5 = 1
Portc.4 = 1
Portc.3 = 1
Portc.2 = 1
Portc.1 = 1
Portd.0 = 1
Portd.1 = 1
Portd.2 = 1
Portd.3 = 1
Portd.4 = 1
Goto Main
Else
Goto Main
End If

Main10:
Wait 3
A = Getkbd()
A = Lookup(a , Read_key)
If A = 10 Then
Sound Speaker , 120 , 60
Sound Speaker , 120 , 80
Sound Speaker , 120 , 100
Portc.5 = 0
Portc.4 = 0
Portc.3 = 0
Portc.2 = 0
Portc.1 = 0
Portd.0 = 0
Portd.1 = 0
Portd.2 = 0
Portd.3 = 0
Portd.4 = 0
Goto Main
Else
Goto Main
End If
Share:

Menampilkan data dari database ke Combo Box (PHP)

Combo Box, sekilas pernah mendengar istilah tersebut atau mungkin pernah menemui dan bahkan menggunakannya seperti pada form-form pendaftaran di web (Contoh Gambar 1 – sign up form pada halaman facebook), tapi apa sih sebenarnya combo box itu ?? berikut adalah pengertian dari istilah combo box (di kutip dari wikipedia) “A combo box is a commonly used graphical user interface widget (or control). It is a combination of a drop-down list or list box and a single-line textbox, allowing the user to either type a value directly into the control or choose from the list of existing options.“


Gambar 1. Contoh combo box pada form pendaftaran facebook

Selain pada aplikasi berbasis web (web based application), combo box juga dapat kita temui pada aplikasi yang dibangun dengan menggunakan bahasa program lainnya terutama pada aplikasi visual, sebut saja delphi (nama sebenarnya) atau visual basic. Pada aplikasi tersebut juga terdapat komponen combo box yang fungsi nya kurang lebih sama dengan combo box yang kita temui pada aplikasi berbasis website. Gambar 2 menunjukkan contoh komponen combo box pada program delphi.

 Gambar 2. Contoh komponen combo box pada Borland Delphi.
 
Selanjutnya kita akan membuat sebuah antar muka aplikasi berbasis web, dengan sebuah combo box yang akan menampilkan list data dari database. 

Studi Kasus :
Sebelum menginjak ke studi kasus menggunakan database, terlebih dahulu kita bahas sejenak proses pembuatan combo box dengan php, dengan list / option yang sudah kita tentukan sendiri (Tidak berasal dari database).
CODE :

<select name="pilihan">
<option value="belum milih" selected>-Silahkan Pilih makanan Kesukaan Anda-</option>
<option value="sate">Sate</option>
<option value="soto">Soto</option>
<option value="nasi goreng">Nasi Goreng</option>
<option value="nasi pecel">Nasi Pecel</option>
</select>

RESULT :
Selanjutnya kita buat combo box dengan pilihan list / option yang berasal dari database. Studi kasus : Disini saya memiliki database atau basis data anggota ludruk, kemudian kita tampilkan data anggota ludruk tersebut ke combo box pada halaman website yang akan kita buat.
Sederhana saja sih studi kasus nya, namanya juga contoh

Database Structure :
Sebagai contoh, isikan beberapa nama pada tabel anggota_ludruk, pada kolom nama
Code :
Buat koneksi ke database :
<?php
$host = "localhost"; // db host
$username = "root";  // db username
$password = "123456"; // db password
$db = "combo";  // db name

// Melakukan koneksi ke database
mysql_connect($host,$username,$password) or die("Koneksi gagal");
mysql_select_db($db) or die("Database tidak bisa dibuka");
?>
Tampil anggota ke combo :
<?php
include"koneksi.php";

echo "<select name='anggota'>";
$tampil=mysql_query("SELECT * FROM anggota_ludruk ORDER BY id");
echo "<option value='belum milih' selected>- Pilih Anggota Ludruk -</option>";

while($w=mysql_fetch_array($tampil))
{
    echo "<option value=$w[nama] selected>$w[nama]</option>";        
}
 echo "</select>";
?>
Result :
Share:

Membuat User Online Sederhana Pada Halaman Website (PHP)

Seringkali  kita menjumpai sebuah aplikasi (khususnya aplikasi web) seperti facebook, yahoo, gmail, dlsb. Dimana terdapat list atau daftar pengguna / user yang sedang online saat sesi berlangsung. Pada artikel ini, akan diulas sedikit tentang cara pembuatan aplikasi tersebut secara sederhana. Sebenarnya ada beberapa cara untuk menampilkan data user yang sedang online saat sesi sedang berlangsung, salah satunya dapat menggunakan session atau dapat juga menggunakan parameter baru (istilah saya sendiri lho). Parameter baru yang seperti apa sih ? kok seumur-umur di dunia perwebsite’an baru dengar kali ini. Yah, mungkin itu hanya sekedar istilah saja, maklum penulis mempelajari ini semua dengan cara otodidak dengan bantuan internet. Ok, Let’s start…..

Untuk memudahkan, akan saya bagi menjadi 3 bagian utama :
  1. Bagian Login, yang berfungsi untuk mengetahui siapa yang boleh mengakses aplikasi tsb, apakah user atau bukan. Disini juga akan dilakukan pencocokan user-id dan password user.
  2. Bagian User Log, Apabila berhasil melewati bagian pertama, data user akan di simpan ke dalam basis data (data yang di simpan meliputi : jam login, hari atau tanggal login, nama user, dan status login). Status login inilah yang saya istilahkan parameter baru.
  3. Bagian Penampil, Berfungsi untuk menampilkan siapa saja user yang sedang mengakses sistem (user online) mengacu pada status user.
Ok dehh, selanjutnya langsung ke proses pembuatannya :

Step 1
Buat Database dan Tabel-nya, seperti gambar berikut (hanya contoh) :
Database Name : user_online ; Tabel Name : user & log

Gambar 1. Struktur Tabel user

Gambar 2. Struktur Tabel log
Step 2
Proses pembuatan Halaman Login / Login Page (index.php)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript">
function validasi(form){
if (form.username.value == ""){
alert("Anda belum mengisikan Username.");
form.username.focus();
return (false);
}

if (form.password.value == ""){
alert("Anda belum mengisikan Password.");
form.password.focus();
return (false);
}
return (true);
}
</script>

<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<head>
<title>LOGIN</title>
</head>
<body>
<form name="login" action="cek_login.php" method="POST" onSubmit="return validasi(this)">

<br /><br /><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">
<table cellpadding="0" cellspacing="0">
<tr>
<td height="25">Username :</td>
<td> &nbsp;&nbsp;
<input type="text" name="username"  /></td></tr>
<tr><td height="30">Password :</td>
<td> &nbsp;&nbsp;
<input type="password" name="password" /></td></tr>

<tr><td colspan="2"><div align="right">
<input name="submit"  type="submit" value="LOGIN" /></div></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>

</body>
</html>
Step 3
Membuat koneksi ke database (koneksi.php)
Source Code :

<?php
// -- Host, Username dan Password Database
$host = "localhost";//db-host
$username = "root";//db-user
$password = "123456";//db-password
$db = "user_online";//db-name

// Melakukan koneksi ke database
mysql_connect($host,$username,$password) or die("Koneksi gagal");
mysql_select_db($db) or die("Database tidak bisa dibuka");
?>
Step 4

Proses Validasi / Pencocokan data user & password ke Database (cek_login.php)

Source Code :
<?php
include "koneksi.php";
function antiinjection($data){
$filter_sql = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
return $filter_sql;
}

$username = antiinjection($_POST[username]);
$pass     = antiinjection($_POST[password]);

$login=mysql_query("SELECT * FROM user WHERE username='$username' AND password='$pass'");
$ketemu=mysql_num_rows($login);
$r=mysql_fetch_array($login);

// Apabila username dan password ditemukan
if ($ketemu > 0)
{
session_start();
session_register("username");
session_register("password");

$_SESSION[username]     = $r[username];
$_SESSION[password]     = $r[password];

$jam = date("H:i:s");
$tgl = date("Y-m-d");

mysql_query("INSERT INTO log(username,
tanggal,
jamin,
jamout,
status)
VALUES('$_SESSION[username]',
'$tgl',
'$jam',
'logged',
'online')");

header('location:home.php');
}
else
{
echo "<center><br><br><br><br><br><br><b>LOGIN GAGAL! </b><br>
Username atau Password Anda tidak benar.<br>";
echo "<br>";
echo "<input type=button value='ULANGI LAGI' onclick=location.href='index.php'></a></center>";

}
?>

Step 5

Proses selanjutnya bila login berhasil (home.php)
Source Code :

<?php
include "koneksi.php";
session_start();
if (empty($_SESSION[username]) AND empty($_SESSION[password]))
{
header('location:index.php');
}
else
{
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>HOME</title>
<style>
th{
color: #FFFFFF;
font-size: 8pt;
text-transform: uppercase;
text-align: center;
padding: 0.1em;
border-width: 1px;
border-style: solid;
border-color: #969BA5;
border-collapse: collapse;
background-color: #265180;
}
</style>
</head>
<body>                  
<?php                 
echo"
<center>USER ONLINE
<table border=1 width='650' align=center>
<tr><th>No</th><th>Username</th><th>Tanggal Login</th><th>Jam Login</th><th>Jam Logout</th><th>Status</th></tr>";
$sql = mysql_query("SELECT * FROM log ORDER BY no DESC");    
$no=1;
while($d=mysql_fetch_array($sql))
{
echo "<tr><td align=center>$no</td>
<td align=center>$d[username]</td>
<td align=center>$d[tanggal]</td>
<td align=center>$d[jamin]</td>
<td align=center>$d[jamout]</td>";
if($d[status]=='offline')
{
echo"<td style='background-color:red' align=center>OFFLINE</td>";
}      
else
{
echo"<td style='background-color:00ff00' align=center>ONLINE</td>";
}                            
echo"</tr>";
$no++;      
}
echo "</table>";    
echo "<br /><br /><input type=button value='LOGOUT' onclick=location.href='logout.php'></a></center>";    
?>             
</body>
</html>
<?php
}
?>

Step 6

Proses keluar / Logout (logout.php)

Source Code :
<?php
include "koneksi.php";
$jam = date("H:i:s");
session_start();                        
mysql_query("UPDATE log SET jamout='$jam',
status='offline'
WHERE username = '$_SESSION[username]' AND jamout='logged' AND status='online'");
session_destroy();
header('location:index.php');
?>
Tamat ¦..

Pada aplikasi diatas masih memiliki beberapa kekurangan, mohon koreksi dari kawan-kawan dan para pembaca yang budiman. Saran kedepannya untuk user online ini akan lebih baik lagi apabila dipadukan dengan AJAX, sehingga user yang baru melakukan proses login dapat diketahui langsung tanpa me-reload atau me-refresh halaman website tersebut.
Share:

Bilingual Website (PHP & MySQL)

Pernahkah teman-teman memanfaatkan fasilitas / tools google translate ? Pasti rata-rata menjawab “Pernah”. Tetapi yang saya maksud disini adalah tools google yang berfungsi untuk menterjemahkan halaman web yang banyak kita temui pada website atau blog pada umumnya, yang menyediakan banyak pilihan bahasa (Multi Language) pada website tersebut. Umumnya berupa widget yang disediakan oleh mbah google untuk selanjutnya dipasang pada halaman webiste atau blog kita (lihat gambar 1). Nah, udah tau kan sekarang ? trus apa hubungannya sama judul artikel diatas ? kan judulnya cuma bilingual alias 2 bahasa, kalau pakai widget google translate kan bisa bermacam-macam bahasa. Kalau sudah begitu ya kembali ke kebutuhan saja, tergantung keinginan si pemilik web tersebut. Tetapi terkadang dengan pemanfaatan widget multi bahasa tersebut memiliki kekurangan, salah satunya adalah beberapa hasil translation yang kurang sesuai sehingga informasi yang akan ditampilkan menjadi kurang relevan. Pada web-web papan atas yang dibangun secara profesional, ternyata jarang kita temui widget multi bahasa tersebut. Mereka lebih cenderung menggunakan translation atau terjemahan yang berasal dari basis data (database) mereka sendiri.

Gambar 1. Widget Google Translate

Diartikel edisi ini saya hanya ingin sekedar share tentang pembuatan website dwi bahasa tersebut. Sebenarnya tidak harus dwi bahasa sih, cm sebagai contoh aja biar ga banyak-banyak bikinnya. Mau pake multi bahasa juga gpp, sama aja prosesnya. Tetapi disini saya memberi contoh yang sangat sederhana sekali lho, mungkin kalau kita terapkan pada website yang komplek tentu kurang effisien. Yaaaah, namanya mencoba kan ga ada salahnya daripada tidak sama sekali.

Ok, kita mulai saja daripada banyak bicara kayak koruptor….hehehe..

Biar beda ama bahasa-bahasa yang tersedia di widget nya si-mbah google, kali ini kita akan membuat sebuah halaman website sederhana dimana terdapat 2 pilihan bahasa yang tersedia, yaitu : Bahasa Indonesia dan Bahasa Jawa. Demonya bisa kawan lihat pada tautan berikut :


Source Code :

<?php
  session_register('bahasa');
  include "koneksi.php";  

  if($_GET['lang'])
  {
    $_SESSION['bahasa']=$_GET['lang'];
    header('location:index.php');
  }
  else
  {
     if(!$_SESSION['bahasa'])
     {
     $_SESSION['bahasa']='indonesia';
     header('location:index.php');
     }
   }

include "".$_SESSION['bahasa'].".php";
?>


Source code diatas merupakan bagian inti yang berfungsi untuk SWITCHING. Hah?? istilah apa lagi tuh ??? itu istilah saya sendiri alias ngawur.com. hahahaha…. Tetapi pada intinya code diatas berfungsi untuk proses peralihan dari bahasa satu ke bahasa lainnya dengan memanfaatkan session.

Ok, dech ga perlu panjang lebar langsung aja download Full Source Code nya Di SINI

Soalnya kalo Sorce nya di tulis semua disini jadi panjang dehhh artikel nya….hahahaha

-Selesai-
Share:

Widget Setup for Blogger

Step 1.
Get your widget code

Go to your Blog's profile on NetworkedBlogs, click the "Get Widget" link. Copy the text in for Option 1.
Screen_shot_2012-01-16_at_5.43.46_PM.png

Step 2.
Navigate to Layout > Page Elements, then click "Add a Gadget"

help_blogger2.png

Step 3.
From the pop-up list, select "HTML/Javascript"

help_blogger3.png

Step 4.
Paste the HTML code you copied from NetworkedBlogs into the text area and click save. 

help_blogger4.png

Step 5.
You're done. You can now verify your blog

Go to your Blog's profile on NetworkedBlogs, click the "Get Widget" link, then press the Verify button.

http://infonetmu.blogspot.com/2011/02/download-kamus-indonesia-inggrisinggris.html
Share:

Stop Watch dengan Atmega32

Rangkaian :
Code List :
'Program Stopwatch
$regfile = "m32def.dat"
$crystal = 12000000

'deklarasi LCD
Config Lcdpin = Pin , Db4 = Portc.5 , Db5 = Portc.4 , Db6 = Portc.3 , Db7 = Portc.2 , E = Portc.6 , Rs = Portc.7
Config Lcd = 16 * 2
Cursor Off
Cls

'Deklarasi variabel
Dim Pengali As Word
Dim Detik_1 As Byte
Dim Detik As Byte
Dim Menit As Byte
Dim Jam As Word
Dim Status As Byte
Dim Status2 As Byte
Dim Status3 As Byte

'konfigurasi timer
Config Timer0 = Timer , Prescale = 256
Config Debounce = 30
'setting porta
Ddra = 0
Porta = 255

'pengaktifan interupsi timer
On Ovf0 Int_timer0

'penggantian nama variabel
Pin_reset Alias Pina.2
Pin_on_off Alias Pina.1
Pin_capture Alias Pina.0

'setting nilai awal variabel
'Pin_reset = 1
'Pin_on_off = 1
'Pin_capture = 1
Status = 0
Status2 = 1


'pengaktifan timer0
Enable Timer0

Do
 If Pin_capture = 0 Then
   Bitwait Pin_capture , Set
   Incr Status2
   Cls
   Locate 1 , 1
   Lcd "BINA ELEKTRONIK"
   Locate 2 , 1
   Lcd Jam ;
   Locate 2 , 3
   Lcd ":" ;
   Locate 2 , 4
   Lcd Menit ;
   Locate 2 , 6
   Lcd ":" ;
   Locate 2 , 7
   Lcd Detik ;
   Locate 2 , 9
   Lcd ":" ;
   Locate 2 , 10
   Lcd Detik_1 ;
   Locate 2 , 12
   Lcd Capture1
 End If
 If Status2 = 2 Then
   Locate 2 , 13
   Lcd "SLIP"
   End If
If Status2 = 2 Then
   Locate 2 , 11
   Lcd "       "
   End If
 If Pin_on_off = 0 Then
   Bitwait Pin_on_off , Set
   Incr Status

 End If

 If Pin_reset = 0 Then
      Pengali = 0
      Detik_1 = 00
      Locate 2 , 1
      Lcd "00"
      Locate 2 , 4
      Lcd "00"
      Locate 2 , 7
      Lcd "00"
      Locate 2 , 10
      Lcd "00"
      Detik = 00
      Menit = 00
      Jam = 00
 End If


 If Status > 2 Then
   Status = 1
 End If

 If Status2 > 2 Then
   Status2 = 1
   Cls
 End If

 If Status = 1 Then Enable Interrupts
 If Status = 2 Then Disable Interrupts

 If Status2 < 2 Then
   Locate 1 , 1
   Lcd "STOPWATCH"
   Locate 2 , 1
   Lcd Jam ;
   Locate 2 , 3
   Lcd ":" ;
   Locate 2 , 4
   Lcd Menit ;
   Locate 2 , 6
   Lcd ":" ;
   Locate 2 , 7
   Lcd Detik ;
   Locate 2 , 9
   Lcd ":" ;
   Locate 2 , 10
   Lcd Detik_1 ;
   End If
 If Status = 2 Then                                         ' tambahan
   Locate 2 , 13                                            ' tambahan
   Lcd "STOP"                                               ' tambahan
   End If                                                   ' tambahan
 If Status = 1 Then                                         ' tambahan
   Locate 2 , 13                                            ' tambahan
   Lcd ">>>>"                                               ' tambahan
 End If



Loop

Int_timer0:
   Incr Pengali
   If Pengali > 0 Then
      Pengali = 0
      Incr Detik_1
   End If
   If Detik_1 > 99 Then
      Detik_1 = 0
      Incr Detik
   End If
   If Detik > 59 Then
      Detik = 0
      Incr Menit
   End If
   If Menit > 59 Then
      Menit = 0
      Incr Jam
   End If
   Return
Share:

Pengendali motor stepper dengan keypad

Rangkaian ;

Code List :

$regfile = "m16def.dat"
$crystal = 1000000

Config Kbd = Portb
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 ,Rs = Portc.0 , E = Portc.1
Config Portd = Output
Config Porta = Input

Dim A As Byte , B As Byte , Key As Byte , C As Byte , D As Byte , E As Byte

Cls
Cursor Off

B = 0
D = 1

Q:
Locate 1 , 1
Lcd "Putaran :"
Locate 2 , 1
Lcd "Kecept  :"
Do
'************Read Keyboard
A = Getkbd()
If A > 15 Then
   Goto Q
Else
   Key = Lookup(a , Dta)
     If Key <= 9 Then
           B = B * 10
           B = B + Key
'*************Direction
          If D = 0 Then Lcd B
                   Waitms 270
               Elseif Key = 10 Then
                   Locate 1 , 11
                   Lcd "Kiri"
                   C = 1
                   D = 0
                   B = 0

               Elseif Key = 11 Then
                  Locate 1 , 11
                  Lcd "Kanan"
                  C = 2
                  D = 0
                  B = 0
'****************reset
               Elseif Key = 13 Then
                  Cls
                  D = 1
                  B = 0
                  Portd.0 = 0
                  Portd.1 = 0
                  Waitms 50
                  Goto Q
'****************Enter key
               Elseif Key = 14 Then
                   If D = 0 Then
                       Select Case C
                          Case 1 : Gosub R
                          Case 2 : Gosub T
                       End Select

                   End If
         End If

End If

Wait 1

Loop

End

Dta:
Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 11 , 1 , 2 , 3 , 12 , 13 , 0 , 14 , 15

R:
Do
Portd = &B00000001 : Waitms B
Portd = &B00000011 : Waitms B
Portd = &B00000010 : Waitms B
Portd = &B00000110 : Waitms B
Portd = &B00000100 : Waitms B
Portd = &B00001100 : Waitms B
Portd = &B00001000 : Waitms B
Portd = &B00001001 : Waitms B
  If Pina.0 = 1 Then
      Locate 2 , 1
      Lcd "Kecept:"
      B = 0
      Lcd B ; "          "
      Return
  End If

Loop

T:
Do
Portd = &B00001001 : Waitms B
Portd = &B00001000 : Waitms B
Portd = &B00001100 : Waitms B
Portd = &B00000100 : Waitms B
Portd = &B00000110 : Waitms B
Portd = &B00000010 : Waitms B
Portd = &B00000011 : Waitms B
Portd = &B00000001 : Waitms B
   If Pina.0 = 1 Then
       Locate 2 , 1
       Lcd "Kecept:"
       B = 0
       Lcd B ; "          "
       Return
   End If

Loop
Share:

Jadwal Waktu Sholat

TIME WIB

TV EDUKASI LIVE

Popular Posts

Recent Posts

Pages