[ create a new paste ] login | about

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

PHP, pasted on Jan 21:
				<div class='w3-col s7 w3-card'>Keranjang Penjualan
				<div style='border-bottom:1px dashed #ccc;'></div>
				<font color='red'><b>Nilai Tonase : ".number_format($n_ton,4,'.',',')."";
				if($n_ton>=0.5){
					echo " Masukan Harga Ton";
				}elseif($n_ton<0.5){
					echo " Masukan Harga Inchi";
				}
				echo "
				</b></font>
				<table class='w3-table w3-tiny w3-hoverable tbl'>
						<tr class='w3-blue'>
							<th width='5%'>#</th>
							<th width='35%'>DESKRIPSI</th>
							<th width='10%'>BTG</th>";
							if($n_ton>=0.5){
								echo "
								<th width='10%'>TON</th>
								<th width='20%'>HARGA</th>
								<th width='18%'>T.HARGA</th>";
							}elseif($n_ton<0.5){
								echo "
								<th width='10%'></th>
								<th width='18%'>HARGA</th>
								<th width='20%'>T.HARGA</th>";								
							}
							echo "
							<th width='2%'>&nbsp;</th>
						</tr>
						<tbody>
						<form action='$aksi?mod=penjualan&act=simpan' method='POST' class='w3-container'>
						";
						$sql_tmp = mysql_query("SELECT a.kode_barang, a.qty, a.harga, b.nama, b.p, b.l, b.t, b.nilai, a.ton 
												FROM db_detail_penjualan_tmp a, db_barang b
												WHERE a.kode_barang = b.kode AND a.jfaktur = '$_GET[jfaktur]' AND a.user = '$_SESSION[login_id]' 
												ORDER BY a.date ASC") or die(mysql_error());
						$no = 1;
						$t_qty = $t_ton = 0;
						$jsql_temp = mysql_num_rows($sql_tmp);
						if($jsql_temp > 0){
							while($b = mysql_fetch_assoc($sql_tmp)) {
								$t_ton	= $t_ton + $b['ton'];
								$t_qty	= $t_qty + $b['qty'];
								echo"<tr style='border-bottom:1px dashed #ccc;'>
									<td>$no</td>
									<td>$b[nama]</br>UK. $b[p] x $b[l] x $b[t]</td>
									<td><input type='text' name='qty[]' id='qty$no' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($b['qty'])."' readonly></td>";
									if($n_ton>=0.5){
										echo "
										<td><input type='text' name='ton[]' id='ton$no' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($b['ton'],4,'.',',')."' readonly><div align='right'></td>
										<td><input type='text' name='harga[]' id='harga$no' class='w3-select w3-border w3-hover-grey w3-right-align' value='0' onkeyup=penjualanB('ton$no','harga$no','tharga$no')></td>
										<td><input type='text' name='tharga[]' id='tharga$no' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";
									}elseif($n_ton<0.5){
										echo "
										<td></td>
										<td><input type='text' name='harga[]' id='harga$no' class='w3-select w3-border w3-hover-grey w3-right-align kanan' value='0' onkeyup=penjualanA('qty$no','harga$no','tharga$no')></td>
										<td><input type='text' name='tharga[]' id='tharga$no' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";								
									}
									echo "
									<td><div align='right'><a href='$aksi?mod=penjualan&act=batal&id=$b[kode_barang]' onclick=\"return confirm('Yakin ingin membatalkan?');\"><i class='fa fa-close w3-tiny w3-text-red'></i></a></div></td>
								</tr>";
								$no++;
							}
						}else{
							echo"<tr>
								<td colspan='4'><center><i>Keranjang Kosong</i></center></td>
							</tr>";
						}
						echo"</tbody>
						<tfoot>
						<tr>
							<td colspan='2'><b>TOTAL</b></td>
							<td><input type='text' name='gqty' id='gqty' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($t_qty)."' readonly></td>";
							if($n_ton>=0.5){
								echo "
								<td><input type='text' name='gton' id='gton' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($t_ton,4,'.',',')."' readonly></td>
								<td><input type='text' name='gharga' id='gharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>
								<td><input type='text' name='gtharga' id='gtharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";
							}elseif($n_ton<0.5){
								echo "
								<td></td>
								<td><input type='text' name='gharga' id='gharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>
								<td><input type='text' name='gtharga' id='gtharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";								
							}
						echo "
						</tr>
						<tr>
							<td colspan='5'><b>POTONGAN HARGA (Rp.)<b></td>
							<td><input type='text' name='potongan' id='potongan' class='w3-select w3-border w3-hover-grey w3-right-align' value='0'></td>
						</tr>
						<tr style='border-top:1px dashed #ccc;'>
							<td colspan='4'><b class='w3-text-blue'>TOTAL BAYAR</b><td>
							<td><input type='text' name='tot' id='tot' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>
						</tr>
						</tfoot>
					</table><hr>
					<div class='w3-card-2 w3-light-blue'>
							<input type='hidden' name='potongan2' id='potongan2' value='0'>
							<input type='hidden' name='total' id='total' value='"?><?php echo isset($total_harga) ? $total_harga : 0; ?><?php echo"'>
							<input type='hidden' name='jmlbayar2' id='bayar2'>
							<label class='w3-label w3-text-black'>Nama Pelanggan :</label>
							<input type='text' name='nama' id='nama' class='w3-input w3-tiny w3-border-0' required>
							<label class='w3-label w3-text-black'>Bayar (Rp):</label>
							<input type='text' name='jmlbayar' id='bayar' class='w3-input w3-tiny w3-border-0' required>
							<label class='w3-label w3-text-black'>Status Pembayaran:</label>
							<div class='w3-row'>
								<div class='w3-col s6'>
									<input type='radio' class='w3-radio' name='status' value='LUNAS' checked>
									<label class='w3-validate'>LUNAS</label>
								</div>
								<div class='w3-col s6'>
									<input type='radio' class='w3-radio' name='status' value='HUTANG'>
									<label class='w3-validate'>HUTANG</label>
								</div>
							</div>
							<p><button class='w3-btn w3-green' onclick=\"return confirm('Klik OK untuk melanjutkan');\"><i class='fa fa-save'></i> Simpan Transaksi</button></p>
						</form>
					</div><br>";


Output:
				<div class='w3-col s7 w3-card'>Keranjang Penjualan
				<div style='border-bottom:1px dashed #ccc;'></div>
				<font color='red'><b>Nilai Tonase : ".number_format($n_ton,4,'.',',')."";
				if($n_ton>=0.5){
					echo " Masukan Harga Ton";
				}elseif($n_ton<0.5){
					echo " Masukan Harga Inchi";
				}
				echo "
				</b></font>
				<table class='w3-table w3-tiny w3-hoverable tbl'>
						<tr class='w3-blue'>
							<th width='5%'>#</th>
							<th width='35%'>DESKRIPSI</th>
							<th width='10%'>BTG</th>";
							if($n_ton>=0.5){
								echo "
								<th width='10%'>TON</th>
								<th width='20%'>HARGA</th>
								<th width='18%'>T.HARGA</th>";
							}elseif($n_ton<0.5){
								echo "
								<th width='10%'></th>
								<th width='18%'>HARGA</th>
								<th width='20%'>T.HARGA</th>";								
							}
							echo "
							<th width='2%'>&nbsp;</th>
						</tr>
						<tbody>
						<form action='$aksi?mod=penjualan&act=simpan' method='POST' class='w3-container'>
						";
						$sql_tmp = mysql_query("SELECT a.kode_barang, a.qty, a.harga, b.nama, b.p, b.l, b.t, b.nilai, a.ton 
												FROM db_detail_penjualan_tmp a, db_barang b
												WHERE a.kode_barang = b.kode AND a.jfaktur = '$_GET[jfaktur]' AND a.user = '$_SESSION[login_id]' 
												ORDER BY a.date ASC") or die(mysql_error());
						$no = 1;
						$t_qty = $t_ton = 0;
						$jsql_temp = mysql_num_rows($sql_tmp);
						if($jsql_temp > 0){
							while($b = mysql_fetch_assoc($sql_tmp)) {
								$t_ton	= $t_ton + $b['ton'];
								$t_qty	= $t_qty + $b['qty'];
								echo"<tr style='border-bottom:1px dashed #ccc;'>
									<td>$no</td>
									<td>$b[nama]</br>UK. $b[p] x $b[l] x $b[t]</td>
									<td><input type='text' name='qty[]' id='qty$no' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($b['qty'])."' readonly></td>";
									if($n_ton>=0.5){
										echo "
										<td><input type='text' name='ton[]' id='ton$no' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($b['ton'],4,'.',',')."' readonly><div align='right'></td>
										<td><input type='text' name='harga[]' id='harga$no' class='w3-select w3-border w3-hover-grey w3-right-align' value='0' onkeyup=penjualanB('ton$no','harga$no','tharga$no')></td>
										<td><input type='text' name='tharga[]' id='tharga$no' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";
									}elseif($n_ton<0.5){
										echo "
										<td></td>
										<td><input type='text' name='harga[]' id='harga$no' class='w3-select w3-border w3-hover-grey w3-right-align kanan' value='0' onkeyup=penjualanA('qty$no','harga$no','tharga$no')></td>
										<td><input type='text' name='tharga[]' id='tharga$no' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";								
									}
									echo "
									<td><div align='right'><a href='$aksi?mod=penjualan&act=batal&id=$b[kode_barang]' onclick=\"return confirm('Yakin ingin membatalkan?');\"><i class='fa fa-close w3-tiny w3-text-red'></i></a></div></td>
								</tr>";
								$no++;
							}
						}else{
							echo"<tr>
								<td colspan='4'><center><i>Keranjang Kosong</i></center></td>
							</tr>";
						}
						echo"</tbody>
						<tfoot>
						<tr>
							<td colspan='2'><b>TOTAL</b></td>
							<td><input type='text' name='gqty' id='gqty' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($t_qty)."' readonly></td>";
							if($n_ton>=0.5){
								echo "
								<td><input type='text' name='gton' id='gton' class='w3-select w3-border w3-light-grey w3-right-align' value='".number_format($t_ton,4,'.',',')."' readonly></td>
								<td><input type='text' name='gharga' id='gharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>
								<td><input type='text' name='gtharga' id='gtharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";
							}elseif($n_ton<0.5){
								echo "
								<td></td>
								<td><input type='text' name='gharga' id='gharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>
								<td><input type='text' name='gtharga' id='gtharga' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>";								
							}
						echo "
						</tr>
						<tr>
							<td colspan='5'><b>POTONGAN HARGA (Rp.)<b></td>
							<td><input type='text' name='potongan' id='potongan' class='w3-select w3-border w3-hover-grey w3-right-align' value='0'></td>
						</tr>
						<tr style='border-top:1px dashed #ccc;'>
							<td colspan='4'><b class='w3-text-blue'>TOTAL BAYAR</b><td>
							<td><input type='text' name='tot' id='tot' class='w3-select w3-border w3-light-grey w3-right-align' value='0' readonly></td>
						</tr>
						</tfoot>
					</table><hr>
					<div class='w3-card-2 w3-light-blue'>
							<input type='hidden' name='potongan2' id='potongan2' value='0'>
							<input type='hidden' name='total' id='total' value='"?>0'>
							<input type='hidden' name='jmlbayar2' id='bayar2'>
							<label class='w3-label w3-text-black'>Nama Pelanggan :</label>
							<input type='text' name='nama' id='nama' class='w3-input w3-tiny w3-border-0' required>
							<label class='w3-label w3-text-black'>Bayar (Rp):</label>
							<input type='text' name='jmlbayar' id='bayar' class='w3-input w3-tiny w3-border-0' required>
							<label class='w3-label w3-text-black'>Status Pembayaran:</label>
							<div class='w3-row'>
								<div class='w3-col s6'>
									<input type='radio' class='w3-radio' name='status' value='LUNAS' checked>
									<label class='w3-validate'>LUNAS</label>
								</div>
								<div class='w3-col s6'>
									<input type='radio' class='w3-radio' name='status' value='HUTANG'>
									<label class='w3-validate'>HUTANG</label>
								</div>
							</div>
							<p><button class='w3-btn w3-green' onclick="return confirm('Klik OK untuk melanjutkan');"><i class='fa fa-save'></i> Simpan Transaksi</button></p>
						</form>
					</div><br>


Create a new paste based on this one


Comments: