<?php
include_once("sessionMenus.php");
include_once("connection.php");
date_default_timezone_set('Asia/Kolkata');		
$date=$_POST['date'];	
$title=str_replace("'","^",$_POST['pro_cat']);
$poster=str_replace("'","^",$_POST['poster']);
$about=htmlspecialchars($_POST['about']);


$sql= "INSERT INTO tbl_news (title,newsdatetime,newscontent,smalldescp,imagename) VALUES
('".$title."',STR_TO_DATE('".$date."','%d/%m/%Y'),'".$about."','1','1')";
	
$exec_query=mysqli_query($conn, $sql);

if($exec_query){
	$result=1;
}
else
{
	$result=$sql;	
}


$json = array("op" =>$result);
			
			// send data as json format
			header("Content-Type: application/json",true);
				echo json_encode($json); 
				
?>