?????????????? ?????????????? ?????????????? ?????????????? query($sql1); // // if ($result->num_rows == 0) { // if(mysqli_num_rows($result)==0){ // $sql = "INSERT INTO tracking_data (uid, emailTo,emailFrom,subject,event_type,sendTime,rereadcount) VALUES ('$uid', '$emailTo','$emailFrom','$subject','$eventType','$sendTime',0)"; // if (mysqli_query($con, $sql)) { // echo "Data Inserted"; // } else { // echo "Error: " . $sql . "
" . $con->error; // } // } // }else{ // $sql1 = "SELECT *FROM tracking_data WHERE uid='$uid'"; // $result2= mysqli_query($con,$sql1); // if(mysqli_num_rows($result2)>=1){ // $row= mysqli_fetch_assoc($result2); // $count1=$row["rereadcount"] + 1; // $sql = "UPDATE tracking_data SET rereadcount=rereadcount+1 WHERE uid='$uid'"; // $result= mysqli_query($con,$sql); // $result1= $query=mysqli_query($con,"SELECT * FROM user WHERE email='$emailFrom'"); // if(mysqli_num_rows($result1)>=1) { // $row= mysqli_fetch_assoc($result1); // $token =$row["token"]; $token ='dK3Shx5yRUW2b2BVjAhBc9:APA91bFQJ4IEYzvfKH2QMk9Fzn4yVWtn-exXLiIO9_8E-dBNlGgM7-gpm5nwDdBvKkIv1_xMRyc8cijZw3Zloa5vkiqKJlHUDEHCB1dY523PB4iXi9Qu1faWKOCjWz2SaR9Kh_T8LNGy'; $body1 = $_GET['uid'].'The Email you have send to '.$emailTo.' at '.$sendTime.' has been read.'; //$count1 = $_GET['rereadcount'] + 1; echo $body1; // echo $count1; $body_encoded = urlencode($body1); $send_notification_url = 'https://toptrendingappstudio.com/emailtracking/php/send_notifications.php?token='.$token.'&title=EmailRead&body='.$body_encoded.'¬ificationType=Email%20Read&readCount='.$count1.''; // $response1 = file_get_contents($send_notification_url); // Initialize cURL //$encoded_url = urlencode($send_notification_url); //echo $encoded_url $ch = curl_init(); // Set the URL and other cURL options curl_setopt($ch, CURLOPT_URL, $send_notification_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $notification_params = array( 'token' => $token, 'title' => 'Email Read', 'body' => $body1, 'notificationType' => 'EmailRead', 'readCount' => $count1, ); $notification_params_query = http_build_query($notification_params); $send_notification_url_with_params = $send_notification_url . '?' . $notification_params_query; // Send the GET request and get the response $response = curl_exec($ch); // } // } // } // $con->close(); // } else { // echo "Error: email and uniqueId parameters are required"; // } } ?>