<?php
if(!isset($_POST['telephone'])){
  exit();
}
$contact_name=filter_var($_POST['contactname'],FILTER_SANITIZE_STRING);
$contact_tel=filter_var($_POST['telephone'],FILTER_SANITIZE_STRING);
$contact_ward=filter_var($_POST['wardname'],FILTER_SANITIZE_STRING);
include 'iconnect.php';
if($contact_name==''){
  $reply=array('status'=>"failed",'mesaage'=>'Enter Contact Name');
  echo json_encode($reply);
  exit();
}
if($contact_tel==''){
  $reply=array('status'=>"failed",'mesaage'=>'Enter Contact Name');
  echo json_encode($reply);
  exit();
}
if($contact_ward==''){
  $reply=array('status'=>"failed",'mesaage'=>'Enter Contact Name');
  echo json_encode($reply);
  exit();
}
add_newcontact($contact_name,$contact_tel,$contact_ward);
$reply=array('status'=>"success",'mesaage'=>'New Contact Saved Successfully');
echo json_encode($reply);
?>
