<?php
	include_once('../config.php');   
    
  
          
    if(!isset($_SESSION['userId']))
    { 
         header("Location: ../");
         die;
    }
       
       
                if(isset($_POST['submit']))
                { 
                   
                    $stmt=$conn->prepare("insert into  UI__userMsg (sub,msg,Tdate,custId) values(:sub,:msg,:Tdate,:custId)");   
                    $stmt->bindValue(':sub',  $_POST['sub'] , PDO::PARAM_STR);  
                    $stmt->bindValue(':msg',  $_POST['msg']  , PDO::PARAM_STR);  
                    $stmt->bindValue(':Tdate',  date("d-M-Y") , PDO::PARAM_STR);
                    $stmt->bindValue(':custId', $_SESSION['userId']  , PDO::PARAM_STR); 
                    $stmt->execute();  
                    $_SESSION['Regis'] = "Message has been sent ";
                    $_SESSION['topSuc'] = 1;
                    header("Location: enqform.php");
                    die;
                }
                 
             
                
include_once("../view/dashboard/grabData.php");
?>  