[ create a new paste ] login | about

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

PHP, pasted on May 6:
			<table class='w3-table w3-striped w3-bordered w3-tiny w3-hoverable tbl'>
				<thead>
					<tr class='w3-yellow'>
						<td rowspan='2' colspan='4'><center><b>DESKRIPSI</b></center></td>
						<td colspan='12' bgcolor='#CC9900'><center><b>STOK</b></center></td>
						<td colspan='4' bgcolor='#CCCC33'><center><b>RETUR</b></center></td>
						<td colspan='2'></td>
					</tr>
					<tr class='w3-yellow'>
						<td colspan='2' bgcolor='#CC9900'><center><b>AWAL</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>MASUK</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>KELUAR</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>O.MASUK</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>O.KELUAR</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>TOTAL</b></center></td>
						<td colspan='2' bgcolor='#CCCC33'><center><b>JUAL</b></center></td>
						<td colspan='2' bgcolor='#CCCC33'><center><b>BELI</b></center></td>
						<td colspan='2'><center><b>SISA</b></center></td>
					</tr>
					<tr class='w3-yellow'>
						<th>NO</th>
						<th>KODE</th>
						<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAMA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
						<th>STN</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CCCC33'>BT</th>
						<th bgcolor='#CCCC33'>TON</th>
						<th bgcolor='#CCCC33'>BT</th>
						<th bgcolor='#CCCC33'>TON</th>
						<th>BT</th>
						<th>TON</th>
					</tr>
				</thead>
				<tbody>";

				$p      = new Paging;
				$batas  = 10;
			    if(isset($_GET['show']) && is_numeric($_GET['show'])){
					$batas = (int)$_GET['show'];
					$linkaksi .="&show=$_GET[show]";
				}
				$posisi = $p->cariPosisi($batas);
				$query = "SELECT * FROM db_barang ";
				$q 	= "SELECT * FROM db_barang";

				if(!empty($_GET['field'])){
					$hideinp = "<input type='hidden' name='field' value='$_GET[field]'>
								<input type='hidden' name='cari' value='$_GET[cari]'>";
					$linkaksi .= "&field=$_GET[field]&cari=$_GET[cari]";
					$query .= " WHERE $_GET[field] LIKE '%$_GET[cari]%'";
					$q .= " WHERE $_GET[field] LIKE '%$_GET[cari]%'";
				}
				$query .= " ORDER BY nama ASC LIMIT $posisi, $batas";
				$q 	.= " ";
				$sql_kul = mysql_query($query);
				$fd_kul = mysql_num_rows($sql_kul);
				if($fd_kul > 0){
					$no = $posisi + 1;
					$tsa_ton = $tsk_ton = $tom_ton = $tok_ton = $tts_ton = $trj_ton = $trb_ton = $ts_ton = 0;
					$tsm_ton = 0;
					session_start();
					$_SESSION['ttsm_ton'] = $tsm_ton;
					$ttsm_ton = $_SESSION['ttsm_ton'];
					for($a=1;$a<=$fd_kul;$a++){
						$m = mysql_fetch_assoc($sql_kul);
						$stok_masuk	= stok_masuk($m['kode']);
						$stok_keluar= stok_keluar($m['kode']);
						$retur_jual = stok_retur_jual($m['kode']);
						$retur_beli = stok_retur_beli($m['kode']);
						$op_masuk 	= stok_op_masuk($m['kode']);
						$op_keluar 	= stok_op_keluar($m['kode']);
						$total_stok = ($m['stok_awal'] + $stok_masuk + $op_masuk) - ($stok_keluar + $op_keluar);
						$sisa 		= ($total_stok + $retur_jual) - $retur_beli;
						$sa_ton		= $m['stok_awal']/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$sm_ton		= $stok_masuk/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$sk_ton		= $stok_keluar/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$om_ton		= $op_masuk/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$ok_ton		= $op_keluar/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$ts_ton		= $total_stok/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$rj_ton		= $retur_jual/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$rb_ton		= $retur_beli/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$s_ton		= $sisa/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$tsa_ton	= $tsa_ton + $sa_ton;
						$tsm_ton	= $tsm_ton + $sm_ton;
						$tsk_ton	= $tsk_ton + $sk_ton;
						$tom_ton	= $tom_ton + $om_ton;
						$tok_ton	= $tok_ton + $ok_ton;
						$tts_ton	= $tts_ton + $ts_ton;
						$trj_ton	= $trj_ton + $rj_ton;
						$trb_ton	= $trb_ton + $rb_ton;
						$ts_ton		= $ts_ton + $s_ton;
						echo"<tr>
							<td>$no</td>
							<td>$m[kode]</td>
							<td>$m[nama] UK. $m[t] x $m[l] x $m[p]</td>
							<td>$m[satuan]</td>
							<td><div align='right'>".number_format($m['stok_awal'])."</div></td>
							<td><div align='right'>".number_format($sa_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_masuk)."</div></td>
							<td><div align='right'>".number_format($sm_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_keluar)."</div></td>
							<td><div align='right'>".number_format($sk_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_masuk)."</div></td>
							<td><div align='right'>".number_format($om_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_keluar)."</div></td>
							<td><div align='right'>".number_format($ok_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($total_stok)."</div></td>
							<td><div align='right'>".number_format($ts_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_jual)."</div></td>
							<td><div align='right'>".number_format($rj_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_beli)."</div></td>
							<td><div align='right'>".number_format($rb_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($sisa)."</div></td>
							<td><div align='right'>".number_format($s_ton,4,'.',',')."</div></td>	
						</tr>";
						$no++;
					}
						echo"
						<tr>
						$ttsm_ton
							<td colspan='4'>TOTAL</td>
							<td><div align='right'>".number_format($m['stok_awal'])."</div></td>
							<td><div align='right'>".number_format($ttsa_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_masuk)."</div></td>
							<td><div align='right'>".number_format($tsm_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_keluar)."</div></td>
							<td><div align='right'>".number_format($tsk_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_masuk)."</div></td>
							<td><div align='right'>".number_format($tom_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_keluar)."</div></td>
							<td><div align='right'>".number_format($tok_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($total_stok)."</div></td>
							<td><div align='right'>".number_format($tts_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_jual)."</div></td>
							<td><div align='right'>".number_format($trj_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_beli)."</div></td>
							<td><div align='right'>".number_format($trb_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($sisa)."</div></td>
							<td><div align='right'>".number_format($ts_ton,4,'.',',')."</div></td>	
						</tr>";
					
					$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'><div class='w3-center'><i>Data Barang Not Found.</i></div></td>
					</tr>";
				}
				echo"
				</tbody>
			</table>


Output:
			<table class='w3-table w3-striped w3-bordered w3-tiny w3-hoverable tbl'>
				<thead>
					<tr class='w3-yellow'>
						<td rowspan='2' colspan='4'><center><b>DESKRIPSI</b></center></td>
						<td colspan='12' bgcolor='#CC9900'><center><b>STOK</b></center></td>
						<td colspan='4' bgcolor='#CCCC33'><center><b>RETUR</b></center></td>
						<td colspan='2'></td>
					</tr>
					<tr class='w3-yellow'>
						<td colspan='2' bgcolor='#CC9900'><center><b>AWAL</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>MASUK</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>KELUAR</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>O.MASUK</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>O.KELUAR</b></center></td>
						<td colspan='2' bgcolor='#CC9900'><center><b>TOTAL</b></center></td>
						<td colspan='2' bgcolor='#CCCC33'><center><b>JUAL</b></center></td>
						<td colspan='2' bgcolor='#CCCC33'><center><b>BELI</b></center></td>
						<td colspan='2'><center><b>SISA</b></center></td>
					</tr>
					<tr class='w3-yellow'>
						<th>NO</th>
						<th>KODE</th>
						<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAMA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
						<th>STN</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CC9900'>BT</th>
						<th bgcolor='#CC9900'>TON</th>
						<th bgcolor='#CCCC33'>BT</th>
						<th bgcolor='#CCCC33'>TON</th>
						<th bgcolor='#CCCC33'>BT</th>
						<th bgcolor='#CCCC33'>TON</th>
						<th>BT</th>
						<th>TON</th>
					</tr>
				</thead>
				<tbody>";

				$p      = new Paging;
				$batas  = 10;
			    if(isset($_GET['show']) && is_numeric($_GET['show'])){
					$batas = (int)$_GET['show'];
					$linkaksi .="&show=$_GET[show]";
				}
				$posisi = $p->cariPosisi($batas);
				$query = "SELECT * FROM db_barang ";
				$q 	= "SELECT * FROM db_barang";

				if(!empty($_GET['field'])){
					$hideinp = "<input type='hidden' name='field' value='$_GET[field]'>
								<input type='hidden' name='cari' value='$_GET[cari]'>";
					$linkaksi .= "&field=$_GET[field]&cari=$_GET[cari]";
					$query .= " WHERE $_GET[field] LIKE '%$_GET[cari]%'";
					$q .= " WHERE $_GET[field] LIKE '%$_GET[cari]%'";
				}
				$query .= " ORDER BY nama ASC LIMIT $posisi, $batas";
				$q 	.= " ";
				$sql_kul = mysql_query($query);
				$fd_kul = mysql_num_rows($sql_kul);
				if($fd_kul > 0){
					$no = $posisi + 1;
					$tsa_ton = $tsk_ton = $tom_ton = $tok_ton = $tts_ton = $trj_ton = $trb_ton = $ts_ton = 0;
					$tsm_ton = 0;
					session_start();
					$_SESSION['ttsm_ton'] = $tsm_ton;
					$ttsm_ton = $_SESSION['ttsm_ton'];
					for($a=1;$a<=$fd_kul;$a++){
						$m = mysql_fetch_assoc($sql_kul);
						$stok_masuk	= stok_masuk($m['kode']);
						$stok_keluar= stok_keluar($m['kode']);
						$retur_jual = stok_retur_jual($m['kode']);
						$retur_beli = stok_retur_beli($m['kode']);
						$op_masuk 	= stok_op_masuk($m['kode']);
						$op_keluar 	= stok_op_keluar($m['kode']);
						$total_stok = ($m['stok_awal'] + $stok_masuk + $op_masuk) - ($stok_keluar + $op_keluar);
						$sisa 		= ($total_stok + $retur_jual) - $retur_beli;
						$sa_ton		= $m['stok_awal']/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$sm_ton		= $stok_masuk/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$sk_ton		= $stok_keluar/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$om_ton		= $op_masuk/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$ok_ton		= $op_keluar/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$ts_ton		= $total_stok/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$rj_ton		= $retur_jual/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$rb_ton		= $retur_beli/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$s_ton		= $sisa/($m['nilai']/($m['p']*$m['l']*$m['t']));
						$tsa_ton	= $tsa_ton + $sa_ton;
						$tsm_ton	= $tsm_ton + $sm_ton;
						$tsk_ton	= $tsk_ton + $sk_ton;
						$tom_ton	= $tom_ton + $om_ton;
						$tok_ton	= $tok_ton + $ok_ton;
						$tts_ton	= $tts_ton + $ts_ton;
						$trj_ton	= $trj_ton + $rj_ton;
						$trb_ton	= $trb_ton + $rb_ton;
						$ts_ton		= $ts_ton + $s_ton;
						echo"<tr>
							<td>$no</td>
							<td>$m[kode]</td>
							<td>$m[nama] UK. $m[t] x $m[l] x $m[p]</td>
							<td>$m[satuan]</td>
							<td><div align='right'>".number_format($m['stok_awal'])."</div></td>
							<td><div align='right'>".number_format($sa_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_masuk)."</div></td>
							<td><div align='right'>".number_format($sm_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_keluar)."</div></td>
							<td><div align='right'>".number_format($sk_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_masuk)."</div></td>
							<td><div align='right'>".number_format($om_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_keluar)."</div></td>
							<td><div align='right'>".number_format($ok_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($total_stok)."</div></td>
							<td><div align='right'>".number_format($ts_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_jual)."</div></td>
							<td><div align='right'>".number_format($rj_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_beli)."</div></td>
							<td><div align='right'>".number_format($rb_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($sisa)."</div></td>
							<td><div align='right'>".number_format($s_ton,4,'.',',')."</div></td>	
						</tr>";
						$no++;
					}
						echo"
						<tr>
						$ttsm_ton
							<td colspan='4'>TOTAL</td>
							<td><div align='right'>".number_format($m['stok_awal'])."</div></td>
							<td><div align='right'>".number_format($ttsa_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_masuk)."</div></td>
							<td><div align='right'>".number_format($tsm_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($stok_keluar)."</div></td>
							<td><div align='right'>".number_format($tsk_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_masuk)."</div></td>
							<td><div align='right'>".number_format($tom_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($op_keluar)."</div></td>
							<td><div align='right'>".number_format($tok_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($total_stok)."</div></td>
							<td><div align='right'>".number_format($tts_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_jual)."</div></td>
							<td><div align='right'>".number_format($trj_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($retur_beli)."</div></td>
							<td><div align='right'>".number_format($trb_ton,4,'.',',')."</div></td>	
							<td><div align='right'>".number_format($sisa)."</div></td>
							<td><div align='right'>".number_format($ts_ton,4,'.',',')."</div></td>	
						</tr>";
					
					$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'><div class='w3-center'><i>Data Barang Not Found.</i></div></td>
					</tr>";
				}
				echo"
				</tbody>
			</table>


Create a new paste based on this one


Comments: