Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Start session
- session_start();
- //Check whether the session variable SESS_MEMBER_ID is present or not
- if(!isset($_SESSION["USERNAME"]) || (trim($_SESSION["PASS"]) == '')) {
- header("location: access-denied.php");
- exit();
- }
- ?>
- <!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>
- <script src="../tim/datetimepicker_css.js"></script>
- <style type="text/css">
- <!--
- form {
- text-align: center;
- }
- -->
- </style>
- </head>
- <body>
- <p>
- <?php
- echo "<p>Selamat datang ".$_SESSION['USERNAME']." </p>";
- /*
- 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']) );
- //$NM=$_POST['NM'];
- $sql="SELECT a.HARI, a.TGL, d.C_TIM, d.NM_APP, a.ID_PEL, b.NM, a.NO_METER, a.DY_BR, a.GARDU, a.TIANG, c.KBL_TC, c.MCB,c.KONEKTOR,c.SI_WEDGE_CLAMP,c.NYM from td_plg a, tm_plg b, t_material c, t_tim d WHERE
- a.ID_PEL=b.ID_PEL
- and b.KTP=a.KTP
- and c.NO_MAT=b.NO_MAT and a.NO_METER=b.NO_METER
- AND d.C_TIM = b.C_TIM and b.STATUS_MAT=1
- AND d.C_TIM = c.C_TIM
- and a.TGL like '$date%'";
- $result = mysql_query($sql)or die(mysql_error());
- /*
- pastikan dari point ini.. tampilannya BENAR!!
- */
- ?>
- </p>
- <table width="114%" class="display" id="datatables" border="1" >
- <thead>
- <tr>
- <th width="56" rowspan="2">Hari</th>
- <th width="82" rowspan="2">Tanggal</th>
- <th width="55" rowspan="2">Tim</th>
- <th width="92" rowspan="2">Nama APP</th>
- <th width="143" rowspan="2">Nama</th>
- <th width="121" rowspan="2">Id Pelanggan</th>
- <th width="114" rowspan="2">Nomor Meter</th>
- <th width="36" rowspan="2">Daya</th>
- <th width="49" rowspan="2">Gardu</th>
- <th width="44" rowspan="2">Tiang</th>
- <th colspan="5">Kebutuhan Material Pelanggan</th>
- </tr>
- <tr>
- <th width="71">Kabel TC</th>
- <th width="58">MCB</th>
- <th width="99">Tap Connector</th>
- <th width="119">SI Wedge Clamp</th>
- <th width="61">NYM</th>
- </tr>
- </thead>
- <tbody>
- <?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_APP']; ?></td>
- <td><? echo $row['NM']; ?></td>
- <td><? 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>
- <td><? echo $row['KBL_TC']; ?></td>
- <td><? echo $row['MCB']; ?></td>
- <td><? echo $row['KONEKTOR']; ?></td>
- <td><? echo $row['SI_WEDGE_CLAMP']; ?></td>
- <td><? echo $row['NYM']; ?></td>
- </tr>
- </tbody>
- <?php
- }
- ?>
- <td colspan="15" align="center">
- <?php
- //jika data tidak ditemukan
- if(mysql_num_rows($result)==0){
- echo "<font color=red><blink>Tidak ada data yang dicari!</blink></font>";
- }
- ?>
- </td>
- </tr>
- </table>
- <form id="form1" name="form1" action="hsl_cr_mat.php" method="post" target="iframe">
- <p>
- <input type="hidden" name="HARI" value="<?=$row['HARI'];?>"/>
- <input type="hidden" name="TGL" value="<?=$date;?>"/>
- <input type="hidden" name="NM" value="<? echo $row['NM'];?>"/>
- <input type="hidden" name="ID_PEL" value="<?=$row['ID_PEL'];?>"/>
- <input type="hidden" name="NO_METER" value="<?=$row['NO_METER'];?>"/>
- <input type="hidden" name="DY_BR" value="<?=$row['DY_BR'];?>"/>
- <input type="hidden" name="GARDU" value="<?=$row['GARDU'];?>"/>
- <input type="hidden" name="TIANG" value="<?=$row['TIANG'];?>"/>
- <input type="hidden" name="ADM" value="<?=$row['ADM'];?>"/>
- <input type="submit" name="convert" id="convert" value="Submit" />
- </p>
- </form>
- <p> </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>
- <p> </p>
- <form action="cari_material.php" method="post" target='iframe'>
- <p>Pencarian data material</p>
- <p>
- <input type="text" name="TGL" id="TGL" maxlength="15" size="15" align="middle" />
- <img src="../tim/images2/cal.gif" alt="" height="18" style="cursor:pointer" onclick="javascript:NewCssCal('TGL','yyyyMMdd')"/>
- </p>
- <p>
- <input type="submit" value="Cari" align="middle">
- </p>
- </form><?
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment