<?php
 
/*
 * Following code will list all the city
 */
 
$response = array();
 
require_once __DIR__ . '/catchexception.php';
// include db connect class
require_once __DIR__ . '/db_config.php'; 
 
// check for post data
    $paraimeino = urldecode($_POST['paraimeino']);
    $parasyncprocess=urldecode($_POST['parasyncprocess']);
    $paradevicecode = urldecode($_POST['paradevicecode']); 

   /* $paraimeino = '865501036998905';
    $parasyncprocess = 'route';
    $paravancode = '2';
    $pararefcode = "";*/
   
    $response["TransactionDetails"]=array();
try{
 if (isset($paraimeino) && isset($parasyncprocess) && isset($paradevicecode) ) {
     // get a product from products table
    $sql="INSERT into tblsyncdetails (imeino,syncdate,synctype,devicecode) values 
    ($1,now(),$2,$3 )";  
    $resultmax=  pg_prepare($con,"sql",$sql);
    if($paradevicecode == "" || $paradevicecode == null || $paradevicecode == 'undefined') { $paradevicecode = 0 ;}
  $data = [$paraimeino,$parasyncprocess,$paradevicecode ];
  $result = pg_execute($con,"sql",$data);
    if (!empty($result)) {
      echo "Success";
    }
 }
mch_db_release($con);
}
//catch exception
catch(Exception $e) {
mch_db_release($con);
echo 'Message: ' .$e->getMessage();
}
?>