<?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>
						
			</thead>
			<tbody>
				<?php
					$query=mysqli_query($connect,"Select sum(disc_amt) as disctotal,sum(list_value) as listtotal,sum(sales_val)as salestotal,sum(sgst_amt) as sgsttotal,sum(cgst_amt)as cgsttotal,sum(igst_amt) as igsttotal,sum(inv_val) as invtotal, sum(qty) as total_qty, sum(cost_val) as total_cost from pinvtemp_mst");
					while($row=mysqli_fetch_array($query)){
						$val = $row["invtotal"];
						$actualamount = number_format($val, 2, '.', '');
						$totamount = number_format($val, 0, '.', '');
						$roff = number_format($totamount - $actualamount, 2, '.', '');
						?>
						<tr>                           
    						<td style="vertical-align: middle;" class="text-right"><strong>List_Value</strong></td>
    						<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_list_value" value=<?php echo number_format($row["listtotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Discount_Value</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_disc_amt" value=<?php echo number_format($row["disctotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Sales_Value</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_sales_val" value=<?php echo number_format($row["salestotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Sgst_Value</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_sgstamt" value=<?php echo number_format($row["sgsttotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Cgst_Value</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_cgstamt" value=<?php echo number_format($row["cgsttotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Igst_Value</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_igstamt" value=<?php echo number_format($row["igsttotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Total</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_val" value=<?php echo number_format($row["invtotal"],2, '.', ''); ?> type="text"></td>
						</tr>
						<tr>                           
							<td  style="vertical-align: middle;" class="text-right"><strong>Round_Off</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="roundoff" value=<?php echo number_format($roff,2, '.', ''); ?> type="text"></td>
							<!--td style = "height:20px;"><input  class="form-control" readonly style = "font-size:22px; font-weight:bold; color: #000066; height:25px; text-align: right" id="roundoff" onfocus="this.select();" type="text" value=<?php echo $roff; ?>></td-->
						</tr>
						<tr>
							<td  style="vertical-align: middle;" class="text-right"><strong>Invoice_Value</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_inv_val" value=<?php echo number_format($row["invtotal"],0, '.', ''); ?> type="text"></td>
							<!--td style = "height:25px;"><input  class="form-control" readonly style = "font-size:22px; font-weight:bold; color: #000066; height:25px; text-align: right" id="total_inv_val" onfocus="this.select();" type="text" autofocus onfocus="convertNumberToWords()" value=<?php echo number_format($row["invtotal"],0, '.', ''); ?>></td-->
						</tr>
						<tr>
							<td  style="vertical-align: middle;" class="text-right"><strong>Total_Qty</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_qty" value=<?php echo number_format($row["total_qty"],0, '.', ''); ?> type="text"></td>
							<!--td style = "height:20px;"><input  class="form-control" readonly style = "font-size:22px; font-weight:bold; color: #000066; height:25px; text-align: right" id="total_qty" onfocus="this.select();" type="text" autofocus onfocus="convertNumberToWords()" value=<?php echo number_format($row["total_qty"],0, '.', ''); ?>></td-->
						</tr>
						<tr style="display: none;">
							<td  style="vertical-align: middle;" class="text-right"><strong>Total_Cost</strong></td>
							<td style="height:20px;"><input class="roundedCategory" readonly style = "font-size:22px; width : 200px; font-weight:bold; color: #000066; height:25px; text-align: right;" onfocus="this.select();" id="total_cost" value=<?php echo number_format($row["total_cost"],2, '.', ''); ?> type="text"></td>
							<!--td style = "height:25px;"><input  class="form-control" readonly style = "font-size:22px; font-weight:bold; color: #000066; height:25px; text-align: right" id="total_cost" onfocus="this.select();" type="text" autofocus onfocus="convertNumberToWords()" value=<?php echo number_format($row["total_cost"],2, '.', ''); ?>></td-->
						</tr>
						<?php
					}
				?>
			</tbody>
		</table>
		<?php
	}
?>