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


Current Path : /var/www/html/sms/
Upload File :
Current File : /var/www/html/sms/import_data.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);
include("/var/www/config.php");
//connect to database
// $servername = "logisys.cluster-cv9maxyrxjgg.ap-south-1.rds.amazonaws.com";
// $username   = "admin";
// $password  = "Logisys2104";
$servername = SERVERNAME;
$username   = USERNAME;
$password  = PASSWORD;
$conn = new  mysqli($servername,$username,$password);

if(!$conn) 
{
    die("Connection failed: " . mysqli_connect_error());
}


$sql1 = "insert ignore into logisys3_dypatil.student(fdegree,fexamno,fcollcode,fname,ffatname,fmotname,fregno)
select fdegree,fexamno,fcollcode,fname,ffatname,fmotname,fsanno 
from logisys3_dypatil.studadm
where fdegree = 'TEST1'";
// var_dump($sql1);
$result1 = mysqli_query($conn, $sql1);

$sql1 = "insert ignore into logisys3_comexam.pushstud
select '051', fregno, fdegree, fcollcode, fname, fsex, fdob, NULL, NULL, fcaste, ffatname, fmotname,'900',NULL 
from logisys3_dypatil.student where fdegree = 'TEST1'";
// var_dump($sql1);
$result1 = mysqli_query($conn, $sql1);


$sql1 = "insert ignore into logisys3_dypatil.candsum(fdegree,fexamno,fcollcode,fregno,fappeara,ffreshexam,
fcntrcode,fyear,fexamtype)
select distinct fdegree,fexamno,fcollcode,fregno,'A','A',fcollcode,'2024','1' 
from logisys3_dypatil.student where fdegree like 'TEST1'";
// var_dump($sql1);
$result1 = mysqli_query($conn, $sql1);

$sql1 = "insert ignore into logisys3_dypatil.canddet(fdegree,fexamno,fcollcode,fregno,fsubcode,fyear,fexamtype)
select distinct st.fdegree,st.fexamno,st.fcollcode,st.fregno,s.fsubcode,'2024','1' 
from logisys3_dypatil.student st 
inner join logisys3_dypatil.subject s on st.fdegree = s.fdegree 
and s.fexamno = st.fexamno
where st.fdegree like 'TEST1'
and s.fmandatory = 'T'";
// var_dump($sql1);
$result1 = mysqli_query($conn, $sql1);

$sql1 = "insert ignore into logisys3_dypatil.marks (FDEGREE, FEXAMNO, FCOLLCODE, FREGNO, FSUBCODE, fmarks, fyear, fexamtype)
select c.fdegree,c.fexamno,c.fcollcode,c.fregno,
s.fcsubcode,'-1', c.fyear,c.fexamtype
from logisys3_dypatil.canddet c inner join logisys3_dypatil.subject s on c.fdegree = s.fdegree 
and c.fexamno = s.fexamno 
and c.fsubcode = s.FSUBCODE	
where c.fdegree = 'test1'
and s.fintass = 'T' and ifnull(s.FCODENO,'F') = 'F'";
$result1 = mysqli_query($conn, $sql1);

$sql1 = "insert ignore into logisys3_dypatil.collia(fdegree,fexamno,fcollcode,fsubcode,FCREATEUSER)
select distinct fdegree,fexamno,fcollcode,fsubcode,'A' from logisys3_dypatil.marks";
$res2 = mysqli_query($conn, $sql1);

$sql1 = "insert ignore into logisys3_dypatil.attend (fcollcode, fdegree, fexamno, fsubcode,fregno,fyear, fexamtype)
select cd.fcollcode, cd.fdegree, cd.fexamno, s.fcsubcode,cd.fregno, cd.fyear, cd.fexamtype
from logisys3_dypatil.canddet cd inner join logisys3_dypatil.subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
and cd.fsubcode = s.fsubcode
where cd.fdegree = 'test1'
and ifnull(s.fattent,'F') = 'T'
group by cd.fcollcode, cd.fdegree, cd.fexamno,cd.fregno,s.fcsubcode";
$result1 = mysqli_query($conn, $sql1);

if($result1)
{
	
	echo "success";
}
else
{	
	echo "failure";
}	


?>