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 : 52.14.125.137
<?php
function getNitteAdmXlreport($aobj_context)
{
session_start();
$collcode=$_SESSION['collcode'];
ini_set('memory_limit','300M');
ini_set('max_execution_time',3300);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$filename = 'admission_list.csv';
$f = fopen('php://output', 'w');
$degree = trim($aobj_context->mobj_data["degree"]);
$colfrom = trim($aobj_context->mobj_data["colfrom"]);
$colto = trim($aobj_context->mobj_data["colto"]);
$db = trim($aobj_context->mobj_data["db"]);
$college_code = $_SESSION['collcode'];
$get_studentInfo = "select c.FUNIVCODE from student s, control c
where s.fcollcode = '{$college_code}' and s.fdegree ='{$degree}'";
$sessionUnivcode = $_SESSION['FUNIVCODE'];
// var_dump($_SESSION['FUNIVCODE']);
// die();
$lobj_get_studentInfo = $aobj_context->mobj_db->getRow($get_studentInfo);
$funicode = $lobj_get_studentInfo['FUNIVCODE'];
if($db =='srun'){
$cnd = "fcurradd1 as fcommadd1, fcurradd2 as fcommadd2,fpevmonth,feligiblityfee,frecpno,frecpno,frecpdate,
fscholership,fdocument,fregfee,fregrecpno,fregrecpdate,FSSCPERC,fblood_group,";
}else{
$cnd = "fcommadd1, fcommadd2,";
}
$query = "select s.fappno, s.fadmyear, s.fslno, s.fdegree, s.fexamno, s.fcollcode, s.fname, ffatname, fmotname, fgender,
fdob, fnationality, freligion, fadmdate, fcaste, fcatecode, faadharno, ffatocc, ffatincome, fmotocc,
fmotincome, fmottong, ftudystate, fmotmob, fmotemail, ffatmob, ffatemail,
ifnull(fcommstate,'') as fcommstate,
ifnull(fperdist,'') as fperdist,
ifnull(s.fseattype, '')as fseattype, s.frollno,
{$cnd} fcommtaluk,
a.subdet as subdets,
ifnull(fnucatno,'') as fnucatno,
ifnull(fstudmob,'') as fstudmob,
ifnull(fstudemail,'') as fstudemail,
ifnull(fnucatrank,'') as fnucatrank,
a.puper,
a.pcmper,
fcommpin, fcommdist, fperadd1, fperadd2, fpertaluk, fperpin, fperstate, fqual, fqregno, fqcollname, fareatype,
fboard, fboardstate, fqyear,if(ifnull(fapprstatus,'') = 'APPROVED',faregno,'') as faregno,fphotopath
from studadm s
left join (select sd.fcollcode,sd.fappno,sd.fdegree,
sum(if(ab.fsubname = 'PU Total',sd.fpercent,0)) as puper,
round(sum(if((ab.fsubname = 'Chemistry' || ab.fsubname = 'Physics' || ab.fsubname = 'Mathematics'),sd.fsecmarks,0)) / sum(if((ab.fsubname = 'Chemistry' || ab.fsubname = 'Physics' || ab.fsubname = 'Mathematics'),sd.fmaxmarks,0))*100,2) as pcmper,
group_concat('Sub. Name: ',ab.fsubname,' Max. Marks: ',sd.fmaxmarks,
' Sec. Marks: ',sd.fsecmarks,
' Percent: ',sd.fpercent,' <br>'
order by ab.forder SEPARATOR ' ') as subdet
From studprevsub sd
inner join admprevsub ab on ab.fdegree = sd.fdegree
and sd.fsubcode = ab.fsubcode
where sd.fcollcode = '{$collcode}' and sd.fdegree = '{$degree}'
group by sd.fappno) a on s.fcollcode = a.fcollcode
and s.fdegree = a.fdegree and s.fappno = a.fappno
where s.fcollcode = '{$collcode}' and s.fdegree='{$degree}'
and ifnull(s.fdeleted,'') <> 'T'
order by ifnull(s.faregno,''),s.fname";
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
$arrW =0;
$subjRow ='';
if(!empty($lobj_get_data))
{
$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
$e_data.="<tr style='height: 25px;'>";
$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Sl. No.</td>";
$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Application No.</td>";
if($univcode != '051'){
$admCnd = "Adm. Year";
}else{
$admCnd = "Roll No.";
}
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>{$admCnd}</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Adm. Date</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Degree</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Exam No</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>College Code</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Name</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Father Name</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Mother Name</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Gender</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Date of Birth</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Nationality</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Religion</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Caste</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Cat. Code</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Adhaar</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Seat Type</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Father Occupation</td>";
if($db != 'srun'){
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >F. Incode</td>";
}
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Mother Occupation</td>";
if($db != 'srun'){
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Mother Income</td>";
}
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Mother Tongue</td>";
// $e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >State</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >M. Mobile</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >M. Email</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >F. Mobile</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >F. Email</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >S. Mobile</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >S. Email</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Address</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Permanent Address</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Qualification</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Q. Reg. No.</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >College Name</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Area Type</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Board</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >State</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Year</td>";
if($db != 'srun'){
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Subjects</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >PCM Percentage</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >PU Percentage</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >NUCAT No</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >NUCAT Rank</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Reg. No.</td>";
}
if($db == 'srun'){
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Previous Percentage</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Eligiblity Fee</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Registration Fee</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Receipt No(Registration Fee)</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Receipt Date(Registration Fee)</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Receipt No</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Receipt Date</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Scholership / Non-Scholership</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Document Submited</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:80px;' >Student Photo</td>";
$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Blood Group</td>";
}
$e_data.="</tr>";
$k=0;
$id=0;
$m=0;
$filename = 'Admission_List';
$a = 1;
foreach($lobj_get_data as $key=>$value)
{
$imageWidth = '40px';
$imageHeight = '40px';
// var_dump($funicode);
// die();
$photo_path = $value['fphotopath'];
$curl3 = curl_init();
if($funicode === NULL){
$univcode = $sessionUnivcode;
}else{
$univcode = $funicode;
}
$photo_url = 'https://university-student-photos.s3.ap-south-1.amazonaws.com'.'/'.$univcode.'/'.$photo_path;
// var_dump($photo_url);
// die();
curl_setopt($curl3, CURLOPT_URL, $photo_url);
curl_setopt($curl3, CURLOPT_NOBODY, true);
$response_photo = curl_exec($curl3);
$httpCode_photo = curl_getinfo($curl3 , CURLINFO_HTTP_CODE);
if(!empty($photo_path))
{
$image_src = $photo_url;
}else{
$image_src = 'images/default_photo.jpg';
}
if($k%2==0)
{
$class='tbl_row';
$inp_class='tbl_row_input';
}
else
{
$input_class='tbl_row1';
$inp_class='tbl_row1_input';
}
$caddress = $value['fcommadd1'].' '.$value['fcommadd2'].'<br>Taluk : '.$value['fcommtaluk'].'<br>Pincode : '.$value['fcommpin'].'<br>District : '.$value['fcommdist'].'<br>State : '.$value['fcommstate'];
$paddress = $value['fperadd1'].' '.$value['fperadd2'].'<br>Taluk : '.$value['fpertaluk'].'<br>Pincode : '.$value['fperpin'].'<br>District : '.$value['fperdist'].'<br>State : '.$value['fperstate'];
$e_data.="<tr style='height: 25px;'>";
// $e_data.="<td style = 'vertical-align:middle;' >{$counter_degree}</td>";
$e_data.="<td style = 'text-align:center;' >{$a}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fappno']}</td>";
if($univcode != '051'){
$admYearCnd = $value['fadmyear'];
}else{
$admYearCnd = $value['frollno'];
}
$e_data.="<td style = 'text-align:center;' >{$admYearCnd}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fadmdate']}</td>";
$e_data.="<td>{$value['fdegree']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fexamno']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fcollcode']}</td>";
$e_data.="<td>{$value['fname']}</td>";
$e_data.="<td>{$value['ffatname']}</td>";
$e_data.="<td>{$value['fmotname']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fgender']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fdob']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fnationality']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['freligion']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fcaste']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fcatecode']}</td>";
$e_data.="<td style = 'text-align:center;' >'{$value['faadharno']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fseattype']}</td>";
$e_data.="<td>{$value['ffatocc']}</td>";
if($db != 'srun'){
$e_data.="<td style = 'text-align:center;' >{$value['ffatincome']}</td>";
}
$e_data.="<td>{$value['fmotocc']}</td>";
if($db != 'srun'){
$e_data.="<td style = 'text-align:center;' >{$value['fmotincome']}</td>";
}
$e_data.="<td style = 'text-align:center;' >{$value['fmottong']}</td>";
// $e_data.="<td style = 'text-align:center;' >{$value['ftudystate']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fmotmob']}</td>";
$e_data.="<td>{$value['fmotemail']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['ffatmob']}</td>";
$e_data.="<td>{$value['ffatemail']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fstudmob']}</td>";
$e_data.="<td>{$value['fstudemail']}</td>";
$e_data.="<td>{$caddress}</td>";
$e_data.="<td>{$paddress}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fqual']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fqregno']}</td>";
$e_data.="<td>{$value['fqcollname']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fareatype']}</td>";
$e_data.="<td>{$value['fboard']}</td>";
$e_data.="<td>{$value['fboardstate']}</td>";
if($db == 'srun'){
$e_data.="<td style = 'text-align:center;' >{$value['fqyear']}-{$value['fpevmonth']}</td>";
}else{
$e_data.="<td style = 'text-align:center;' >{$value['fqyear']}</td>";
}
if($db != 'srun'){
$e_data.="<td >{$value['subdets']}</td>";
$e_data.="<td >{$value['pcmper']}</td>";
$e_data.="<td >{$value['puper']}</td>";
$e_data.="<td >{$value['fnucatno']}</td>";
$e_data.="<td style = 'text-align:center;'>{$value['fnucatrank']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['faregno']}</td>";
}
if($db == 'srun'){
$e_data.="<td style = 'text-align:center;' >{$value['FSSCPERC']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['feligiblityfee']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fregfee']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fregrecpno']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fregrecpdate']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['frecpno']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['frecpdate']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fscholership']}</td>";
$e_data.="<td style = 'text-align:center;' >{$value['fdocument']}</td>";
$e_data.="<td style = 'text-align:center;'><img src='{$image_src}' width='70' height ='70' /></td>";
$e_data.="<td style = 'text-align:center;' >{$value['fblood_group']}</td>";
}
$e_data.="</tr>";
$k++;
$id++;
$a++;
$m++;
// $counter_degree++;
}
$e_data.="</table>";
$arr['total_count']= $m;
$arr['html']=$e_data;
$arr['error']=0;
}
else
{
$arr['html'] = '<p> No record found </p>';
}
header("Content-Type:application/xls");
header("Content-Disposition: attachment; filename={$filename}.xls");
echo $e_data;
}
?>
|