<?php
ini_set('display_errors',1);
session_start();

include('script/condb.php');
$PID=$_GET['zd'];

$sql= "SELECT blocktype from wall_calculation where PID='PROJECT252' ";
$result =mysqli_query($con,$sql);
if($result){
while($data =mysqli_fetch_array($result)){
    echo $data[0].'<br>';
	
	
//echo $result;
}}

$sqba= "SELECT * FROM basetypecal where PID='PROJECT225' ";
	$resultb3 =mysqli_query($con, $sqba);
 	while($rowsba=mysqli_fetch_array($resultb3)){
	
	$steelname=$rowsba['bartype'];
	$c64= $rowsba['Numb'];  //16
	$B64=$rowsba['barnum'] ; //14bar number from column base form
	$H19 = $rowsba['barheight']; //0.15height of column base}
	
		echo $steelname;
	
	}

$sqlsu="SELECT SUM(CETotalAmount) FROM foundation_materials WHERE PID='PROJECT225'";
$resultbat =mysqli_query($con, $sqlsu);
//if($resultbat){
while($row21=mysqli_fetch_array($resultbat)){
 $sum = $row21['SUM(CETotalAmount)'];
	$subt =0.05 *$sum;
	echo $sum.'<br>';
	echo $subt .'<br>';
}//}

$sqlsu2="SELECT SUM(COETotal) FROM foundation_labourer WHERE PID='PROJECT225'";
$resultbat2 =mysqli_query($con, $sqlsu2);
//if($resultbat){
while($row22=mysqli_fetch_array($resultbat2)){
 $sum2 = round($row22['SUM(COETotal)'],2);
	$subt2 =0.05 *$sum;
	$tot=$sum2 +$subt2;
	echo $sum2.'<br>';
	echo $tot;
}//}

$sqlsu3="SELECT * FROM upline_app_laboursettings WHERE ID='3'";
$resultbat4 =mysqli_query($con, $sqlsu3);
//if($resultbat){
while($row88=mysqli_fetch_array($resultbat4)){
 $sum3 = $row88['labourer_price'];
	$labourname='Basket Excavation';
	$subt3 =0.05 *$sum3;
	$tot3=30 +$sum3;
	echo $sum3.'<br>';
	echo $tot3.'<br>';
	echo $labourname;
}//}

/*$sqlmin= "SELECT * FROM upline_app_laboursettings where labour_ID='3'";
	$resultmin=mysqli_query($con, $sqlmin);
while($rowsix=mysqli_fetch_array($resultmin)){
	$labourprice=$rowsix['labourer_price'];  $labourname='Basket Excavation'; $total=30*$labourprice;

echo $labourprice .'<br>';
	echo $total;
} */
	
	/*$sqlmi= "SELECT * FROM upline_app_laboursettings where labour_ID='4'";
	$resultmi =mysqli_query($con, $sqlmi);
while($rowsi =mysqli_fetch_array($resultmi)){
	$labourprice2=$rowsi['labourer_price'];  $labour_name2=$rowsi['labourer_name'];  }
	$total12=2*$labourprice;
	*/

//$materialsum= 0;
/*$res =$con->query($sumt);
$resultbat =mysqli_query($con, $sumt);
$total = 0;
$rec= $res->fetch_assoc();
$total= $rec['total']; 
while($num = mysqli_fetch_assoc($resultbat)){
	$materialsum +=$rowba['CETotalAmount'];
	
	 echo $materialsum;
}*/

if(isset($_POST['check12'])){
	
	$planktype=$_POST['plakname'];
$planktype2=$_POST['planktype2'];	
	
$sql31= "SELECT * FROM columnbased where pid='$PID'";
$result31 =mysqli_query($con, $sql31);
while($rows31 =mysqli_fetch_array($result31)){
	$areaofplank =$rows31['areaofplank'];
	$columnbase1 =$rows31['columnbase1']; }

	
	echo $planktype.'<br>';
	echo $planktype2. '<br>';
	echo $areaofplank. '<br>';
	echo $columnbase1;
}

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>

	</body>
</html>