[ create a new paste ] login | about

Link: http://codepad.org/G6L9crsR    [ raw code | output | fork ]

PHP, pasted on Dec 24:
			<table width="100%">
				<tr>
					<td width="90%">
                    <form class='w3-tiny' name="proses" action='' method='POST'>	
						<div class="col-lg-6">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="23%">PERIODE</td>
									<td width="2%">:</td>
									<td width="35%"><input type="text"  name="tglaw" class="form-control datepicker" value="<?=$tglaw?>" autocomplete="off"></td>
									<td width="5%">S/D</td>
									<td width="35%"><input type="text"  name="tglak" class="form-control datepicker" value="<?=$tglak?>" autocomplete="off"></td>
								</tr>
							</table>
						</div>
						<div class="col-lg-6">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="23%">PELANGGAN</td>
									<td width="2%">:</td>
									<td width="75%">
										<select name='pelanggan' id="pelanggan" class='form-control'>
                                        	<option></option>
                                            <?php
                                            $SQL = "SELECT * FROM $db_tr_pelanggan WHERE status ='1' ORDER BY nama ";
											$hasil = mysql_query($SQL);
                                            while($baris = mysql_fetch_array($hasil)){ ?>
                                            	<option value="<?=$baris['kode']?>" <?php if($baris['kode']==$pelanggan){ echo "selected"; }{} ?>><?=$baris['nama']?></option>
                                            <?php } ?>
                                        </select>
									</td>
								</tr>
							</table>
						</div>
						<div class="col-lg-6">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="23%">NO.BUKTI</td>
									<td width="2%">:</td>
									<td width="65%"><input type="text"  name="nok" class="form-control besar" value="<?=$nok?>" autocomplete="off">
									</td>
									<td width="1%">&nbsp;</td>
									<td width="9%"> <button type="submit" class="btn btn-success"  title='Posting Data pembelian'>Cari</button>
									</td>
								</tr>
							</table>
						</div>
						<div class="col-lg-6">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="23%">SORT BY</td>
									<td width="2%">:</td>
									<td width="55%">
										<select name="sort" onchange="submit()"  class="form-control">
                                        	<option></option>
											<option value="1" <?php if($sort=='1'){ echo "selected"; }{} ?>>NO.BUKTI</option>
											<option value="2" <?php if($sort=='2'){ echo "selected"; }{} ?>>TANGGAL</option>
											<option value="3" <?php if($sort=='3'){ echo "selected"; }{} ?>>PELANGGAN</option>
											<option value="4" <?php if($sort=='4'){ echo "selected"; }{} ?>>NOMINAL</option>
                                    		<option value="5" <?php if($sort=='5'){ echo "selected"; }{} ?>>RETUR</option>
                                    		<option value="6" <?php if($sort=='6'){ echo "selected"; }{} ?>>BAYAR</option>
                                    		<option value="7" <?php if($sort=='7'){ echo "selected"; }{} ?>>STATUS BAYAR</option>
										</select>
									</td>
									<td width="25%">
										<select name="urutan" onchange="submit()"  class="form-control">
                                        	<option></option>
											<option value="1" <?php if($urutan=='1'){ echo "selected"; }{} ?>>KECIL KE BESAR</option>
											<option value="2" <?php if($urutan=='2'){ echo "selected"; }{} ?>>BESAR KE KECIL</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
                    </form>
					</td>
					<td width="10%" align="right">
					<a href="utama.php?<?=paramEncrypt('nmenu=L1L0&tmenu=data pembayaran penjualan tahun '.$tahun.'&mod=pembayaran&jenis=penjualan&act=view-daftar-penjualan&tahun='.$tahun.'&stahun='.$stahun)?>"><button style="z-index:2" class="btn btn-success md-refresh-white" type="button" title="Refresh">&nbsp;&nbsp;&nbsp;&nbsp;</button></a>
					<a href="utama.php?<?=paramEncrypt('nmenu=L1L0&tmenu=data pembayaran penjualan tahun '.$tahun.'&mod=pembayaran&jenis=penjualan&act=view-daftar-pembayaran&tahun='.$tahun.'&stahun='.$stahun)?>"><button style="z-index:2" class="btn btn-success md-arrow-back-white" type="button" title="Kembali Ke Histori Pembayaran">&nbsp;&nbsp;&nbsp;&nbsp;</button></a>
                    </td>
				</tr>
			</table>
			<div style="margin-top:12px;margin-bottom:12px;"></div>
			<table class="table table-bordered table-hover">
				<thead>
				<tr class="info">
					<th width="5%"><div align="center">NO.</div></th>
					<th width="15%"><div align="center">NO. BUKTI</div></th>
					<th width="10%"><div align="center">TANGGAL</div></th>
					<th width="15%"><div align="center">PELANGGAN</div></th>
					<th width="10%"><div align="center">NOMINAL</div></th>
					<th width="10%"><div align="center">RETUR</div></th>
					<th width="10%"><div align="center">BAYAR</div></th>
					<th width="10%"><div align="center">S.BAYAR</div></th>
					<th width="10%"><div align="center">DIBUAT OLEH</div></th>
					<th width="5%"><div align="center">AKSI</div></th>
				</tr>
				</thead>
				<tbody>
            <?php
				$p      = new Paging;
				$batas  = 10;
				if(isset($_POST['show'])){
					$show = $_POST['show'];
				}else{
					$show = $_GET['show'];
				}
			    if(isset($show) && is_numeric($show)){
					$batas = $show;
					$linkaksi .="&show=$show";
				}
				$posisi = $p->cariPosisi($batas);
				$query = "SELECT * FROM $db_tr_jual WHERE tahun = '$tahun'";
				$q 	= "SELECT * FROM $db_tr_jual WHERE tahun = '$tahun'";
				if($tglaw<>'' or $tglak<>''){
					$query .= " AND (tanggal BETWEEN '".baliktgl($tglaw)."' AND '".baliktgl($tglak)."')";
					$q .= " AND (tanggal BETWEEN '".$tglaw."' AND '".$tglak."')";
				}
				if($pelanggan<>''){
					$query .= " AND pelanggan = '".$pelanggan."'";
					$q .= " OR pelanggan = '".$pelanggan."'";
				}
				if($nok<>''){
					$query .= " AND nok like '%".$nok."%'";
					$q .= " AND nok like '%".$nok."%'";
				}
				if($sort<>''){
					$fld = array('', 'nok', 'tanggal', 'pelanggan', '', '', '');
					if(is_numeric($sort)){
						$indx = (int)$sort;	
					}else{
						$indx = 1;
					}
					$fld1 = array('', 'ASC', 'DESC');
					if(is_numeric($urutan)){
						$indx1 = (int)$urutan;	
					}else{
						$indx1 = 1;
					}
					$query .= " ORDER BY $fld[$indx] $fld1[$indx1] LIMIT $posisi, $batas";
					$q 	.= " ORDER BY $fld[$indx] $fld1[$indx1]";
				}else{
					$query .= " ORDER BY tanggal ASC LIMIT $posisi, $batas";
					$q 	.= " ORDER BY tanggal ASC";
				}
				$sql_kel = mysql_query($query) or die(mysql_error());
				$fd_kel = mysql_num_rows($sql_kel);
				if($fd_kel > 0){
					$no = $posisi + 1;
					while ($m = mysql_fetch_assoc($sql_kel)) {
						if(gtjualnok($m['nok'])-trjualnok($m['nok'])-tpjualnok($m['nok'])==0){
							$statusb	= "LUNAS";
						}else{
							$statusb	= "LUNAS";
						}
						echo"<tr>
							<td>$no</td>
							<td>$m[nok]</td>
							<td align='center'>".baliktglindo($m['tanggal'])."</td>
							<td>".pelanggan($m['pelanggan'])."</td>
							<td align='right'>".minuss(gtjualnok($m['nok']))."</td>
							<td align='right'>".minuss(trjualnok($m['nok']))."</td>
							<td align='right'>".minuss(tpjualnok($m['nok']))."</td>
							<td align='right'>".$statusb."</td>
							<td>".nama_petugas($m['user'])."</td>
							<td align='center'>";
								$aksi2	= "popup/popup.php?".paramEncrypt('mod=faktur_penjualan&db='.$db_beli.'&dbd='.$db_belid.'&nok='.$m['nok'].'&user='.$login_id);
								if(isset($_SESSION['bpenjualan']) AND $_SESSION['bpenjualan'] <> 'TRUE'){
								echo "
									<i class='fa fa-credit-card'></i>";
								}else{
								echo "
									<a href='utama.php?".paramEncrypt('nmenu=L1L0&tmenu=data pembayaran penjualan tahun '.$tahun.'&mod=pembayaran&jenis=penjualan&act=form-pembayaran&tahun='.$tahun.'&stahun='.$stahun.'&nok='.$m['nok'])."'  onclick=\"return confirm('Apakah Anda Akan Melakukan Pembayaran Penjualan No. Invoice : $m[nok]');\">
									<button type='submit' class='btn btn-info' title='Pembayaran Penjualan'>BAYAR</button></a>";
								}
							echo "
							</td>
						</tr>";
						$no++;
					}
					$jmldata = mysql_num_rows(mysql_query($q));
					$jmlhalaman  = $p->jumlahHalaman($jmldata, $batas);
		    		$linkHalaman = $p->navHalaman($_GET['halaman'], $jmlhalaman, $linkaksi);
				}else{
					echo"<tr>
						<td colspan='10' align='center'><i>Data Penjualan Not found.</i></td>
					</tr>";
				} ?>
				</tbody>
			</table>
			<div>
                <div class="col-sm-2">
                    <form action="" method="POST">
                    <div class="btn-group">
                        <select name="show" onchange="submit()" class="form-control">
                        <option value="">- Show -</option>
                        <?php
                        $i=10;
                        while($i <= 100){
                            if(isset($_POST['show']) AND (int)$_POST['show'] == $i){
                                echo"<option value='$i' selected>$i</option>";	
                            }else{
                                echo"<option value='$i'>$i</option>";
                            }
                            $i+=10;
                        }
                        ?>
                        </select>
                    </div>
                    </form>
                </div>
				<div align="right" class="col-sm-10">
					<ul class="pagination shadowed" style="margin:0">
						<?=$linkHalaman?>
					</ul>
				</div>
			</div>


Output:
			<table width="100%">
				<tr>
					<td width="90%">
                    <form class='w3-tiny' name="proses" action='' method='POST'>	
						<div class="col-lg-6">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="23%">PERIODE</td>
									<td width="2%">:</td>
									<td width="35%"><input type="text"  name="tglaw" class="form-control datepicker" value="" autocomplete="off"></td>
									<td width="5%">S/D</td>
									<td width="35%"><input type="text"  name="tglak" class="form-control datepicker" value="" autocomplete="off"></td>
								</tr>
							</table>
						</div>
						<div class="col-lg-6">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="23%">PELANGGAN</td>
									<td width="2%">:</td>
									<td width="75%">
										<select name='pelanggan' id="pelanggan" class='form-control'>
                                        	<option></option>
                                            
Fatal error: Call to undefined function mysql_query() on line 26


Create a new paste based on this one


Comments: