<?php
	require('../config/dbcon.php');
	if(isset($_POST['show'])){
		?>
		<table class = "table table-bordered alert-warning table-hover" style="font-family:Tahoma, Serif;color:black;">
			<thead>
				<th style = "text-align: left; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Delete</th>
				<th style = "text-align: left; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Part_Number</th>
				<th style = "text-align: left; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Description_one</th>
				<th style = "text-align: left; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Description_two</th>
				<th style = "text-align: left; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Hsn_Code</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Qty</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">List</th>
				<th style = "text-align: left; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Segment</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Disc_Per</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Disc_Amt</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">List_Val</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Rate_One</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Sales_Val</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Sgst_Per</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Sgst_Amt</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Cgst_Per</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Cgst_Amt</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Igst_Per</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Igst_Amt</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Inv_Val</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Cost</th>
				<th style = "text-align: right; background-color:#0066ff; font-size:14px; font-weight:bold; color: white;">Cost_Val</th>				
			</thead>
			<tbody>
				<?php
					$quser=mysqli_query($connect,"select * from invtemp_mst order by partno");
					while($row=mysqli_fetch_array($quser)){
						?>
							<tr>							
								<td><input type="button" style="width:50px; height:25px;" value="Delete" id="delete_<?=$row['partno'];?>" class="btn btn-danger btn-xs delete" data-partno="<?=$row['partno'];?>"/></td>								
								<td style = "text-align: left; color: #000066"><?php echo $row['partno']; ?></td>
								<td style = "text-align: left; color: #000066"><?php echo $row['description_one']; ?></td>
								<td style = "text-align: left; color: #000066"><?php echo $row['description_two']; ?></td>
								<td style = "text-align: left; color: #000066"><?php echo $row['hsn_code']; ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['qty'],0, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['list'],2, '.', ''); ?></td>
								<td style = "text-align: left; color: #000066"><?php echo $row['segment']; ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['disc_per'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['disc_amt'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['list_value'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['rate_one'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['sales_val'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['sgst_per'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['sgst_amt'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['cgst_per'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['cgst_amt'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['igst_per'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['igst_amt'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['inv_val'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['cost'],2, '.', ''); ?></td>
								<td style = "text-align: right; color: #000066"><?php echo number_format($row['cost_val'],2, '.', ''); ?></td>								
							</tr>
						<?php
					}
				?>
			</tbody>
		</table>
		<?php
	}
?>