<?php require_once('../auth/auth.php');?>
<?php
if (isset($_POST['prid'])) {
    $prid=           $_POST['prid'];
    $pr_brid=        $_POST['pr_brid'];
    $pr_name=        $_POST['pr_name'];
    $pr_sdate=       $_POST['pr_sdate'].' '.$time;
    $pr_edate=       $_POST['pr_edate'].' '.$time;
    $pr_active=      $_POST['pr_active'];

if ($prid>0) {
mysqli_query($conn,"UPDATE project SET pr_name='$pr_name',pr_sdate='$pr_sdate',pr_edate='$pr_edate',pr_userid='$userid',pr_active='$pr_active' WHERE pr_coid='$coid' AND prid='$prid'")or die(mysqli_error($conn));
} else {
mysqli_query($conn,"INSERT INTO project(pr_coid,pr_brid,pr_name,pr_sdate,pr_edate,pr_userid,pr_active) 
            VALUES ('$coid', '$pr_brid','$pr_name','$pr_sdate','$pr_edate','$userid','$pr_active')") or die(mysqli_error($conn));         
 }
}
?>