D:\host\scoreman.in\assisiinterschool2025closed\sendformbulk.php

<?php

include('dbconnect.php');

ini_set('max_execution_time', 0); 
//$databaseQuery = 'SELECT appno,sname,email,hashcode FROM applications where (appno BETWEEN 100 and 3254) and order_status = "Success" LIMIT 1748,250';

//$databaseQuery = 'SELECT appno,sname,email,hashcode FROM applications where (appno BETWEEN 3255 and 5362) and order_status = "Success" LIMIT 1511,500';

////$appno=$_GET["app"];

$databaseQuery = 'SELECT appno,sname,email,hashcode FROM applications where (order_status = "Success" or order_status = "Shipped") and ( emailstatus is null or emailstatus ="" ) ';
$result = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());

echo mysqli_num_rows($result);
echo "<table>";
while($row = mysqli_fetch_array($result))
{



$appno=$row["appno"];
$sname=$row["sname"];
$email=$row["email"];
$key=$row["hashcode"];

$content='<html><body><b>Dear Skater '.$sname.',<br/><br/></b><br/>
Your entry form is ready.<br/><br/>

You can download your <b>THE 10TH TELANGANA STATE ROLLER SKATING CHAMPIONSHIPS 2023 - Entry Form </b> in the following link.<br/>

<a href="https://indiaskate.com/telangana2023/application.php?appno='.$appno.'&k='.$key.'">Click Here to Print / Download Application Form</a>
<br/></b><br/>
Please submit the signed form with necessary documents for approval.

Thanks & Regards<br/><br/>
TELANGANA COMMITTEE<br/>
indiaskate.com
</body></html>';

//$to = "jeganonly@gmail.com,krishnamani_k@yahoo.com,vishnuamalraj@yahoo.com";
//$to =$email;
$to =$email.",jeganonly@gmail.com";
//$to ="jeganonly@gmail.com";
$subject = $sname." |Entry Form ".$appno." | TELANGANA2023";

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "From: support@indiaskate.com" . "\r\n" ;
//$headers .= "Bcc: jeganonly@gmail.com";

$mailres=mail($to,$subject,$content,$headers);

	$qtext='UPDATE applications SET emailstatus="'.$mailres.'" WHERE appno = "'.$appno.'"';
	//	echo $qtext;
		 mysqli_query($con,$qtext) or mysqli_error();
			


echo "<tr><td>".$appno."</td><td>".$sname."</td><td>".$email."</td><td>".$mailres."</td></tr>";

}
echo "</table>";

echo "finished Success";
?>