<?php require_once('../auth/auth.php');
if (isset($_POST['newuser'])) {
    $newuser   =    $_POST['newuser'];
    $busid     =    $_POST['busid'];
    $bra_id    =    $_POST['bra_id'];
    $em_id     =    $_POST['em_id'];
    $g_per_id  =    $_POST['g_per_id'];
    $username  =    $_POST['username'];
    $password  =    $_POST['password'];

    if ($newuser=='0') {
      mysqli_query($conn,"INSERT INTO user(`us_coid`, `us_bid`, `us_brid`, `us_em_id`, `us_ugid`, `username`, `password`, `us_date`, `us_language`, `us_status`) VALUES ('$coid','$busid','$bra_id','$em_id','$g_per_id','$username','$password', '$date',1,1)")or die(mysqli_error($conn));

    } else if($newuser >0){
        mysqli_query($conn,"UPDATE user SET us_bid='$busid',us_brid='$bra_id',us_em_id='$em_id',us_ugid='$g_per_id',username='$username',password='$password' WHERE uid='$newuser' AND us_coid='$coid' ");
    }
  }       
?>