<?php
ini_set('display_errors',1);
session_start();
include('script/condb.php');
$PID=$_GET['zd'];

$sql= "SELECT blocktype from wall_calculation where PID='$PID' ";
$result =mysqli_query($con,$sql);
if($result){
while($data =mysqli_fetch_array($result)){
   // echo $data[0].'<br>';
	
/*if($data=='9 inches Hollow Block'){ //exteral wall
		$sql1= "SELECT * FROM upline_app_blocksettings where Block_name ='9 inches Hollow Block' ";
$result1 =mysqli_query($con, $sql1);
while($rows1 =mysqli_fetch_array($result1)){
	$F8 =0.225; //block length
$H8 =0.40; //block  height
	$G19=0.225;*/ //block width

}	//}
	/* elseif($data=='6 inches Solid Block' || $data=='6 inches Hollow Block'){ //internal wall
	$sql2= "SELECT * FROM upline_app_blocksettings where Block_name ='6 inches Solid Block' ";
$result2 =mysqli_query($con, $sql2);
while($rows1a=mysqli_fetch_array($result2)){
	$F8a =0.225;
$H8a =0.40;
	$G19a=0.1;*/ //block width

//}
	/*}elseif($data=='5 inches Solid Block'){
		$sql3= "SELECT * FROM upline_app_blocksettings where Block_name ='5 inches Solid Block' ";
$result3 =mysqli_query($con, $sql3);
while($rows2 =mysqli_fetch_array($result2)){
	$F8b =$rows2['Block_length'];
$H8b =$rows2['Block_height'];
	$G19b=$rows1['Block_width'];

}*/	//} 
/* elseif($data =='4 inches Hollow Block'){
		$sql4= "SELECT * FROM upline_app_blocksettings where Block_name ='4 inches Hollow Block' ";
$result4 =mysqli_query($con, $sql4);
while($rows3 =mysqli_fetch_array($result2)){
	$F8c =0.225; //block height
$H8c =0.40; //block heigth
	$G19c=0.125;*/ //block width

//}	 }
//echo $result;
}
/*
$sql= "SELECT * FROM upline_app_blocksettings where Block_name ='9 inches Hollow Block' ";
$result =mysqli_query($con, $sql);
while($rows =mysqli_fetch_array($result)){
	$F8 =$rows['Block_length'];
$H8 =$rows['Block_height'];
	$G19=$rows['Block_width'];

}*/
if(isset($_POST['check5'])){
$i8=$_POST['I8'];
$A_15=$_POST['A_15']; //$_POST['A_15'];
	
$F8=0.225; //block length
$H8=0.40;  //block height
$G19=0.1; //block width	
	
$area1 =$F8 * $A_15 * $i8 * 2 ;	
$area2 =$H8 *$A_15 * $i8 *2;
$selected_length= 300*0.001*2;
//$PID= "project-build-497";	
	
$areaofplank =$area1+$area2;
$cubicmeterofconcrete =$H8 * $F8 * $A_15 * $i8;
$lengthofwood=($F8+$selected_length)+(($H8+$selected_length)*$i8);
	
$inst ="INSERT INTO columnbased(pid, areaofplank, cubicmeterofconcrete, lengthofwood,columnbase1, columnbase2)VALUES('$PID', '$areaofplank', '$cubicmeterofconcrete', '$lengthofwood', '', '') ";
	
$checkmate=mysqli_query($con, $inst);
	
	if($checkmate){
		
		 header("Location:stagesofproject.php?id=$PID");
	/*echo 'Area of Plank Value is'.''. ''. $areaofplank .'<br>';
echo 'Cubic meter of concrete Value is' .''. ''. $cubicmeterofconcrete .'<br>';
echo 'Length of wood Value is' .''. ''. $lengthofwood .'<br>';
	
echo '-------------------------------------------' .'<br>';*/
}
}//}

if(isset($_POST['check10'])){
	
$A17=$_POST['A_17'];
$A21=$_POST['A_21'];	
$A19=$_POST['A_19'];
$bartype =$_POST['bartype'];
$banum =$_POST['banum'];
$cutsteel =$_POST['cutsteel'];
$stairups =$_POST['stairups'];
$stairuptype =$_POST['stairuptype'];
	
	$chk10= " INSERT INTO `columntype-cal` (`PID`, `Numb`, `barlength`, `barwidth`, `bartype`, `barnum`, `cutsteel`, `stairups`, `stairtype`) VALUES('$PID','$A17', '$A21','$A19', '$bartype','$banum', '$cutsteel', '$stairups', '$stairuptype' )";
	$checkquery=mysqli_query($con, $chk10);
	
	if($checkquery){
		
		 header("Location:stagesofproject.php?id=$PID"); }
	
/*echo 'Bar type is' .$bartype .'<br>';
echo 'Length value is' .$A17 .'<br>';*/

//echo '-------------------------------------------' .'<br>';	
}

if(isset($_POST['check11'])){
	
	
		
$A30=$_POST['A_30'];	
$A28=$_POST['A_28'];
$A26=$_POST['A_26'];	
$A18=$_POST['A_18'];//height of colunm base
$bartype =$_POST['bartype'];
$banum =$_POST['barnums'];
$mattype =$_POST['mattype'];
$bendit =$_POST['bendit'];
//$stairuptype =$_POST['stairuptype'];
	//------------------Basket excavation cal----------------
	
	$sqlmin= "SELECT * FROM upline_app_laboursettings where ID='3'";
	$resultmin=mysqli_query($con, $sqlmin);
while($rowsix=mysqli_fetch_array($resultmin)){
	$labourprice=$rowsix['labourer_price'];$labourname='Basket Excavation'; $total=$A30*$labourprice;   } 
	
	$sqlmi= "SELECT * FROM upline_app_laboursettings where ID='4'";
	$resultmi =mysqli_query($con, $sqlmi);
while($rowsi =mysqli_fetch_array($resultmi)){
	$labourprice2=$rowsi['labourer_price'];  $labour_name2=$rowsi['labour_name']; 
	$total12=2*$labourprice; }
	
	$sqlmax= "SELECT * FROM upline_app_biddingwire ";
$resultmax =mysqli_query($con, $sqlmax);
while($rowsax =mysqli_fetch_array($resultmax)){
	$bindingwirename=$rowsax['BindingWire_name'];
	$bindingwireprice=$rowsax['BindingWire_price'];
	$cutofBindingWire =$rowsax['A cut of Binding Wire'];
	$BindingWire_1D =$rowsax['BindingWire_1D'];
	$diameter =$rowsax['diameter']; }
	
	
//---------------------- bidding wire calculation-------------	
$ap_group10 = ($banum*2) * $A28 * $mattype; 
$ap_group11 = $cutofBindingWire/$BindingWire_1D;
$biddingwireamount =$ap_group10 * $ap_group11;
	$wiretotalamt =$biddingwireamount * $bindingwireprice;
	
$columnbase1 =$A18 * $A26 * 4 * $A28;
$columnbase2 =$A18 * $A26 * 2 * $A28;
	
	$wir1 ="INSERT INTO foundation_labourer( PID, LabourerDescription, COEQuantity, BOQQuantity, Extra, Price, COETotal, BOQTotal)
	VALUES
	('$PID','$labourname','$A30', '0', '0', '$labourprice', '$total','0' ),
	('$PID','$labour_name2','2', '0', '0', '$labourprice2', '$total12','0' )
	";
	$itwi=mysqli_query($con, $wir1);
	
	$wire1 ="INSERT INTO foundation_materials( PID, MaterialDescription, COEQuantity, BOQQuantity, Extra, Price, CETotalAmount, BOQTotalAmount)
	VALUES('$PID','$bindingwirename','$biddingwireamount', '0', '0', '$bindingwireprice', '$wiretotalamt','0' )";
	$itswi=mysqli_query($con, $wire1);
	
	$baa="INSERT INTO `basetypecal` (`PID`, `Numb`, `barwidth`, `barheight`, `bartype`, `barnum`, `mattype`, `bendingheight`) VALUES ('$PID', '$A28', '$A26', '$A18', '$bartype', '$banum', '$mattype','$bendit' )";
	$reski=mysqli_query($con, $baa);
	
	$sqll ="UPDATE columnbased SET columnbase1='$columnbase1', columnbase2='$columnbase2' where pid='$PID' ";
	$reski=mysqli_query($con, $sqll);
	if($reski){
		
		 header("Location:stagesofproject.php?id=$PID");
//echo 'Column Base Value is'.''. ''. $columnbase1 .'<br>';
//echo 'Length of wood for Column Base Value is'.''. ''. $columnbase2 .'<br>';
/*echo 'Bar type is' .$bartype .'<br>';
echo 'Length value is' .$A26 .'<br>';
echo 'Bending Heigth value is' .$bendit .'<br>';
*/
	
//echo '-------------------------------------------' .'<br>';	
}}
if(isset($_POST['check12'])){ 
	$planktype=$_POST['plakname'];
$planktype2=$_POST['planktype2'];	
$m45 = 0.94875;	
	
$sql31= "SELECT * FROM columnbased where pid='$PID'";
$result31 =mysqli_query($con, $sql31);
while($rows31 =mysqli_fetch_array($result31)){
	$areaofplank =$rows31['areaofplank'];
	$columnbase1 =$rows31['columnbase1']; }

   //mysqli_real_escape_string()
	$ppl="SELECT * FROM upline_app_plankothers where plankothers_name='$planktype' ";
	$result33 =mysqli_query($con, $ppl);
while($rows33 =mysqli_fetch_array($result33)){
	$plankprice=$rows33['plankothers_price'];
	$plankname=$rows33['plankothers_name']; }
	
$plank4entirecolumn= $areaofplank/$m45;
$etirecolumnbaseplank = $columnbase1/$m45;
	$CETotalAmount=$plank4entirecolumn*$plankprice;
	
	$plankandwood= "INSERT INTO `plankandwoodreport` (`PID`, `plankorwood_name`, `plankorwood_qty`) VALUES('$PID', '$plankname','$plank4entirecolumn')";
	$it22=mysqli_query($con, $plankandwood);
	
	$insti ="INSERT INTO foundation_materials( PID, MaterialDescription, COEQuantity, BOQQuantity, Extra, Price, CETotalAmount, BOQTotalAmount)
	VALUES('$PID','$plankname','$plank4entirecolumn', '0', '0', '$plankprice', '$CETotalAmount','0' )";
	$itsni=mysqli_query($con, $insti);
	if($itsni){
		 header("Location:stagesofproject.php?id=$PID"); }
	
/*echo 'Entire Column plank value is '.''.$plank4entirecolumn .'<br>';
echo'Entire Column Bases value is ' .''.$etirecolumnbaseplank .'<br>';*/

	
}//}
//}
//echo $area2;
//---------------------wood calculation----------------------
if(isset($_POST['check45'])){
	
	$woodname =$_POST['woodtype'];
	$isec ="SELECT * FROM upline_app_plankothers WHERE plankothers_name='$woodname'";
	$isee =mysqli_query($con, $isec);
		while($recc=mysqli_fetch_array($isee)){
	$M48=$recc['sawedwood_length'];
	$woodprice=$recc['plankothers_price'];
		}
	///------------bag of nail calculation-----------------
	$is22 ="SELECT * FROM plankandwoodreport WHERE PID='$PID'";
	$ise22 =mysqli_query($con, $is22);
		while($rec22=mysqli_fetch_array($ise22)){
	$entirecolumn=$rec22['plankorwood_qty']; }
	
	//----------search for nail details------------------
	$is33 ="SELECT * FROM upline_app_materials WHERE material_type='Nails'";
	$ise33 =mysqli_query($con, $is33);
		while($rec33=mysqli_fetch_array($ise33)){
	$materialname=$rec33['material_name']; $materialprice=$rec33['material_price']; }
	//---------------Gravel amount calculation---------------------------
	$is44 ="SELECT * FROM upline_app_materials WHERE material_ID='tl-gravel'";
	$ise44 =mysqli_query($con, $is44);
		while($rec44=mysqli_fetch_array($ise44)){
	$materialname2=$rec44['material_name']; $materialprice2=$rec44['material_price']; $materialqty=$rec44['material_quantity_ton']; }
	
	$gravelqty= 3.397226136/($materialqty*700*0.001);
	$graveltotalamt=$gravelqty * $materialprice2;
	//----------------gravel calculatio eds here---------------
	
	$length=$_POST['A_53'];
	$numbers=$_POST['A_47'];
	
	//} 
	$H48 = 3.6/$length;
	$J48 = $numbers*16;
	$Bracingcolumnwood =$J48/$H48;
	
	$CETotalAmount=$Bracingcolumnwood*$woodprice;
	
	$bagofnail = ($Bracingcolumnwood + $entirecolumn)/250;
	$nailtotal =$bagofnail * $materialprice;
	
	
	$insti2 ="INSERT INTO foundation_materials( PID, MaterialDescription, COEQuantity, BOQQuantity, Extra, Price, CETotalAmount, BOQTotalAmount)
	VALUES
	('$PID','$woodname', '$Bracingcolumnwood', '0', '0', '$woodprice', '$CETotalAmount','0' ),
	('$PID','$materialname', '$bagofnail', '0', '0', '$materialprice', '$nailtotal', '0' ),
	('$PID','$materialname2', '$gravelqty', '0', '0', '$materialprice2', '$graveltotalamt', '0' )
	";
	$itsni2=mysqli_query($con, $insti2);
	if($itsni2){
		 header("Location:stagesofproject.php?id=$PID"); }
	
	//echo'Woods for Bracing Columns value is ' .''.$Bracingcolumnwood .'<br>';
	//echo $length .'<br>';
	//echo $numbers .'<br>';
		
	
	//echo 'what is happeing here';
//}



		
	
}//}------------------------wood2 calculation-------------
if(isset($_POST['wood2'])){
	
	$woodname =$_POST['woodtype1'];
	$f49=$_POST['spacing'];
	
	$ise2 ="SELECT * FROM columnbased WHERE PID='$PID'";
	$ise =mysqli_query($con, $ise2);
		while($recc2=mysqli_fetch_array($ise)){
	$aop=$recc2['areaofplank'];
		}
	//$spac=$_POST['spacing'];
	//$aop means L8 while 
	//} 
	$m49 = 3.6;
	
	$H49 = $aop/3.6;
	$J49 = 1.25/$f49;
	
	$woodforframin =$J49*$H49;
	//echo'Woods for Framing Columns value is ' .''.$woodforframin .'<br>';
	//echo $length .'<br>';
	//echo $numbers .'<br>';
	if($woodforframin){
		 header("Location:stagesofproject.php?id=$PID"); }	
	
	//echo 'what is happeing here';
//}



		
	
}//}stirup

if(isset($_POST['stirup'])){
	
	$i8=16;
	$c52=8;
	$F8=0.225; //block length
    $H8=0.40; 
	$selected_Steel=11.85;
	$F52 =($F8+$H8)*2-(100*0.001);
	
	$H52 = $selected_Steel/$F52;
	$J52 = $i8 * $c52;
	
	$stirrupcal =$J52/$H52;
	//echo'Stir Up  value is ' .''.$stirrupcal .'<br>';
	//echo $F52 .' <br>'; remember to uncomment

	//echo $numbers .'<br>';
	if($stirrupcal){
		 header("Location:stagesofproject.php?id=$PID"); }		
//echo '-------------------------------------------' .'<br>';		
	//echo 'what is happeing here';
//}

}//}stirup
if(isset($_POST['bar1'])){
	
	$sqba= "SELECT * FROM basetypecal where PID='$PID'";
	$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}
	$V64 =$rowsba['mattype'];
	}
	
	$sqba2= "SELECT * FROM upline_app_steels_wire where steels_wire_name='$steelname'";
$resultba2 =mysqli_query($con,$sqba2);
while($rowsba2 =mysqli_fetch_array($resultba2)){
	$price=$rowsba2['steels_wire_price'];
	$price = str_replace(',', '', $price);  // remove commas
    $price = preg_replace('/[^\d.]/', '', $price); 
	$price = floatval($price);
    
}
	
	$selected_Steel=11.85;
	//$V64 = 2; // mat type-double mat(2) or (T64:U64)
	$A64= 0.10; //stage_1_basket_bendig value or A64
	 
	$F64 =$H19-(100*0.001);
	$G64 =($A64*2)+$F64;
	
	
	$J64 = $c64*$B64*$V64;
	$H64 = $selected_Steel/$G64;
	
	$barforcolunmbase =$J64/$H64;
	$CETotalAmount=$barforcolunmbase*$price;
	
	$insti22 ="INSERT INTO foundation_materials( PID, MaterialDescription, COEQuantity, BOQQuantity, Extra, Price, CETotalAmount, BOQTotalAmount)
	VALUES('$PID','$steelname','$barforcolunmbase', '0', '0', '$price', '$CETotalAmount','0' )";
	$itsni2=mysqli_query($con,$insti22);
	if($itsni2){
		 header("Location:stagesofproject.php?id=$PID"); }
	
	/*echo'Bar for Column base value is ' .''.$barforcolunmbase .'<br>';
	echo $J64 .' <br>';
	echo $H64 .'<br>';
		
	echo '-------------------------------------------' .'<br>';	*/
	//echo 'what is happeing here';
//}

} //}}stirup

if(isset($_POST['bar2'])){
	
	$B75=16; // Nunber or I8
	$C75=6; //bar number from column base form or A_73
	$selected_Steel=11.85;
	$A_79A =$cutsteelinto=4;
	$F75=$selected_Steel/$A_79A;
	
	$J75=$B75*$C75;
	//$V64 = 2;  mat type-double mat(2) or (T64:U64)
	//$A64= 0.10; stage_1_basket_bendig value or A64
	//$H19 = 0.15; height of column base 
	/*$F64 =$H19-(100*0.001);
	$G64 =($A64*2)+$F64;*/
	
	
	//$J64 = $c64*$B64*$V64;
	//$H64 = $selected_Steel/$G64;
	
	$barforentirecolunm =$J75/$A_79A;
	/*echo'Bar for Entire column value is ' .''.$barforentirecolunm .'<br>';
	echo $F75 .' <br>';
	echo $J75 .'<br>';
		*/
	if($barforentirecolunm){
		 header("Location:stagesofproject.php?id=$PID"); }
	//echo 'what is happeing here';
//}

}//}stirup

//-------------concrete for blinding for all walls----
if(isset($_POST['concreteB'])){
	
	$cosql="SELECT * FROM wall_calculation where PID='$PID' AND blocktype='9 inches Hollow Block'";
	$coresult=mysqli_query($con,$cosql);
while($rowsco =mysqli_fetch_array($coresult)){
	$A_5=$rowsco['walllength']; $walltype=$rowsco['walltype']; }
	
	
	$concretegrade=$_POST['concretegrade'];
	$sand=$_POST['sand'];
	$cement=$_POST['cement'];
	$gravel=$_POST['gravel'];
	$A_106=$thickness=$_POST['A_106'];
	//$A_5=73.6; //length of block
	
	$co2sql="SELECT * FROM upline_app_concretework where Mixed_Ratio_Name='$concretegrade'";
	$co2result=mysqli_query($con,$co2sql);
while($rowsc =mysqli_fetch_array($co2result)){
	$stage1_mix2=$rowsc['Mixed_Ratio_amt']; }
	
	
	$somelabourer_1c= 0.6;
	//$stage1_mix2=0.202135499;
	
	$k87=$A_5*$somelabourer_1c*$A_106;
	
	$l87=$k87/$stage1_mix2; //Concrete for Foundation Blinding exterior wall
	
	$concre="INSERT INTO `concrete` (`PID`, `concrete`, `walltype`, `concreteforentirecolumnbase`, `concreteforentirecolumn`) VALUES('$PID', '$l87', '$walltype','', '') ";
	$itconc=mysqli_query($con,$concre);
	if($itconc){
		 header("Location:stagesofproject.php?id=$PID"); }
	
	
	/*echo'Concrete for Entire column value is ' .''.$l87 .'<br>';
	echo'K87 value is ' .''.$k87 .'<br>';
	echo'--------------------------------------------------' .'<br>';*/
}

if(isset($_POST['entbase'])){
	
	$concretegrade=$_POST['concretegrade2'];
	$sand=$_POST['sand2'];
	$cement=$_POST['cement2'];
	$gravel=$_POST['gravel2'];
	//$A_106=$thickness=$_POST['A_106'];
	//$A_5=73.6; //length of block
	$co2sql1="SELECT * FROM upline_app_concretework where Mixed_Ratio_Name='$concretegrade'";
	$co2result1=mysqli_query($con,$co2sql1);
while($rowsc1 =mysqli_fetch_array($co2result1)){
	$stage1_mix3=$rowsc1['Mixed_Ratio_amt']; }
	
	$somelabourer_1c= 0.6;
	//$stage1_mix3=0.202135499;
	
	$ise2 ="SELECT * FROM columnbased WHERE PID='$PID'";
	$ise =mysqli_query($con, $ise2);
		while($recc2=mysqli_fetch_array($ise)){
	$k91=$recc2['columnbase2'];
		}
	
	//$k87=$A_5*$somelabourer_1c*$A_106;
	
	$l91=number_format($k91/$stage1_mix3,0); //Concrete for Foundation Blinding exterior wall
	
	
	$updt1="UPDATE `concrete` SET concreteforentirecolumnbase=$l91 where PID='$PID' ";
	
	$itconcu=mysqli_query($con,$updt1);
	if($itconcu){
		 header("Location:stagesofproject.php?id=$PID"); }
}

if(isset($_POST['entbase2'])){
	
	$concretegrade=$_POST['concretegrade2'];
	$sand=$_POST['sand2'];
	$cement=$_POST['cement2'];
	$gravel=$_POST['gravel2'];
	
	$co2sql1="SELECT * FROM upline_app_concretework where Mixed_Ratio_Name='$concretegrade'";
	$co2result1=mysqli_query($con,$co2sql1);
while($rowsc1 =mysqli_fetch_array($co2result1)){
	$stage1_mix3=$rowsc1['Mixed_Ratio_amt']; }
	//$A_106=$thickness=$_POST['A_106'];
	//$A_5=73.6; //length of block
	$somelabourer_1c= 0.6;
	//$stage1_mix3=0.202135499; 
	
	$cotsel="SELECT * FROM concrete where PID='$PID' ";
	$cotresult1=mysqli_query($con,$cotsel);
while($rowscot =mysqli_fetch_array($cotresult1)){
	$concreteforentirecolumnbase=$rowscot['concreteforentirecolumnbase']; $concrete=$rowscot['concrete']; }
	
	$ise2 ="SELECT * FROM columnbased WHERE PID='$PID'";
	$ise =mysqli_query($con, $ise2);
		while($recc2=mysqli_fetch_array($ise)){
	$k93=$recc2['cubicmeterofconcrete'];
		}
	$is44 ="SELECT * FROM upline_app_laboursettings WHERE ID='5'";
	$ise44 =mysqli_query($con, $is44);
		while($rec44=mysqli_fetch_array($ise44)){
	$labourname22=$rec44['labour_name']; $labourprice22=$rec44['labourer_price']; }
	
	//$k87=$A_5*$somelabourer_1c*$A_106;
	
	$l93=number_format($k93/$stage1_mix3,0); //Concrete for Foundation Blinding exterior wall
	
	$totalconcrete = $l93 + $concreteforentirecolumnbase + $concrete;
	$labourtotal= $totalconcrete * $labourprice22;
	$LabourerDescription='Concrete';
	
	
	$updt2="UPDATE `concrete` SET concreteforentirecolumn=$l93 where PID='$PID' ";
	$itconcu=mysqli_query($con,$updt2);
	
	
	$fl="INSERT INTO `foundation_labourer` (`PID`, `LabourerDescription`, `COEQuantity`, `BOQQuantity`, `Extra`, `Price`, `COETotal`, `BOQTotal`) VALUES('$PID', '$LabourerDescription','$totalconcrete','0','0','$labourprice22','$labourtotal','0')" ;
	$fl23 =mysqli_query($con, $fl);
	
	if($fl23){
		 header("Location:stagesofproject.php?id=$PID"); }
	
	
	/*echo'Concrete for column  value is ' .''.$l93 .'<br>';
	echo'K93 value is ' .''.$k93 .'<br>';*/
}

if(isset($_POST['equip'])){
	
	$equipqty=$_POST['equipqty'];
	$equipname=$_POST['equipment'];
	
	$ise42 ="SELECT * FROM upline_app_construction_equipment WHERE construction_equipmentName='$equipname'";
	$isee42 =mysqli_query($con, $ise42);
		while($recc42=mysqli_fetch_array($isee42)){
	$priceperday=$recc42['Payment_per_day'];
	
	$totalprice=$equipqty *	$priceperday;
			
	//---------------sendtodb-----------
			$insti44 ="INSERT INTO foundation_equipment( PID, EquipmentDescription, Quantity, Extra, Price, Total, contingencypercent)
	VALUES('$PID','$equipname','$equipqty', '0','$priceperday', '$totalprice','0' )";
	$itsni44=mysqli_query($con, $insti44);
	if($itsni44){
		 header("Location:stagesofproject.php?id=$PID"); }
	
	
		}
	
}




?>