<?php
include 'dbcon.php';

$result = mysqli_query($conn, "SELECT * from cycle_lst where cycle_activt='' order by STR_TO_DATE(cycle_strtd,'%d-%m-%Y') ASC");
$data="<table width=100% border='1' class='imagetable'>";
$data.="<tr><td>Patient Name</td><td>Patient MRN</td><td>Partner Name</td><td>Partner MRN</td><td>Treatment</td><td>Cycle start date</td></tr>";
while($row=mysqli_fetch_array($result)) 
{
$data.="<tr><td>".$row['pat_name']."</td><td>".$row['pat_mrn']."</td><td>".$row['part_name']."</td><td>".$row['part_mrn']."</td><td>".$row['cycle_type']."</td><td>".$row['cycle_strtd']."</td></tr>";
}
$data.="</table>";
//echo $data;

include_once('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "localhost";
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->Username = "noreply@novaivf.in";
$mail->Password = "N3%9Gw[d*n)v";
$mail->From       = "noreply@novaivf.in";
$mail->FromName   = "RFID EWS - NOVA IVF";
$mail->Subject = "EWS Upcominig/Active cycles - Gorakhpur";
$mail->addAddress('srinidhi.mp@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->addAddress('customercare_grk@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->addAddress('surya.singh@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->addAddress('drneha@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->addAddress('himanshu.pandey@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->addAddress('sabita.r@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->addAddress('chetan.solanki@novaivffertility.com', 'EWS Upcominig/Active cycles - Gorakhpur');
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML($data);
if(!$mail->Send()){
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
}
?>
