nDh4

form pencariannya

Jun 4th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <form id="form1" name="form1" method="post" action="../c_excel.php">
  10. <p>
  11. <?php
  12. /*
  13. saya akan buang segala yang menurut saya belum perlu
  14. seperti html.. jadi biarlah tampilannya buruk rupa seperti
  15. wajah saya
  16. */
  17.  
  18. if($_POST)
  19. {
  20. $con = mysql_connect("localhost", "root", "root") or
  21. die("Error: " . mysql_error());
  22.  
  23.  
  24. mysql_select_db("pln2", $con);
  25. $date=date('Y-m-d',strtotime($_POST['TGL']) );
  26. echo $sql="SELECT a.HARI, a.TGL, a.ID_PEL, a.NO_METER, a.DY_BR, a.GARDU, a.TIANG, b.NM FROM td_plg a, tm_plg b WHERE a.ID_PEL=b.ID_PEL and a.TGL like '$date%'";
  27. //echo $query = "SELECT a.NM, b.ID_PEL, b.NO_METER, b.DY_BR, b.GARDU, b.TIANG, b.TGL, c.C_TIM FROM tm_plg a, td_plg b, t_tim c where a.ID_PEL=b.ID_PEL and a.C_TIM=c.C_TIM and a.STATUS_KSR=0 and b.TGL=$tanggal";
  28. $result = mysql_query($sql)or die(mysql_error());
  29. /*
  30. pastikan dari point ini.. tampilannya BENAR!!
  31. */
  32. ?>
  33. </p>
  34. <table width="86%" class="display" id="datatables" border="1" >
  35. <thead>
  36. <tr>
  37. <th width="58">Hari</th>
  38. <th width="99">Tanggal</th>
  39. <th width="118">Nama</th>
  40. <th width="129">Id Pelanggan</th>
  41. <th width="145">Nomor Meter</th>
  42. <th width="60">Daya</th>
  43. <th width="77">Gardu</th>
  44. <th width="77">Tiang</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. <?php
  49. while ($row = mysql_fetch_array($result)) {
  50. ?>
  51. <tr>
  52. <td><?=$row['HARI']?></td>
  53. <td><?=$row['TGL']?></td>
  54. <td><?=$row['NM']?></td>
  55. <td><?=$row['ID_PEL']?></td>
  56. <td><?=$row['NO_METER']?></td>
  57. <td><?=$row['DY_BR']?></td>
  58. <td><?=$row['GARDU']?></td>
  59. <td><?=$row['TIANG']?></td>
  60. </tr>
  61. <?php
  62. }
  63. ?>
  64. </tbody>
  65. </table>
  66. <p>&nbsp; </p>
  67. <p>
  68. <input type="submit" name="convert" id="convert" value="Submit" />
  69. </p>
  70. <p>
  71. <?
  72. /*
  73. keluarannya benar.. kalau sudah benar.. ubah script diatas
  74. buat memakai php-excel
  75. caranya ubah2 aja jadi fungsi2 yg keluar di php-excel!!
  76. */
  77. }else{ //if POST?>
  78. </p>
  79. </form>
  80. <p>&nbsp;</p>
  81. <form action="cari.php" method="post"
  82. target='report'>
  83. <input type=text name='TGL' > format: 2012-05-10
  84. <p>
  85. <input type="submit" value="Convert Data">
  86. </p>
  87. </form><?
  88. }
  89.  
  90.  
  91. ?>
  92.  
  93. </body>
  94. </html>
Advertisement
Add Comment
Please, Sign In to add comment