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.118.24.176
<?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);
include("/var/www/config.php");
//include 'database.php';
//connect to database
$servername = SERVERNAME;
$username = USERNAME;
$password = PASSWORD;
$conn = new mysqli($servername,$username,$password);
if(!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$commondb = "logisys3_comexam";
$unicode = $_GET['univcode'];
if($unicode == '')
{
echo "Univ Code Empty";
die();
}
if($unicode == '027')
{
$db = 'logisys3_rcu';
$ffolder = 'RCUB';
$univcode = '027';
}else if($unicode == '041')
{
$db = 'logisys3_bcu';
$ffolder = 'BCU';
$univcode = '041';
}
else if($unicode == '003')
{
$db = 'logisys3_kus';
$ffolder = 'KUS';
$univcode = '003';
}
else if($unicode == '042')
{
$db = 'logisys3_bnu';
$ffolder = 'BNU';
$univcode = '042';
}
else if($unicode == '023')
{
$db = 'logisys3_dud';
$ffolder = 'dud';
$univcode = '023';
}
else if($unicode == '003D')
{
$db = 'logisys3_kusd';
$ffolder = 'KUSDDE';
$univcode = '003D';
}
else if($unicode == '052')
{
$db = 'logisys3_jssstu';
$ffolder = 'JSS TU';
$univcode = '052';
}else if($unicode == '050')
{
$db = 'logisys3_srun';
$ffolder = 'SRUN';
$univcode = '050';
}
//Result Push data to common databse
if( $db != '' && $univcode != '')
{
$sql1 = "INSERT IGNORE INTO logisys3_comexam.sendsms(funivcode, fregno, fmobileno, fenttype, fsubcode, fmessage, fstatus, fdeleted, fyear, fexamtype,fupdate)
SELECT DISTINCT '{$univcode}', m.fregno, m.fmobileno, 'STPC', 'STPC',
CONCAT('From ','{$ffolder}',': Photo copy (Scanned copy) of answer book is available for downloading in Student Portal / App. Click I NEED HELP for any Queries / Help - Uniclare') AS fmessage,
'F', 'F', '2022', '2', NOW()
FROM logisys3_comexam.masuser m where m.funivcode = '{$univcode}'
and fregno in (select distinct fregno from {$db}.res_stud
where ifnull(fxrpath, '') <> '' and ifnull(fpaymentstatus,'') = 'success'
and ifnull(fxrpush,'') <> 'T')";
$result1 = mysqli_query($conn, $sql1);
if($result1)
{
$sql1 = "update {$db}.res_stud set fxrpush = 'T'
where ifnull(fxrpath, '') <> ''
and ifnull(fpaymentstatus,'') = 'success'
and ifnull(fxrpush,'') <> 'T'";
$result3 = mysqli_query($conn, $sql1);
echo "success";
}
else
{
echo "failure";
}
}
/*if($result2)
{
$query = "select s.funivcode, d.funivname, s.fenttype,count(fmobileno) as pushcount,date_format(left(fupdate,10),'%d.%m.%Y') as pushdate
from {$commondb}.sendsms s
inner join {$commondb}.dbname d
on s.funivcode = d.funivcode
where ifnull(fmobileno,'') <> ''
and ifnull(fstatus,'') = 'F'
and left(fupdate,10) = date_format(now(),'%Y-%m-%d')
and fupdate >= DATE_SUB(now(), interval 2 hour)
and s.funivcode = '{$univcode}'
and s.fenttype = 'RE'
group by s.funivcode,s.fenttype";
$result = mysqli_query($conn, $query);
$count = mysqli_num_rows($result);
if($count > 0)
{
$table = '<table cellspacing="1" cellpadding="2" border="0" align="center" bgcolor="#505151">
<thead>
<tr bgcolor="#e1eaea">
<th>Sl.<br> No.</th>
<th>University <br>Code</th>
<th>University Name</th>
<th>Event <br> Type</th>
<th>Count</th>
<th>Date</th>
</tr>
</thead>';
$i = 1;
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
//var_dump($row);
$table .= "<tr bgcolor='#ffffff' >";
$table .= "<td><center>".$i."</center></td>";
$table .= "<td><center>".$row['funivcode']."</center></td>";
$table .= "<td>".$row['funivname']."</td>";
$table .= "<td><center>".$row['fenttype']."</center></td>";
$table .= "<td align='right'>".$row['pushcount']."</td>";
$table .= "<td><center>".$row['pushdate']."</center></td>";
$table .= "</tr>";
//$sum +=$row['pushcount'];
$i++;
}
$table.="</table>";
$emails = ['prashanth.k@logisys.org','arun.v@logisys.org'];
$subject = "RESULTS SMS DATA UPLOAD STATISTICS";
for($i=0;$i< count($emails); $i++)
{
$emailid = $emails[$i];
//$resp = sendGridMail($emailid,$subject,$table);
//echo $resp;
}
}
echo "success";
}
else
{
echo "failure";
}*/
?>
|