Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(session_id() == '') {
- session_start();
- $agenid=$_SESSION['agenid'];
- if(session_is_registered('agenid')){
- }
- else{
- header("location:admin.php");
- }
- }
- ?>
- <div class="menu">
- <?php include 'menu.php';?>
- </div>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Transaksi</title>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
- $(function() {
- $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' }).val();
- });
- </script>
- </head>
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
- $(function() {
- $( "#datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' }).val();
- });
- </script>
- </head>
- <body>
- <form method="post" action="transaksi.php">
- <p>Pencarian berdasarkan tanggal: </p>
- <p>
- <label style="color:#FFF;" for="from">Dari</label>
- Dari:<input type="text" id="datepicker" name="dp1">
- <label style="color:#FFF;" for="from">Sampai</label>
- Sampai:<input type="text" id="datepicker2" name="dp2">
- <input name="tcari" type="submit" value="cari" />
- <label for="tes"></label>
- </p>
- <p> </p>
- <table width="734" border='0' align='center'>
- <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>
- <?php
- include 'koneksi.php';
- if (isset($_POST['tcari'])) {
- $from = $_POST["dp1"];
- $to = $_POST["dp2"];
- $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 ";
- $exe = mysql_query($query);
- $no = 1;
- $baru = "#FFFF00";
- $lama="#FFFF00";
- while($row = mysql_fetch_assoc($exe)){
- $a = $row['tanggal'];
- $b = $row['jam'];
- $c = $row['agenid'];
- $d = $row['denom'];
- $e = $row['nomor'];
- $f = $row['harga'];
- $g = $row['status'];
- $h = $row['vsn'];
- // beri warna selang seling
- if(($no % 2)==0)$warna = $baru;
- else $warna = $lama;
- echo "<tr bgcolor=$warna align=center>
- <td>$no</td>
- <td>$a<br>$b</td>
- <td>$c</td>
- <td bgcolor=blue>$d<br>$f</td>
- <td>$e</td>
- <td>$g</td>
- <td>$h</td>
- </tr>";
- $no++;
- }}
- ?>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement