Advertisement
Guest User

search

a guest
Jun 12th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. <?php
  2. if(session_id() == '') {
  3. session_start();
  4. $agenid=$_SESSION['agenid'];
  5.  
  6. if(session_is_registered('agenid')){
  7. }
  8. else{
  9. header("location:admin.php");
  10. }
  11. }
  12. ?>
  13.  
  14. <div class="menu">
  15. <?php include 'menu.php';?>
  16. </div>
  17.  
  18. <!doctype html>
  19. <html lang="en">
  20. <head>
  21. <meta charset="utf-8">
  22. <title>Transaksi</title>
  23. <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  24. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  25. <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  26. <link rel="stylesheet" href="/resources/demos/style.css">
  27. <script>
  28. $(function() {
  29. $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' }).val();
  30. });
  31. </script>
  32. </head>
  33.  
  34. <head>
  35. <meta charset="utf-8">
  36. <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  37. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  38. <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  39. <link rel="stylesheet" href="/resources/demos/style.css">
  40. <script>
  41. $(function() {
  42. $( "#datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' }).val();
  43. });
  44. </script>
  45. </head>
  46. <body>
  47.  
  48. <form method="post" action="transaksi.php">
  49. <p>Pencarian berdasarkan tanggal: </p>
  50. <p>
  51. <label style="color:#FFF;" for="from">Dari</label>
  52. Dari:<input type="text" id="datepicker" name="dp1">
  53. <label style="color:#FFF;" for="from">Sampai</label>
  54. Sampai:<input type="text" id="datepicker2" name="dp2">
  55.  
  56. <input name="tcari" type="submit" value="cari" />
  57. <label for="tes"></label>
  58. </p>
  59. <p>&nbsp; </p>
  60.  
  61. <table width="734" border='0' align='center'>
  62. <tr bgcolor=#ADFF2F><th width="34">No</th><th width="97">Tanggal</th><th width="88">AGENID</th><th width="71">Nominal</th><th width="129">Nomor</th><th width="81">Status</th><th width="220">VSN</th>
  63.  
  64. <?php
  65. include 'koneksi.php';
  66.  
  67.  
  68. if (isset($_POST['tcari'])) {
  69.  
  70. $from = $_POST["dp1"];
  71. $to = $_POST["dp2"];
  72.  
  73.  
  74. $query = "SELECT * from log_transaksi where tanggal >= DATE_FORMAT('" . $from . "', '%Y-%m-%d') AND tanggal <= DATE_FORMAT('" . $to . "', '%Y-%m-%d') AND agenid ='$agenid' ORDER BY tanggal,jam ASC ";
  75. $exe = mysql_query($query);
  76. $no = 1;
  77. $baru = "#FFFF00";
  78. $lama="#FFFF00";
  79. while($row = mysql_fetch_assoc($exe)){
  80.  
  81. $a = $row['tanggal'];
  82. $b = $row['jam'];
  83. $c = $row['agenid'];
  84. $d = $row['denom'];
  85. $e = $row['nomor'];
  86. $f = $row['harga'];
  87. $g = $row['status'];
  88. $h = $row['vsn'];
  89.  
  90.  
  91. // beri warna selang seling
  92. if(($no % 2)==0)$warna = $baru;
  93.  
  94. else $warna = $lama;
  95.  
  96.  
  97. echo "<tr bgcolor=$warna align=center>
  98. <td>$no</td>
  99. <td>$a<br>$b</td>
  100. <td>$c</td>
  101. <td bgcolor=blue>$d<br>$f</td>
  102. <td>$e</td>
  103. <td>$g</td>
  104. <td>$h</td>
  105. </tr>";
  106. $no++;
  107.  
  108.  
  109. }}
  110. ?>
  111.  
  112.  
  113.  
  114. </table>
  115.  
  116.  
  117. </form>
  118.  
  119.  
  120. </body>
  121. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement