<?php
// Database connection
$conn = new mysqli("localhost", "root", "", "transparentqdb");

    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    } ?>

<?php

if (isset($_POST['trench'])) {
        
    // Get values from form
    $swampy = $_POST['SwampBuggy']; $price1 = $_POST['SwampBuggy1']; // Payment_per_day
    $trailer = $_POST['Trailer']; $price2 = $_POST['Trailer1']; // SomeLabourers_1c
    $Dozer = $_POST['Dozer'];  $price3 = $_POST['Dozer1']; 
	$LevelingInstrument = $_POST['LevelingInstrument'];  $price4 =$_POST['LevelingInstrument1'];     
    $Excavator = $_POST['Excavator']; $price5 =$_POST['excavatorprice'];
    $CompactorMachine = $_POST['CompactorMachine']; $price6 =$_POST['CompactorMachine1'];
    $SelfLoading = $_POST['SelfLoading']; $price7 =$_POST['SelfLoading1'];
    $ConcreteMixer = $_POST['ConcreteMixer']; $price8 =$_POST['ConcreteMixer1'];
	/*----------------------*/
	$LinePump = $_POST['LinePump']; $price9 =$_POST['LinePump1'];
	$bcp = $_POST['bcp']; $price10 = $_POST['bcp1']; 
    $msp = $_POST['msp']; $price11 = $_POST['msp1']; 
    $tmsp = $_POST['tmsp'];  $price12 = $_POST['tmsp1']; 
	$tmcp = $_POST['tmcp'];  $price13 = $_POST['tmcp1']; 
	$PokerVibrationMachine = $_POST['pvm'];  $price14 =$_POST['pvm1'];     
    $WaterPumpHose = $_POST['wph']; $price15 =$_POST['wph1'];
    $RollerCompactorMachine = $_POST['rcm']; $price16 =$_POST['rcm1'];
    $wheelloader = $_POST['wheelloader']; $price17 =$_POST['wheelloader1'];
    $loaderbachhoe = $_POST['loaderbachhoe']; $price18 =$_POST['loaderbachhoe1'];
	
	/*----------------------*/
	$SkidSteer = $_POST['SkidSteer']; $price19 =$_POST['SkidSteer1'];
	$CrawlerLoader = $_POST['CrawlerLoader']; $price20 = $_POST['CrawlerLoader1']; 
    $Grader = $_POST['Grader']; $price21 = $_POST['Grader1']; 
    $Crane = $_POST['Crane'];  $price22 = $_POST['Crane1']; 
	$Compressor = $_POST['Compressor'];  $price23 =$_POST['Compressor1'];     
    $OffHighwayTruck = $_POST['OffHighwayTruck']; $price24 =$_POST['OffHighwayTruck1'];
    $Generator = $_POST['Generator']; $price25 =$_POST['Generator1'];
    $Forklift = $_POST['Forklift']; $price26 =$_POST['Forklift1'];
    $Lift = $_POST['Lift']; $price27 =$_POST['Lift1']; 
	
	/*----------------------*/
	$LightTower = $_POST['LightTower']; $price28 =$_POST['LightTower1'];
	$Scaffolding = $_POST['Scaffolding']; $price29 = $_POST['Scaffolding1']; 
    $ScaffoldingP = $_POST['ScaffoldingP']; $price30 = $_POST['ScaffoldingP1']; 
    $ScaffoldingCPOP = $_POST['ScaffoldingCPOP'];  $price31 = $_POST['ScaffoldingCPOP1']; 
	$ScaffoldingScreed = $_POST['ScaffoldingScreed'];  $price32 =$_POST['ScaffoldingScreed1'];     
    $Scaffoldingpaint = $_POST['Scaffoldingpaint']; $price33 =$_POST['Scaffoldingpaint1'];
    $Scaffoldingpaintblackpop = $_POST['Scaffoldingpaintblackpop']; $price34 =$_POST['Scaffoldingpaintblackpop1'];
    /*$Forklift = $_POST['Forklift']; $price33 =$_POST['Forklift1'];
    $Lift = $_POST['Lift']; $price34 =$_POST['Lift1'];*/



    // Update Partition of Excavation
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price1' WHERE ID='1'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price2' WHERE ID='2'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price3' WHERE ID='3'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price4' WHERE ID='4'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price5' WHERE ID='5'");
	$conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price6' WHERE ID='6'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price7' WHERE ID='7'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price8' WHERE ID='8'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price9' WHERE ID='9'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price10' WHERE ID='10'");
	$conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price11' WHERE ID='11'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price12' WHERE ID='12'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price13' WHERE ID='13'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price14' WHERE ID='14'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price15' WHERE ID='15'");
	$conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price16' WHERE ID='16'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price17' WHERE ID='17'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price18' WHERE ID='18'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price19' WHERE ID='19'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price20' WHERE ID='20'");
	$conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price21' WHERE ID='21'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price22' WHERE ID='22'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price23' WHERE ID='23'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price24' WHERE ID='24'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price25' WHERE ID='25'");
	$conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price26' WHERE ID='26'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price27' WHERE ID='27'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price28' WHERE ID='28'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price29' WHERE ID='29'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price30' WHERE ID='30'");
	 $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price31' WHERE ID='31'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price32' WHERE ID='32'");
    $conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price33' WHERE ID='33'");
 	$conn->query("UPDATE upline_app_construction_equipment SET Payment_per_day='$price34' WHERE ID='34'");

    /*echo "Update successful!";*/ echo '<script language ="javascript" type= "text/javascript"> alert("Construction Equipment update is sucessfull"); location.href="constructionEquipment.php";</script>';
    $conn->close();
}
?>




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

<body>
</body>
</html>