Advertisement
cdsatrian

nip-nama-jquery

Aug 6th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <link href="css/styles.css" rel="stylesheet" type="text/css" />
  2. <script src="js/jquery-1.7.2.min.js"></script>
  3. <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
  4. <script type='text/javascript' src='js/example.js'></script>
  5. <link type="image/gif" href="image/kecil_879522dinas-perhubungan.jpg" rel="icon"/>
  6. </head>
  7. <SCRIPT language="Javascript"> 
  8. $(document).ready(function(){
  9.   $('#bglb,#trgt').hide();
  10.   $("#link").click(function(){
  11.     $('#bglb,#trgt').fadeIn('fast');
  12.   });
  13.  
  14.   $('#bglb,.cllb').click(function(){
  15.    $('#bglb,#trgt').fadeOut('fast');
  16.   });
  17.  
  18.   $('tr.datapeg').click(function(){
  19.       $('#txtnip').val(($('#n'+this.id).html()));
  20.       $('#txtnama').val(($('#m'+this.id).html()))
  21.     });
  22. });
  23. </script>
  24. <body>
  25. <div id="bglb"></div>
  26. <div id="trgt">
  27. <table border=1 align=center >
  28. <tr>
  29. <th align=center>Nip</th>
  30. <th align=center>Jenis Nama</th>
  31. </tr>
  32. <?php
  33.   include "config/koneksi.php";
  34.   $query="select NIP, NAMA from pegawai";
  35.   $sql = mysql_query($query);
  36.   while($data = mysql_fetch_array($sql)){
  37.    echo "<tr class='datapeg' id='".$data['NIP']."'>
  38.         <td><span id='n".$data['NIP']."'>".$data['NIP']."</span></td>
  39.         <td><span id='m".$data['NIP']."'>".$data['NAMA']."</span></td>
  40.         </tr>";
  41. }
  42. ?>
  43. </table>
  44. </div>
  45. </div>
  46. <form action="" method="post" name="input">
  47. <p><label><span>Npwp</span></label><input type="text" name="txtnpwp" ></p>
  48. <tr>
  49. <td width=200><font color=#FFFFFF>Nip</font></td>
  50. <td> <input type='text' name='txtnip' size=25 id="txtnip" />
  51. <input type='text' name='txtnama' size=30 id="txtnama">
  52. <input type=button name=Input value=Browse id='link'>
  53. </td>
  54. </tr>
  55. <p><label>Jenis Bendahara</label><input type="text" name="txtjenis_bendahara" /></p>
  56. <p><label>Nama Bank</label><input type="text" name="txtnama_bank"/></p>
  57. <p><label >No Rekening</label><input type="text" name="txtno_rekening" /></p>
  58. <p class="submit-wrap"><input type="submit" id="ftp-submit" class="button" value="Save" name="input" /></p>
  59. </form>
  60. </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement