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


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

<?php

	//include 'database.php';

	$servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
	$username   = "admin";
	$password  = "Logisys2104";

	$conn = new  mysqli($servername,$username,$password);
	if(!$conn) 
	{
        die("Connection failed: " . mysqli_connect_error());
	}
	//$enttype1 = $_GET['enttype'];

	$commondb = "logisys3_comexam";
	ini_set('max_execution_time', 3000);
	$sql = "select fdbname, funivcode from {$commondb}.dbname 
	where ifnull(FEGOV,'') = 'T'"; 
	$result = mysqli_query($conn,$sql);
	// var_dump($result);
	$result1 = 0;
	if($result)
	{		
		while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
		{
			$db = $row['fdbname'];
			$univcode = $row['funivcode'];
			
			//Room Allotment

			$enttype = 'RA';

			$sql1 = "insert ignore into {$commondb}.pushnotif(funivcode, fcollcode, fregno, fmobileno,fmobappid,fdegree, fenttype, fsubcode, ftitle, 
			fbody, fstatus, fyear, fexamtype, fpushdate)
			select distinct '{$univcode}',x.fcollcode, x.fregno, fmobileno, FAPPMOBID, y.fdegree, '{$enttype}', y.fqpcode,  
			CONCAT('Room Allotment - ',y.fqpcode) as ftitle,
			CONCAT('Dear Student, you have been alloted to room no. : ',
			IF(IFNULL(z.froomname,'') = '',
			IFNULL(x.FHALLNO,''),IFNULL(z.froomname,'')), ' for the QP Code ',
			CONCAT(y.fqpcode,' - ',y.fsubname),' on ',
			DATE_FORMAT(y.fdoe,'%d/%m/%Y'),' (',w.FDESCPN,').',' All the best.') as fbody,
			'F', x.fyear, x.fexamtype,NOW()
			from {$db}.canddet x inner join {$db}.subject y
			on  x.fdegree = y.fdegree and x.fexamno = y.fexamno and x.fsubcode = y.fsubcode 
			inner join {$db}.degree d on x.fdegree = d.fdegree and x.fexamno = d.fexamno
			inner join {$db}.candsum cs on x.fcollcode = cs.fcollcode and x.fdegree = cs.fdegree
			inner join {$commondb}.masuser m on cs.fregno = m.fregno 
			and m.funivcode = '{$univcode}'
            and x.fregno = cs.fregno
			left join {$db}.masroom z on cs.fcntrcode = z.fcollcode and x.FHALLNO = z.froomno
			left join {$db}.reason w on y.FSESSION = w.FREASONCD
			where IFNULL(x.fpresent,'') = 'p' and IFNULL(x.fpassmth,'') = '' 
			and x.fyear = d.FMEYEAR and x.fexamtype = d.FMEEXAMTYP
			and DATE_FORMAT(NOW(),'%Y-%m-%d') = DATE_FORMAT(y.fdoe,'%Y-%m-%d')
			and IFNULL(y.FSESSION,'') like 'N%' and IFNULL(x.fhallno,'') <> ''";
			
			$result1 = mysqli_query($conn, $sql1);
		}
	}
	
?>