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.119.166.141


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

<?php
//lib16107 lib16103

ini_set('display_errors', 'on');
include("sendsmsapi.php");
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);

$univcode = trim($_GET['funivcode']);
$univcode = '041';	
if($univcode == '')
{
	die();
}

//connect to database
$servername = "97.74.228.93";
$username   = "logisys3_logu";
$password  = "Logisys@2106";
$conn = new  mysqli($servername,$username,$password);
if(!$conn) 
{
    die("Connection failed: " . mysqli_connect_error());
}

$commondb = "logisys3_comexam";

$query = "select funivcode, fregno, fenttype, fmobileno as mobileno, 
concat(fmessage,' Sent Time: ',time(now())) as fmessage
from {$commondb}.sendsms 
where ifnull(fstatus, 'F') = 'F' and fenttype in('PGCET') and funivcode = '{$univcode}'
and fmobileno is not null";

$result = mysqli_query($conn,$query);
$count = mysqli_num_rows($result);

$username = 'logisyhttp';
$password = 'Logis986';
$from = 'UNISOL';
$category = '';

if($count >0)
{
	$i = 0;
	
	$row = mysqli_fetch_assoc($result);
	$text1 = $row['fmessage'];
	
	while($row = mysqli_fetch_assoc($result))
	{
		$to = $row['mobileno'];
		$text = $row['fmessage'];

		$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);	
		echo $i." - ".$to." - ".$smsresp."<br>";
		$rgInsert[] = "('".$row['funivcode']."','".$row['fregno']."','{$to}','0','{$smsresp}','".$row['fenttype']."','T', DATE_FORMAT(NOW(),'%Y-%m-%d'), DATE_FORMAT(NOW(),'%T'))";
		$rgTrimedMobs[$i] = $to;

		//echo $i.$to."<br>";
		
		if($i == 50)
		{
			$strInsertQuery = "insert into {$commondb}.smslog(funivcode, fregno,fmobileno, freasoncode, fguid, fenttype, fstatus,fackdate, facktime) values".implode(',',$rgInsert);
			//var_dump($strInsertQuery);
			$result1 = mysqli_query($conn,$strInsertQuery);

			$srtImplodedMobs = implode("','",$rgTrimedMobs); 
			$strUpdateQuery = "update {$commondb}.sendsms set fstatus = 'T' where fenttype in('PGCET') and fmobileno in ('{$srtImplodedMobs}')";
			//var_dump($strUpdateQuery);	
			
			$result2 = mysqli_query($conn,$strUpdateQuery);
			
			unset($rgInsert);
			$rgInsert = array();

			unset($rgTrimedMobs);
			$rgTrimedMobs = array();
			$i = 0;
		}

		$i++;
	}

	$strInsertQuery = "insert into {$commondb}.smslog(funivcode,fregno,fmobileno, freasoncode, fguid, fenttype, fstatus,fackdate, facktime) values".implode(',',$rgInsert);
	//var_dump($strInsertQuery);
	$result1 = mysqli_query($conn,$strInsertQuery);

	$srtImplodedMobs = implode("','",$rgTrimedMobs); 
	$strUpdateQuery = "update {$commondb}.sendsms set fstatus = 'T' where fenttype in('PGCET') and fmobileno in ('{$srtImplodedMobs}')";
	//var_dump($strUpdateQuery);	
	$result2 = mysqli_query($conn,$strUpdateQuery);
	$username = 'logisyhttp';
	$password = 'Logis986';
	$from = 'UNISOL';
	$category = 'bulk';
	
	//north
	//$to = "918277684424,919538219443,919845532688,919844020272,919986554632,919844059406,919741089633,9448454872";
	
	//Central
	//$to = "918277684424,919538219443,919845532688,919844020272,919986554632,919844059406,919741089633,9449259058";
	
	//DUD

	$to = "918277684424,919741089633";

	$smsresp = sendsmaapi($username,$password,$from,$to,$text1,$category);

	
	echo "SMS Sent";
}


	$username = 'logisyhttp';
	$password = 'Logis986';
	$from = 'UNISOL';
	$category = 'bulk';
	
	//north
	//$to = "918277684424,919538219443,919845532688,919844020272,919986554632,919844059406,919741089633,9448454872";
	
	//Central
	//$to = "918277684424,919538219443,919845532688,919844020272,919986554632,919844059406,919741089633,9449259058";
	
	//DUD
	$text1 = "Message from BCU : University regrets to inform that admissions to MA philosophy course has been put off due to insufficient applicants. You are advised to claim refund of the application fee by writing to Registrar, BCU.Sent Time: 17:11:30";

	$to = "918277684424,919741089633";

	$smsresp = sendsmaapi($username,$password,$from,$to,$text1,$category);

	var_dump($smsresp);
	echo "SMS Sent";

?>