<?php 

include('db_connect.php');
$response = array(); 
if(isset($_POST["camid"])){
	$camid = $_POST['camid'];
    $description = $_POST['description'];
        $location = $_POST['location'];
        $coords = $_POST['coords'];
 /*       $temp = $_POST['temp'];
  
        $meter = $_POST['meter'];
        $timezone = $_POST['timezone'];
        $timezonename = $_POST['timezonename'];
        $webpage = $_POST['webpage'];
        $rotate = $_POST['rotate'];
        $timeelapsepath = $_POST['timeelapsepath'];*/
        $livestreampath = $_POST['livestreampath'];
        $livestreamimage = $_POST['livestreamimage'];
     /*    $camtype = $_POST['camtype'];
        $updateinterval = $_POST['updateinterval'];
        */

        $staticimage = $_POST['staticimage'];
      /*    $updatetime = $_POST['updatetime'];
        $xd = $_POST['xd'];
        $hd = $_POST['hd'];
        $hoflabel = $_POST['hoflabel'];
        $hofpath = $_POST['hofpath'];
        $group = "cam";
        $camstate = $_POST['camstate'];        */
         $name1 = $_POST['name1'];
         $beautyshot = $_POST['beautyshot'];
         $rating = $_POST['rating'];
         $likes = $_POST['likes'];
         /*  $likesstatic = $_POST['likesstatic']; */
  
 $query="INSERT INTO camNew (camid,description,location,coords,livestreampath,livestreamimage,staticimage,name1,beautyshot)
  VALUES ('$camid','$description','$location','$coords','$livestreampath','$livestreamimage','$staticimage','$name1','$beautyshot')";
  if(mysqli_query($conn,$query)){
   $response['error'] = false; 
			$response['message'] = "Cam added successfully";

  }else{
   	$response['error'] = true; 
			$response['message'] = "Some error occurred please try again";	
  }
}else{
	echo "error";
}
echo json_encode($response);
?>