Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function testing(){
- var b1 = parseFloat (document.forms.hitung.mtk1.value);
- var b2 = parseFloat (document.forms.hitung.mtk2.value);
- var b3 = parseFloat (document.forms.hitung.ipa1.value);
- var b4 = parseFloat (document.forms.hitung.ipa2.value);
- var b5 = parseFloat (document.forms.hitung.ips1.value);
- var b6 = parseFloat (document.forms.hitung.ips2.value);
- var b7 = parseFloat (document.forms.hitung.bindo1.value);
- var b8 = parseFloat (document.forms.hitung.bing1.value);
- var b9 = parseFloat (document.forms.hitung.bindo2.value);
- var b10 = parseFloat (document.forms.hitung.bing2.value);
- document.forms.hitung.ipa.value = (((b1+b2)/2) + ((b3+b4)/2))/2 ;
- document.forms.hitung.bahasa.value =(((b7+b9)/2) + ((b8+b10)/2))/2 ;
- document.forms.hitung.ips.value = (b5+b6)/2;
- document.forms.hitung.rata.value = (b1+b2+b3+b4+b5+b6+b7+b8+b9+b10)/10;
- }
- </script>
- <?php
- $a=$_POST['ipa'];
- $b=$_POST['ips'];
- $c=$_POST['bahasa'];
- if($a>=$b && $a>=$c){
- $jrs="IPA";
- }else if($b>=$a && $b>=$c){
- $jrs="IPS";
- }else if($c>=$a && $c>=$b){
- $jrs="BAHASA";
- }
- ?>
- <form name="hitung">
- <table width="1001" border="0">
- <tr>
- <td colspan="6"><div align="center"><strong>PEMINATAN DAN PENJURUSAN</strong></div></td>
- </tr>
- <tr>
- <td>Tahun Ajaran</td>
- <td colspan="5"><input type="text" name="thn_ajaran" ></td>
- </tr>
- <tr>
- <td width="116">Nama Siswa</td>
- <td colspan="5">
- <?php
- $result = mysql_query("select nis,nama from tb_siswa group by nama desc");
- $jsArray = "var Nis= new Array();";
- echo'<select name="nama" id="nama" onchange="document.getElementById(\'nis\').value = Nis[this.value]">';
- echo '<option></option>';
- while ($row = mysql_fetch_array($result)) {
- echo '<option value="' . $row['nama'] . '">' . $row['nama'] . '</option>';
- $jsArray .= "Nis['" . $row['nama'] . "'] = '" . addslashes($row['nis']) . "';";
- }
- echo '</select>';
- ?>
- <input type="text" id="nis" name="nis" size="10" maxlength="10" value="" /><!--<?php echo $nis;?>-->
- <script type="text/javascript">
- <?php echo $jsArray; ?>
- </script> </td>
- </tr>
- <tr>
- <td colspan="3"><div align="center"><strong>NILAI SKHU</strong></div></td>
- <td colspan="3"><div align="center"><strong>NILAI TES AKADEMIK</strong></div></td>
- </tr>
- <tr>
- <td>Matematika</td>
- <td colspan="2"><input type="text" name="mtk1" onKeyUp="return testing()"></td>
- <td width="147">Matematika</td>
- <td colspan="2"><input type="text" name="mtk2" onKeyUp="return testing()"></td>
- </tr>
- <tr>
- <td>IPA</td>
- <td colspan="2"><input type="text" name="ipa1" onKeyUp="return testing()" ></td>
- <td>IPA</td>
- <td colspan="2"><input type="text" name="ipa2" onKeyUp="return testing()" ></td>
- </tr>
- <tr>
- <td>IPS</td>
- <td colspan="2"><input type="text" name="ips1" onKeyUp="return testing()"></td>
- <td>IPS</td>
- <td colspan="2"><input type="text" name="ips2" onKeyUp="return testing()"></td>
- </tr>
- <tr>
- <td>Bahasa Indonesia</td>
- <td colspan="2"><input type="text" name="bindo1" onKeyUp="return testing()"></td>
- <td>Bahasa Indonesia</td>
- <td colspan="2"><input type="text" name="bindo2" onKeyUp="return testing()"></td>
- </tr>
- <tr>
- <td>Bahasa Inggris</td>
- <td colspan="2"><input type="text" name="bing1" onKeyUp="return testing()"></td>
- <td>Bahasa Inggris</td>
- <td colspan="2"><input type="text" name="bing2" onKeyUp="return testing()"></td>
- </tr>
- <tr>
- <td colspan="6"> </td>
- </tr>
- <tr>
- <td><strong>IPA</strong></td>
- <td width="114"><input type="text" name="ipa" value="<?php echo $a; ?>"></td>
- <td width="137"><strong>IPS</strong></td>
- <td><input type="text" name="ips" value="<?php echo $b; ?>"></td>
- <td width="145"><strong>BAHASA</strong></td>
- <td width="173"><input type="text" name="bahasa" value="<?php echo $c; ?>"></td>
- </tr>
- <tr>
- <td colspan="2"><strong>Rata-rata</strong></td>
- <td colspan="4"><input type="text" name="rata" onKeyUp="return testing()" ></td>
- </tr>
- <tr>
- <td colspan="2"><strong>Value</strong></td>
- <td colspan="4"><input type="text" name="pil1"value="<?php echo $jrs; ?>" ></td>
- </tr>
- <tr>
- <td colspan="2"><strong>Rekomendasi Tes Psikolog</strong></td>
- <td colspan="4"><input type="text" name="pil2" ></td>
- </tr>
- <tr>
- <td colspan="6"><div align="center">
- <input name="Tambah" type="submit" class="submit" id="Tambah" value="Tambah">
- <input name="Batal" type="submit" class="button" id="Batal" value="Batal">
- </div></td>
- </tr>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment