<?php


session_start(); 
    $u_uname = '';
    if (isset($_COOKIE['auth_token']))
    {
        $u_uname = $_COOKIE['auth_token'];
    }else{
        header("location:../login.php");
    }
    
    
    include('../include/connection.php');

    $projectName = $_POST['projectName'];
    $amount = $_POST['amount'];
    $advance = $_POST['advance'];
    $balance = $amount - $advance;
    $phone = $_POST['phone'];
    $commission = $_POST['commission'];
    $commStatus = $_POST['commStatus'];

    $id = $_GET['id'];

    $sql = "UPDATE `project` SET `projectname`='$projectName',`projectcost`='$amount',`balance`='$balance', `advanceamount`='$advance', `commission`='$commission',`commissionstatus`='$commStatus' WHERE srno=$id";
    
    $result = mysqli_query($link,$sql);
    
    if($result){
        header('Location:../allproject.php?status=1');
    }
    
?>