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 : 13.59.83.202
<?php
//include 'database.php';
include("/var/www/config.php");
$servername = SERVERNAME;
$username = USERNAME;
$password = PASSWORD;
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$commondb = "logisys3_comexam";
ini_set('max_execution_time', 300);
$sql = "select fdbname, funivcode,ffolder,FDBUSER from {$commondb}.dbname where
ifnull(fdeleted,'') <> 'T' and ifnull(FEGOV,'') = 'T'
and funivcode in('060')";
$result = mysqli_query($conn,$sql);
if($result)
{
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
$db = $row['fdbname'];
$univcode = $row['funivcode'];
$ffolder = $row['FDBUSER'];
//Room Allotment
$sql1 = "insert ignore into {$commondb}.sendsms(funivcode, fregno,fmobileno, fusertype,fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype, fupdate,fexamdate)
select distinct '{$univcode}', x.fregno,m.fmobileno,'S','RA', y.fqpcode ,
concat('From {$ffolder}: ', 'Dear Student, you have been allotted to room no. : ',
if(ifnull(z.froomname,'') = '',
ifnull(x.FHALLNO,''),concat(ifnull(z.froomname,''),' - ',x.fslno)), ' for the QP Code ',
concat(y.fqpcode,' - ',left(y.fsubname,20)),' on ',
date_format(y.fdoe,'%d/%m/%Y'),' ',w.FDESCPN,'',' - Logisys') as fmessage,
'F', 'F', x.fyear, x.fexamtype,now(),d.fexamdate
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 cs.fcollcode = x.fcollcode
and cs.fdegree = x.fdegree and cs.fregno = x.fregno
and ifnull(cs.frecptdate,'')<>''
inner join logisys3_comexam.masuser m on m.fregno = cs.fregno
and m.funivcode = '{$univcode}'
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 ifnull(y.fqpcode,'') <> ''
and date_format(now(),'%Y-%m-%d') = date_format(y.fdoe,'%Y-%m-%d')
and ifnull(y.FSESSION,'') like 'N%' and ifnull(x.fhallno,'') <> ''";
//var_dump($sql1);
//die();
$result1 = mysqli_query($conn, $sql1);
}
}
?>
|