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 : 3.133.120.64


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

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

url == http://oasis.logisys.org/sms/admission_sms_push.php?funivcode=041&fdbname=logisys3_bcu

*
*/
// ini_set('memory_limit','900M');
// ini_set('max_execution_time',0);

//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";

// Will be sent by mohan sir through web export

$db = trim($_GET['fdbname']);
$univcode = trim($_GET['funivcode']);

//Admission Push data to common databse
$univcode = ['041','042'];
$db = ['logisys3_bcu','logisys3_bnu'];

for($i = 0; $i<count($db);$i++)
{
	if( $db[$i] != '' && $univcode[$i] != '')
	{
		if($univcode[$i] == '041')
		{
			$univname = "Bengaluru Central University";
			$univlink = "http://universitysolutions.in/bcu/adm";
		}	
		if($univcode[$i] == '042')
		{
			$univname = "Bengaluru North University";
			$univlink = "http://universitysolutions.in/bnu/adm";
		}	
		$sql1 = "insert ignore into {$commondb}.sendsms(funivcode, fregno, fmobileno, fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype,fupdate)
		select distinct '{$univcode[$i]}', x.fmobileno, x.fmobileno, 'AI', 'AI', 
		concat('Message from ','{$univname}','.',CHAR(13),'Dear ', x.fname, ', You are required to submit the admission details online within 3 days.',CHAR(13),'Visit ','{$univlink}') as fmessage, 'F', 'F', '2018', '2', now() 
		from {$db[$i]}.collstud x  
		where ifnull(x.fsmspush,'') <> 'T' and x.fcollcode <> 'phd'  and ifnull(x.factive,'') <> 'T'";
		// var_dump($sql1); die();		
		$result1 = mysqli_query($conn, $sql1);
		//var_dump($result1);
		/*$query = "insert ignore into {$commondb}.sendsms(funivcode, fregno, fmobileno, fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype,fupdate)
		SELECT '041',b.fmobileno,b.fmobileno,'AC','AC',
		CONCAT('Message from Bengaluru Central University.',CHAR(13),b.fcollcode,' - ',LEFT(c.fcollname,25),', admission enabled for the degree ',
		GROUP_CONCAT(DISTINCT CONCAT(a.fdegree,'(',a.cnt,') ',CHAR(13)))) AS degcnt,'F', 'F', '2018', '2', NOW() FROM 
		(SELECT fcollcode,fdegree,COUNT(*) AS cnt FROM {$db}.collstud
		GROUP BY fcollcode,fdegree ) a
		INNER JOIN {$db}.collstud b ON a.fdegree = b.fdegree AND
		a.fcollcode = b.fcollcode AND IFNULL(b.fsmspush,'') <> 'T'
		INNER JOIN {$db}.college c ON b.fcollcode = c.fcollcode
		GROUP BY a.fcollcode";
		$result = mysqli_query($conn, $query);*/

		if($result1)
		{
			$sql1 = "update {$db[$i]}.collstud x set x.fsmspush = 'T'
			where ifnull(x.fsmspush,'') <> 'T'";
			
			$result3 = mysqli_query($conn, $sql1);
			
			echo "success";
		}
		else
		{	
			echo "failure";
		}	
	}
}