<?php
include 'connection.php';
session_start();
if (!isset($_SESSION['is_logged_in'])) {
    header("Location:login.php");
    die();
    }

date_default_timezone_set('Asia/Calcutta');
$today = date("Y-m-d");
$time = date("h:i A"); 
$currentyear = date("Y");

?>
<?php 
$querylogin = "select * from customer_invoice_details where inv_id = '". $_REQUEST["inv_id"]."' AND customer_id = '".$_REQUEST["customer_id"]."'";
$resultlogin = mysql_query($querylogin,$conn);
while($row=mysql_fetch_array($resultlogin))
{
$customer_name = $row['customer_name'];
$inv_no = $row['inv_no'];
$kind_attn = $row['kind_attn'];
}


$queryuser = "select * from customer_master where customer_id = '".$_REQUEST["customer_id"]."'";
$resultuser = mysql_query($queryuser,$conn);
while($row=mysql_fetch_array($resultuser))
{
$billing_address = $row['billing_address'];
} 

?>

<?php 
$to = "rupali@sahavas.com";
   //$to1 = "info@tagabag.in";
$subject = "Activation Request from $customer_name";
$message1 = "Dear Sir/Madam\n\n";
$message1 .= "Request you to please activate my account at WARPP software, so I can update my product invoice :$inv_no serial number...\n";
$message1 .= "Appreciate your quick reply & support.\n\n\n";
$message1 .= "Thanks & Regards,\n";
$message1 .= "$kind_attn\n";
$message1 .= "$customer_name\n";
$message1 .= "$billing_address";

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$header .= "From:support@warpp.co.in \r\n";
$retval = mail ($to,$subject,$message1,$header);
//$retval = mail ($to1,$subject,$message,$header);

if( $retval == true )  
   {
//"Message has been sent";
}
else{
// "Message has been  not sent";
}
//exit();

$query11 = "update customer_invoice_details set cust_request='YES' where inv_id = '". $_REQUEST["inv_id"]."' AND customer_id = '".$_REQUEST["customer_id"]."'";
$result11=mysql_query($query11,$conn);

?>
<script>
javascript:window.location.href="index.php";
</script>
