0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.226.34.148


Current Path : /proc/thread-self/root/var/www/html/univadmin/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin/PC_sms_push_kus.php

<?php
/*
* Api For sending result sms through web export after uploading the result
*

url == http://studentportal.logisys.org/result_sms_push.php
post data == funivcode=003&fdbname=logisys3_kus

*
*/
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);
include("/var/www/config.php");
//include 'database.php';

//connect to database
$servername = SERVERNAME;
$username   = USERNAME;
$password  = PASSWORD;
$conn = new  mysqli($servername,$username,$password);
if(!$conn) 
{
    die("Connection failed: " . mysqli_connect_error());
}

$commondb = "logisys3_comexam";

// Will be sent by mohan sir through web export

$db = 'logisys3_kus';
$univcode = '003';

//Result Push data to common databse

if( $db != '' && $univcode != '')
{
	$sql1 = "INSERT IGNORE INTO logisys3_comexam.sendsms(funivcode, fregno, fmobileno, fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype,fupdate)
	SELECT DISTINCT '{$univcode}', m.fregno, m.fmobileno, 'STPC', 'STPC', 
	CONCAT('Message from KUS : Photo copy (Scanned copy) of answer book is available for downloading in student portal. Download and message to I NEED HELP in case of any clarifications.') AS fmessage, 
	'F', 'F', '2020', '2', NOW() 
	FROM logisys3_comexam.masuser m where m.funivcode = '{$univcode}' 
	and fregno in (select distinct fregno from {$db}.res_stud 
	where ifnull(fxrpath, '') <> '' and ifnull(fpaymentstatus,'') = 'success'
	and ifnull(fxrpush,'') <> 'T')";
		
	$result1 = mysqli_query($conn, $sql1);

	if($result1)
	{
		$sql1 = "update {$db}.res_stud set fxrpush = 'T'
		where ifnull(fxrpath, '') <> '' 
		and ifnull(fpaymentstatus,'') = 'success'
		and ifnull(fxrpush,'') <> 'T'";
		
		$result3 = mysqli_query($conn, $sql1);

		echo "success";
	}
	else
	{	
		echo "failure";
	}	
}

/*if($result2)
{	

	$query = "select s.funivcode, d.funivname, s.fenttype,count(fmobileno) as pushcount,date_format(left(fupdate,10),'%d.%m.%Y') as pushdate
	from {$commondb}.sendsms s
	inner  join {$commondb}.dbname d
	on s.funivcode = d.funivcode
	where ifnull(fmobileno,'') <> ''
	and ifnull(fstatus,'') = 'F'
	and left(fupdate,10) = date_format(now(),'%Y-%m-%d')
	and fupdate >= DATE_SUB(now(), interval 2 hour)
	and s.funivcode = '{$univcode}'
	and s.fenttype = 'RE'
	group by s.funivcode,s.fenttype";
	
	$result = mysqli_query($conn, $query);
	$count = mysqli_num_rows($result);
	if($count > 0)
	{	
		$table = '<table cellspacing="1" cellpadding="2" border="0" align="center" bgcolor="#505151">
				<thead> 
				<tr bgcolor="#e1eaea">
				 <th>Sl.<br> No.</th>
				 <th>University <br>Code</th>
				 <th>University Name</th>
				 <th>Event <br> Type</th>
				 <th>Count</th>
				 <th>Date</th>
				 </tr>
				 </thead>';	
		$i = 1;
		while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
		{
				//var_dump($row);
			
			$table .= "<tr bgcolor='#ffffff' >";
			$table .= "<td><center>".$i."</center></td>";
			$table .= "<td><center>".$row['funivcode']."</center></td>";
			$table .= "<td>".$row['funivname']."</td>";
			$table .= "<td><center>".$row['fenttype']."</center></td>";
			$table .= "<td align='right'>".$row['pushcount']."</td>";
			$table .= "<td><center>".$row['pushdate']."</center></td>";
			$table .= "</tr>";
			//$sum +=$row['pushcount'];
			$i++;
		}

		$table.="</table>";
		
		$emails = ['prashanth.k@logisys.org','arun.v@logisys.org'];
		
		$subject = "RESULTS SMS DATA UPLOAD STATISTICS";
		for($i=0;$i< count($emails); $i++)
		{
			
			$emailid = $emails[$i];
			//$resp = sendGridMail($emailid,$subject,$table);

			//echo $resp; 
		}
	}	
	echo "success";

}
else
{	
	echo "failure";
}*/
?>