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


Current Path : /proc/thread-self/root/var/www/html/gach/js/
Upload File :
Current File : //proc/thread-self/root/var/www/html/gach/js/cronjob_sendsms.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('AI') 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;
	$text = "";
	while($row = mysqli_fetch_assoc($result))
	{
		$to = $row['mobileno'];
		$text = $row['fmessage'];

		$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);	
		echo $i." - ".$to."<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('AI') 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('AI') and fmobileno in ('{$srtImplodedMobs}')";
	//var_dump($strUpdateQuery);	
	$result2 = mysqli_query($conn,$strUpdateQuery);
	$username = 'logisyhttp';
	$password = 'Logis986';
	$from = 'UNISOL';
	$category = 'bulk';
	//$text = "Updated college details of Bengaluru North University IS available ON http://universitysolutions.in/bnu/";
	//$to = "918277684424,919538219443,919845532688,919844020272,919986554632,919844059406,919741089633";
	//$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);

	
	echo "SMS Sent";
}

?>