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.119.166.141
<?php
function GenerateAppearingListQPWise($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
//echo $college_code;
$qp_code_start = substr("0000000000".$aobj_context->mobj_data["qp_code_start"],-5);
$qp_code_end = substr("ZZZZZZZZZZ".$aobj_context->mobj_data["qp_code_end"],-5);
$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
$main_src=$main_src_obj[1];
$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
$tarkaheader=$aobj_context->main_src."/Report_details/tarkaheader.php";
$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_admission_list.pdf";
// global varibales
$p_count =1;
// end global varibales
include($pdf_writer_class);
$pdf= new FPDF();
//$pdf->$title='20000 Leagues Under the Seas';
$pdf->SetFont('Times','',10);
$pdf->SetMargins(14,17);
$pdf->AliasNbPages();
$sub_degree_cond="";
if(!empty($sub_degree_code))
{
$sub_degree_cond=" and s.FSUBDEGREE='{$sub_degree_code}'";
$page_header_sub_degree = "select concat('[',FDEGREE,'] - ', FDESCPN) as sub_degree_name, FADYEAR
from degree where FDEGREE = '{$sub_degree_code}' and FEXAMNO='{$exam_no}' ";
$lobj_page_header_sub_degree = $aobj_context->mobj_db->GetRow($page_header_sub_degree);
}
//print_r($lobj_page_header_sub_degree); die();
/* $degree_cond=" ";
if(strtolower($exam_no)=='c')
$degree_cond=" s.FSUBDEGREE='{$degree_code}' "; */
// query for the page header
$page_header_university = "select FUNIVNAME,FTOWN, date_format(now(),'%d/%m/%Y') as date from control";
$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
$page_header_college ="select concat('[',FCOLLCODE,'] ',FCOLLNAME,', ',FTOWN) as college_name
from college where FCOLLCODE='{$college_code}'";
$lobj_page_header_college = $aobj_context->mobj_db->GetRow($page_header_college);
//echo $page_header_degree; die();
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'AppearListQpWise';
$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
$pdf->FTOWN = $lobj_page_header_university[FTOWN];
$pdf->date_1 = $lobj_page_header_university['date'];
$pdf->college_name = $lobj_page_header_college['college_name'];
//echo $pdf->sub_degree_code; die();
//end header
//and sub.FDEGREE=op.FDEGREE
$get_subject_data= "Select subject.fqpcode,canddet.fdegree,degree.fexamdate as fddate, subject.fcsubcode as fsubcode ,
concat(subject.fsubname,' ', subject.fssubname) as fsubname,
subject.fsubshort as fsubshort, date_format(subject.fdoe,'%d/%m/%Y') as fdoe, reason.fdescpn as fsession ,
GROUP_CONCAT(candsum.fregno order by candsum.fregno) as data_set,
subject.fqpcode as fqpcode
from candsum, canddet, degree, subject, reason
where candsum.fdegree = canddet.fdegree
and candsum.fcollcode = canddet.fcollcode
and candsum.fregno = canddet.fregno
and canddet.fdegree = degree.fdegree
and canddet.fexamno = degree.fexamno
and candsum.fyear = degree.fmeyear
and candsum.fexamtype = degree.fmeexamtyp
and canddet.fdegree = subject.fdegree
and canddet.fexamno = subject.fexamno
and canddet.fsubcode = subject.fsubcode
and subject.fsession = reason.freasoncd
and candsum.fcollcode = '{$college_code}'
and subject.fqpcode between '{$qp_code_start}' and '{$qp_code_end}'
and ifnull(candsum.ftotalfee,0) > 0 and ifnull(canddet.fpassmth,'') =''
and ifnull(subject.ftheory,'F') = 'T' and ifnull(subject.fintass,'F') <> 'T'
and ifnull(canddet.fpresent,'') = 'P'
group by subject.fqpcode
order by subject.fqpcode, candsum.fcollcode, candsum.fdegree, candsum.fregno";
$aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=1000000");
$lobj_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
//var_dump($get_subject_data);
//print_r($get_subject_data); die();
$pdf->fddate=$lobj_subject_data[0][fddate];
$pdf->AddPage();
//$pdf->Ln();
$pdf->SetFont('Times','',10);
foreach($lobj_subject_data as $key => $value)
{
$fqpcode = $value['fqpcode'];
$page_header_degree = "select concat(sub.FQPCODE,' - ', sub.FSUBNAME, space(2), '( ',sub.FSSUBNAME,' )') as qp_code
from subject sub
where fqpcode = '{$fqpcode}' ";
$lobj_page_header_degree = $aobj_context->mobj_db->GetRow($page_header_degree);
$pdf->qp_code = $lobj_page_header_degree['qp_code'];
$fsubcode = $value['fsubcode'];
$fqpcode = $value['fqpcode'];
$fsession = $value['fsession'];
$data_set = $value['data_set'];
$fsubname = $value['fsubname'];
$fdoe = $value['fdoe'];
$fsubshort = $value['fsubshort'];
$pdf->SetFont('Times','',12);
$pdf->Cell(0,6,'Subject :'.$pdf->qp_code,0,1,'C');
$pdf->Cell(0,5,'Date and Session : '.$fdoe .' '.$fsession,0,1,'C');
$data_arr=(explode(",",$data_set));
$pdf->Ln(5);
$count=0;
//print_r( $data_arr); die();
$data_set_count =count($data_arr);
for($i=0;$i<$data_set_count;$i++)
{
if($count==6)
{
$pdf->Ln(5);
$count=0;
}
$pdf->SetFont('Times','',12);
$pdf->Cell(30,5,$data_arr[$i],1,0,'C');
$count++;
}
//$pdf->SetFont('Times','',10);
$pdf->Ln(6);
$pdf->Cell(0,5,'Total Student :'.$data_set_count,0,1,'L');
$pdf->Ln(10);
//$pdf->AddPage();
}
$pdf->Output("SubjectWiseStudentList.pdf","D");
}
?>
|