Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $filename = 'dataPelanggan';
- header("Content-type: application/vnd.ms-excel");
- header("Content-Disposition: attachment;Filename=".$filename.".xlsx");
- ?>
- <h1>Data Pelanggan</h1>
- <p>
- <?php echo $_POST['HARI'] ?>
- </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 = $_POST['date'];
- //$date=date('Y-m-d',strtotime($_POST['TGL']) );
- //$NM=$_POST['NM'];*/
- $sql="SELECT a.NM, b.ID_PEL, b.NO_METER, b.DY_BR, b.GARDU, b.TIANG, b.TGL, c.C_TIM, b.HARI 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 a.STATUS_MAT=0 and b.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!!
- */
- ?>
- <hr />
- <table width="86%" class="display" id="datatables" border="1" >
- <thead>
- <tr>
- <th width="118">Hari</th>
- <th width="118">Tanggal</th>
- <th width="118">TIM</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>
- <?php
- while ($row = mysql_fetch_array($result)) {
- ?>
- <tr>
- <td><? echo $row['HARI']; ?></td>
- <td><? echo $row['TGL']; ?></td>
- <td><? echo $row['C_TIM']; ?></td>
- <td><? echo $row['NM']; ?></td>
- <td>trim() <? echo $row['ID_PEL']; ?></td>
- <td><? echo $row['NO_METER']; ?></td>
- <td><? echo $row['DY_BR']; ?></td>
- <td><? echo $row['GARDU']; ?></td>
- <td><? echo $row['TIANG']; ?></td>
- </tr>
- <?php
- }}
- ?>
- </thead>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment