SHOW:
|
|
- or go back to the newest paste.
| 1 | <? | |
| 2 | include "../koneksi.php"; | |
| 3 | - | |
| 3 | + | //form dahulu |
| 4 | - | //untuk menantukan tanggal awal dan tanggal akhir data di database |
| 4 | + | |
| 5 | - | //$min_tanggal=mysql_fetch_array(mysql_query("select TGL as min_tanggal from td_plg"));
|
| 5 | + | |
| 6 | - | //$max_tanggal=mysql_fetch_array(mysql_query("select max(TGL) as max_tanggal from td_plg"));
|
| 6 | + | |
| 7 | <tr> | |
| 8 | <td width="112"><label for="TGL">Tanggal</label></td> | |
| 9 | <td width="5">:</td> | |
| 10 | <td width="304"><input type="text" name="TGL" id="TGL" maxlength="15" size="15"/> | |
| 11 | <img src="images2/cal.gif" alt="" height="18" style="cursor:pointer" onclick="javascript:NewCssCal('TGL','yyyyMMdd')"/></td>
| |
| 12 | </tr> | |
| 13 | ||
| 14 | <tr> | |
| 15 | <td> </td> | |
| 16 | - | <!--<tr> |
| 16 | + | |
| 17 | - | <td width="111">Id Pelanggan</td> |
| 17 | + | |
| 18 | - | <td colspan="2"><input type="text" name="ID_PEL" value="<?php /*?><?php if(isset($_POST['ID_PEL'])){ echo $_POST['ID_PEL']; }?><?php */?>"/></td>
|
| 18 | + | |
| 19 | - | </tr>--> |
| 19 | + | |
| 20 | <td><input type="submit" value="Tampilkan Data" name="cari" /></td> | |
| 21 | <td colspan="2"> </td> | |
| 22 | </tr> | |
| 23 | </table> | |
| 24 | - | <!-- <tr> |
| 24 | + | |
| 25 | - | <td>Tanggal Akhir</td> |
| 25 | + | |
| 26 | - | <td colspan="2"><input type="text" name="TGL" size="15" value="<?php /*?><? echo $min_tanggal['min_tanggal'];?><?php */?>" /> |
| 26 | + | |
| 27 | - | <a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.postform.tanggal_akhir);return false;" ><img src="calender/calender.jpeg" alt="" name="popcal" width="34" height="29" border="0" align="absmiddle" id="popcal" /></a></td> |
| 27 | + | |
| 28 | - | </tr>--> |
| 28 | + | |
| 29 | {
| |
| 30 | ||
| 31 | /* tes apa aja variable yg dipanggil | |
| 32 | echo '<pre>';print_r($_POST);echo '</pre>'; | |
| 33 | ||
| 34 | */ | |
| 35 | ||
| 36 | //===========PASTIKAN VARIABLE yg dikasi valid | |
| 37 | $tanggal=date('Y-m-d', strtotime($_POST['TGL']);
| |
| 38 | //kamu harus pastikan itu tanggalnya | |
| 39 | ||
| 40 | //===========IF berdasarkan tanggal | |
| 41 | if(empty($tanggal)){
| |
| 42 | $sql="select * from td_plg"; | |
| 43 | }else{
| |
| 44 | $sql="SELECT d.NO_KSR,c.ID_PEL, b.NM, c.TRIF_BR, c.DY_BR, c.GARDU, c.TIANG, c.NO_METER, b.KET from t_tim a, tm_plg b, td_plg c, t_kasir d where a.C_TIM=b.C_TIM and b.KTP=b.KTP and c.ID_PEL=b.ID_PEL and b.STATUS_KSR=1 and b.NO_KSR=d.NO_KSR and TGL='$TGL'"; | |
| 45 | } | |
| 46 | //====PASTIKAN BENTUKNYA SAMA.. jangan satu di query.. satu cuma nama | |
| 47 | echo $sql; //coba tes apakah querynya benar/ salah di phpmyadmin | |
| 48 | } |