<?php require_once('../auth/auth.php');
if (isset($_POST['newtamp'])) {
    $newtamp=       $_POST['newtamp'];
    $head=    $_POST['head'];
    $body=   $_POST['body'];

    

if ($newtamp=='0') {
    mysqli_query($conn,"INSERT INTO sms_tamp(`coid`, `bid`, `brid`, `head`, `body`, `date`) VALUES ('$coid','$bid','$brid','$head','$body',
        '$datetime')")or die(mysqli_error($conn));
} else if($newtamp >0){
mysqli_query($conn,"UPDATE sms_tamp SET head='$head', body='$body' WHERE stid='$newtamp'");
echo "update"; 

}

}       
?>