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.116.77
<?php
function GenerateCenterAppearingListQPWise($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
$FUNIVCODE = $_SESSION['FUNIVCODE'];
//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);
$qp_frm_date = $aobj_context->mobj_data["qp_frm_date"];
$section = $aobj_context->mobj_data["section"];
$qp_to_date = $aobj_context->mobj_data["qp_to_date"];
$pageeject = $aobj_context->mobj_data["pageeject"];
$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(15,9.5);
$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
//var_dump($FUNIVCODE);
//and sub.FDEGREE=op.FDEGREE
if($section == 'both')
{
$sectionvalue = "";
}
else
{
$sectionvalue = "and subject.fsession like '{$section}'";
}
if($FUNIVCODE == '005' || $FUNIVCODE == '026'|| $FUNIVCODE == '003' || $FUNIVCODE == '032' || $FUNIVCODE == '003U' || $FUNIVCODE == '003D'|| $FUNIVCODE == '017'|| $FUNIVCODE == '034' || $FUNIVCODE == '027' || $FUNIVCODE == '012')
{
$date = "'{$qp_frm_date}' and '{$qp_to_date}' ";
//$date = "date_format(STR_TO_DATE('{$qp_frm_date}', '%d/%m/%Y'),'%Y-%m-%d') and date_format(STR_TO_DATE('{$qp_to_date}', '%d/%m/%Y'),'%Y-%m-%d')";
}else
{
$date = "'{$qp_frm_date}' and '{$qp_to_date}' ";
}
$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 subject.fqpcode, candsum.fcntrcode, case when candsum.fcntrcode=candsum.fcollcode then '0' else candsum.fcollcode end, candsum.fdegree, candsum.fregno) as data_set,
subject.fqpcode as fqpcode from candsum,degree, subject, reason,canddet
left outer join attshort a on a.fdegree = canddet.fdegree and canddet.fexamno = a.fexamno and a.fregno = canddet.fregno and left(a.fsubcode,4) = canddet.fsubcode
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.fcntrcode = '{$college_code}'
and subject.fqpcode between '{$qp_code_start}' and '{$qp_code_end}'
and subject.FDOE between {$date}
and ifnull(a.fregno,'') = ''
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'
{$sectionvalue}
group by subject.fqpcode
order by subject.fdoe,subject.fqpcode,subject.fsession, candsum.fcntrcode, candsum.fcollcode, candsum.fdegree, candsum.fregno";
//var_dump($get_subject_data);
$aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=1000000");
$lobj_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
//print_r($get_subject_data); die();
$pdf->fddate=$lobj_subject_data[0][fddate];
if($pageeject == 'F')
$pdf->AddPage();
//$pdf->Ln();
$pdf->SetFont('Times','',10);
foreach($lobj_subject_data as $key => $value)
{
if($pageeject == 'F')
{
if($pdf->GetY() >260)
{
$pdf->AddPage();
}
}
else
$pdf->AddPage();
$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++;
}
if($pageeject == 'T')
{
$pdf->Ln(15);
$pdf->Cell(150,5,'Total No. of students appearing',1,0,'L');
$pdf->Cell(30,5,$data_set_count,'1',1,'L');
$pdf->Cell(150,5,'Total No. of students Absent','LRB',0,'L');
$pdf->Cell(30,5,'','LRB',1,'L');
$pdf->Cell(150,5,'Total No. of Answer Scripts Dispatched','LRB',0,'L');
$pdf->Cell(30,5,'','LRB',1,'L');
$pdf->Ln(15);
$pdf->Cell(180,5,'Signature of Chief / Office Superintendent','0',1,'R');
$x=$pdf->GetX();
$y=$pdf->GetY();
$pdf->Line($x,$y,$x+184,$y);
$pdf->Cell(180,7,"*Note : Round off reg. no. for absent","0",1,"C");
}else
{
$pdf->Ln(6);
$pdf->Cell(0,5,'Total Student :'.$data_set_count,0,1,'L');
}
}
$pdf->Output("SubjectWiseStudentList.pdf","D");
}
?>
|