| | | <script LANGUAGE= "Javascript" >
005 | function CheckAll(chk) |
007 | for (i = 0; i < chk.length; i++) |
008 | chk[i].checked = true ; |
011 | function UnCheckAll(chk) |
013 | for (i = 0; i < chk.length; i++) |
014 | chk[i].checked = false ; |
020 | <?php require_once ( '../Connections/connection.php' ); ?> |
023 | $kod_kursus = $_POST [ "kod_kursus" ]; |
024 | mysql_select_db( $database_connection , $connection ); |
025 | $query_kursus = "SELECT * FROM m_kursus WHERE kod_kursus='$kod_kursus'" ; |
026 | $kursus = mysql_query( $query_kursus , $connection ) or die (mysql_error()); |
027 | $row_kursus = mysql_fetch_assoc( $kursus ); |
028 | $totalRows_kursus = mysql_num_rows( $kursus ); |
030 | $kelas = $_POST [ "kelas" ]; |
031 | mysql_select_db( $database_connection , $connection ); |
032 | $query_kelas = "SELECT * FROM m_pelajar WHERE kelas='$kelas'" ; |
033 | $kelas = mysql_query( $query_kelas , $connection ) or die (mysql_error()); |
034 | $row_kelas = mysql_fetch_assoc( $kelas ); |
035 | $totalRows_kelas = mysql_num_rows( $kelas ); |
037 | $kod_pensyarah = $_POST [ "kod_pensyarah" ]; |
038 | mysql_select_db( $database_connection , $connection ); |
039 | $query_pensyarah = "SELECT * FROM plogin WHERE kod_pensyarah = '$kod_pensyarah'" ; |
040 | $pensyarah = mysql_query( $query_pensyarah , $connection ) or die (mysql_error()); |
041 | $row_pensyarah = mysql_fetch_assoc( $pensyarah ); |
042 | $totalRows_pensyarah = mysql_num_rows( $pensyarah ); |
043 | $result = mysql_query( $query_kelas ); |
050 | <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" /> |
051 | <title>Untitled Document</title> |
052 | <style type= "text/css" > |
055 | font-family: Verdana, Geneva, sans-serif; |
061 | font-family: "Arial Black" , Gadget, sans-serif; |
064 | font-family: "A Charming Font" , "Felix Titling" , "Floral Dawn" , "Lucida Sans Unicode" ; |
067 | font-family: Verdana, Geneva, sans-serif; |
073 | font-family: "Kozuka Mincho Pro B" , Utsaah, "Segoe UI" ; |
076 | font-family: Verdana, Geneva, sans-serif; |
082 | font-family: Verdana, Geneva, sans-serif; |
087 | <body background= "image_e-kehadiran/Bs_Black_Floor_1440x900.jpg" > |
089 | <table width= "494" border= "0" align= "center" > |
091 | <th width= "204" align= "center" valign= "middle" class = "tulisan" scope= "row" ><blockquote> |
092 | <p class = "tulisan" ><span class = "tulisan" > Kod Kursus :</span></p> |
094 | <td width= "232" ><span class = "tulisan" ><?php echo $row_kursus [ 'kod_kursus' ]; ?> </span></td> |
097 | <th align= "center" class = "tulisan" scope= "row" ><blockquote> |
098 | <p><span class = "tulisan" >Nama Kursus :</span></p> |
100 | <td><span class = "tulisan" ><?php echo $row_kursus [ 'nama_kursus' ]; ?> </span></td> |
103 | <form id= "form" name= "myform" method= "post" action= "" > |
105 | <table width= "733" height= "63" border= "1" align= "center" > |
107 | <td width= "220" height= "29" align= "center" ><strong>No. Pendaftaran </strong></td> |
108 | <td width= "231" align= "center" ><strong>Nama </strong></td> |
109 | <td width= "174" align= "center" ><strong>Kelas </strong></td> |
110 | <td width= "80" align= "center" ><strong>Daftar </strong></td> |
113 | while ( $rows = mysql_fetch_array( $result )) |
122 | <td height= "26" align= "center" valign= "middle" ><label> |
123 | <?php echo $no_pend ?> |
126 | <td align= "center" valign= "middle" ><?php echo $nama_pelajar ?> |
128 | <td align= "center" valign= "middle" ><?php echo $kelas ?> |
130 | <td align= "center" valign= "middle" ><input name= "status_id" type= "checkbox" id= "status" value= "1" /></td> |
137 | <table width= "332" border= "0" align= "center" > |
139 | <th width= "193" align= "right" scope= "row" ><input type= "button" name= "Check_All" value= "Check All" |
140 | onclick= "CheckAll(document.myform.status)" /> |
141 | <input type= "button" name= "Un_CheckAll" value= "Uncheck All " |
142 | onclick= "UnCheckAll(document.myform.status)" /> |
144 | <th width= "84" scope= "row" ><label> |
146 | <input type= "submit" name= "Simpan" id= "Simpan" value= "Simpan" /> |
158 | if (isset( $_POST [ 'Simpan' ])) |
161 | $status_id = $_POST [ 'form1.status_id' ]; |
162 | $no_pend = $totalRows_kelas [ 'no_pend' ]; |
163 | $nama_pelajar = $totalRows_kelas [ 'nama_pelajar' ]; |
164 | $kelas = $totalRows_kelas [ 'kelas' ]; |
165 | $kod_pensyarah = $totalRows_pensyarah [ 'kod_pensyarah' ]; |
168 | $sql ="INSERT INTO pend_kursus( kod_pensyarah,kod_kursus, no_pend, kelas ) |
170 | ( '$kod_pensyarah' , '$kod_kursus' , '$no_pend' , '$kelas' )"; |
173 | echo "<script language='Javascript'>alert('Maklumat Telah Berjaya Disimpan');</script>" ; |
175 | $result = mysql_query( $sql );?> |
177 | mysql_free_result( $pensyarah ); |
179 | [attachment=22599:pend_kursus.php] |
|
No comments:
Post a Comment