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.144.227.3
Current Path : /var/www/html/sms/ |
| Current File : /var/www/html/sms/admission_sms_push_bnu.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 = '042';
$db = 'logisys3_bnu';
if( $db != '' && $univcode != '')
{
$sql1 = "insert ignore into {$commondb}.sendsms(funivcode, fregno, fmobileno, fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype,fupdate)
select distinct '{$univcode}', x.fmobileno, x.fmobileno, 'AI', 'AI',
concat('Message from Bengaluru North University.',CHAR(13),'Dear ', x.fname, ', You are required to submit the admission details online immediately.',CHAR(13),'Visit http://universitysolutions.in/bnu/adm') as fmessage, 'F', 'F', '2018', '2', now()
from {$db}.collstud x
where ifnull(x.fsmspush,'') <> 'T'";
$result1 = mysqli_query($conn, $sql1);
$query = "insert ignore into {$commondb}.sendsms(funivcode, fregno, fmobileno, fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype,fupdate)
SELECT '042',c.fmobile,c.fmobile,'AC','AC',
CONCAT('Message from Bengaluru North 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}.collstud x set x.fsmspush = 'T'
where ifnull(x.fsmspush,'') <> 'T'";
$result3 = mysqli_query($conn, $sql1);
echo "success";
}
else
{
echo "failure";
}
}
?>
|