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.223.238.150
<?php
/*
* Api For sending result sms through web export after uploading the result
*
url == http://studentportal.logisys.org/result_sms_push.php
post data == funivcode=003&fdbname=logisys3_kus
*
*/
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);
//connect to database
$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());
}
$commondb = "logisys3_comexam";
// Will be sent by mohan sir through web export
$db = 'logisys3_dud';
$univcode = '023';
//Result Push data to common databse
if( $db != '' && $univcode != '')
{
$sql1 = "insert ignore into logisys3_comexam.pushnotif(funivcode,fmobileno,fmobappid, fcollcode, fregno, fdegree, fenttype,
fsubcode, ftitle, fbody, fstatus, fyear, fexamtype, fpushdate)
select distinct '023', m.fmobileno,m.FAPPMOBID,x.fcollcode,x.fregno,x.fdegree, 'RE', x.fexamno, 'Result Announced',
concat('Dear ', st.fname,' (',x.fregno ,')',', your result for ',d.fexamname, ' ',
d.fexamdate, ' exam has been announced. Result : ',
y.fclass,'. Visit student portal studentportal.universitysolutions.in for details.') as fmessage,
'F', x.fyear, x.fexamtype, now()
from {$db}.res_fee x
inner join {$db}.resmarks y
on x.fdegree = y.fdegree
and x.fexamno = y.fexamno
and x.fregno = y.fregno
inner join {$db}.degree d
on x.fdegree = d.fdegree and x.fexamno = d.fexamno
inner join {$db}.student st
on x.fregno = st.fregno
inner join logisys3_comexam.masuser m on m.fregno = x.fregno
and m.funivcode = '023'
where x.fresultdate = date_format(now(),'%Y-%m-%d')
and ifnull(x.frespush,'') <> 'T'";
$result1 = mysqli_query($conn, $sql1);
if($result1)
{
// $sql1 = "update {$commondb}.pushnotif x, {$commondb}.masuser y set x.fmobileno = y.fmobileno,
// x.fmobappid = y.FAPPMOBID
// where x.funivcode = y.funivcode
// and x.fregno = y.fregno
// and ifnull(y.FAPPMOBID,'') <> ''";
// //var_dump($sql1);
// $result1 = mysqli_query($conn, $sql1);
$sql1 = "update {$db}.res_fee x set x.frespush = 'T'
where x.fresultdate = date_format(now(),'%Y-%m-%d')
and ifnull(x.frespush,'') <> 'T'";
$result3 = mysqli_query($conn, $sql1);
echo "success";
}
else
{
echo "failure";
}
}
?>
|