Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- </head>
- <body>
- <form id="form1" name="form1" method="post" action="../c_excel.php">
- <p>
- <?php
- /*
- saya akan buang segala yang menurut saya belum perlu
- seperti html.. jadi biarlah tampilannya buruk rupa seperti
- wajah saya
- */
- if($_POST)
- {
- $con = mysql_connect("localhost", "root", "root") or
- die("Error: " . mysql_error());
- mysql_select_db("pln2", $con);
- $date=date('Y-m-d',strtotime($_POST['TGL']) );
- 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%'";
- //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";
- $result = mysql_query($sql)or die(mysql_error());
- /*
- pastikan dari point ini.. tampilannya BENAR!!
- */
- ?>
- </p>
- <table width="86%" class="display" id="datatables" border="1" >
- <thead>
- <tr>
- <th width="58">Hari</th>
- <th width="99">Tanggal</th>
- <th width="118">Nama</th>
- <th width="129">Id Pelanggan</th>
- <th width="145">Nomor Meter</th>
- <th width="60">Daya</th>
- <th width="77">Gardu</th>
- <th width="77">Tiang</th>
- </tr>
- </thead>
- <tbody>
- <?php
- while ($row = mysql_fetch_array($result)) {
- ?>
- <tr>
- <td><?=$row['HARI']?></td>
- <td><?=$row['TGL']?></td>
- <td><?=$row['NM']?></td>
- <td><?=$row['ID_PEL']?></td>
- <td><?=$row['NO_METER']?></td>
- <td><?=$row['DY_BR']?></td>
- <td><?=$row['GARDU']?></td>
- <td><?=$row['TIANG']?></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- <p> </p>
- <p>
- <input type="submit" name="convert" id="convert" value="Submit" />
- </p>
- <p>
- <?
- /*
- keluarannya benar.. kalau sudah benar.. ubah script diatas
- buat memakai php-excel
- caranya ubah2 aja jadi fungsi2 yg keluar di php-excel!!
- */
- }else{ //if POST?>
- </p>
- </form>
- <p> </p>
- <form action="cari.php" method="post"
- target='report'>
- <input type=text name='TGL' > format: 2012-05-10
- <p>
- <input type="submit" value="Convert Data">
- </p>
- </form><?
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment