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 : 13.59.5.179
<?php
function GenerateMarksEntryReport($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
/*$college_code = '9005';
$degree_code = 'BFT';
$exam_code = 'D'; */
$from_exam = $aobj_context->mobj_data["from_exam"];
$to_exam = $aobj_context->mobj_data["to_exam"];
$from_degree = substr("0000".$aobj_context->mobj_data["from_degree"],-4);
$to_degree = substr("Z000".$aobj_context->mobj_data["to_degree"],-4);
$from_coll = substr("0000".$aobj_context->mobj_data["from_coll"],-5);
$to_coll = substr("ZZZZ".$aobj_context->mobj_data["to_coll"],-5);
$sublist_start = substr("00000".$aobj_context->mobj_data["subwise_start"],-5);
$sublist_end = substr("ZZZZZ".$aobj_context->mobj_data["subwise_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";
$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_general_list.pdf";
$getnumword=$aobj_context->main_src."/src/getnumword.php";
include($getnumword);
// global varibales
$p_count =1;
// end global varibales
// echo getnumber_to_word("001"); die();
include($pdf_writer_class);
$pdf= new FPDF();
$pdf->SetFont('Times','',10);
$pdf->SetMargins(18,15);
$pdf->AliasNbPages();
$coll_list = "select distinct stud.`FCOLLCODE`,stud.FDEGREE,stud.FEXAMNO
from student stud inner join candsum cs on cs.`FREGNO` = stud.`FREGNO`
inner join marks m on m.`FREGNO` = cs.`FREGNO`
and cs.`FYEAR` = m.`FYEAR`
and cs.`FEXAMTYPE` = m.`FEXAMTYPE`
and cs.`FFRESHEXAM` = m.`FEXAMNO`
inner join degree d on d.fdegree = m.`FDEGREE`
and m.`FEXAMNO` = d.`FEXAMNO`
and m.`FYEAR` = d.`FMEYEAR`
and m.`FEXAMTYPE` = d.`FMEEXAMTYP`
where stud.`FCOLLCODE` between '{$from_coll}' and '{$to_coll}'
and m.`FMARKS` = '-1'
and d.`FDEGREE` between '{$from_degree}' and '{$to_degree}'
order by stud.FCOLLCODE";
$lobj_page_collList = $aobj_context->mobj_db->GetAll($coll_list);
foreach($lobj_page_collList as $collKey =>$collValue)
{
$college_code = $collValue[FCOLLCODE];
$degree_code = $collValue[FDEGREE];
$exam_code = $collValue[FEXAMNO];
// 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);
$page_header_degree = "select concat('[ ',FDEGREE,' ] - ', FDESCPN) as Degree_name,
concat('( ', FEXAMNAME ,' Examination ',FEXAMDATE,')') as Exam ,FADYEAR
from degree where FDEGREE = '{$degree_code}' and FEXAMNO='{$exam_code}' ";
$lobj_page_header_degree = $aobj_context->mobj_db->GetRow($page_header_degree);
$page_header_REGROLL = "select FREGROLL from control";
$lobj_page_header_REGROLL = $aobj_context->mobj_db->GetRow($page_header_REGROLL);
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'MARKS_SUBJECTWISEPENDING';
$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'];
$pdf->Degree_name = $lobj_page_header_degree['Degree_name'];
$pdf->Exam = $lobj_page_header_degree['Exam'];
$pdf->AdmissionYear = $lobj_page_header_degree['FADYEAR'];
$pdf->REGROLL=$lobj_page_header_REGROLL['FREGROLL'];
$pdf->RFROM=strtoupper(substr($sublist_start,-4));
$pdf->RTO=strtoupper(substr($sublist_end,-4));
$pdf->REPORT_STATUS = 'IA Marks Pending';
// end header
$get_total_absent= " select m.FSUBCODE,count(distinct m.FREGNO) as total_absent
from marks m inner join student stu on m.FREGNO=stu.FREGNO
inner join subject s on m.FSUBCODE=s.FCSUBCODE
where s.FSSUBCODE=1 and lpad(s.FCSUBCODE,5,'0')>='{$sublist_start}' and lpad(s.FCSUBCODE,5,'0')<='{$sublist_end}'
and m.FDEGREE='{$degree_code}'
and m.FEXAMNO='{$exam_code}'
and m.FCOLLCODE='{$college_code}' and s.FEXAMNO=m.FEXAMNO and m.FDEGREE=s.FDEGREE
and IFNULL(m.FDELETED,'F') ='F'
and m.FMARKS=-2 and ifnull(s.fintass,'F') = 'T'
group by FCSUBCODE order by FCSUBCODE,m.FREGNO";
for($m=0;$m<count($lobj_get_total_absent);$m++)
{
$sub_wise_total_absent[$lobj_get_total_absent[$m]['FSUBCODE']]=$lobj_get_total_absent[$m]['total_absent'];
}
$get_subject_data= " select m.FREGNO, stu.FNAME as Name1,
m.FMARKS as MarksVal1,m.FMARKS2 as MarksVal2,
concat(s.FSUBNAME,',[',FSSUBNAME,']') as sub_name,
ifnull(m.FMARKS,-1) as Marks,
m.FSUBCODE, s.FSMAXMARKS
from marks m inner join student stu on m.fdegree = stu.fdegree and m.FREGNO=stu.FREGNO
inner join subject s on m.FSUBCODE=s.FCSUBCODE
inner join candsum cs on m.FREGNO = cs.FREGNO
and cs.FYEAR = m.FYEAR
and cs.FEXAMTYPE = m.FEXAMTYPE
and cs.FFRESHEXAM = m.FEXAMNO
where lpad(s.FCSUBCODE,5,'0')>='{$sublist_start}' and lpad(s.FCSUBCODE,5,'0')<='{$sublist_end}'
and m.FDEGREE='{$degree_code}'
and m.FEXAMNO='{$exam_code}'
and m.FCOLLCODE='{$college_code}' and s.FEXAMNO=m.FEXAMNO and m.FDEGREE=s.FDEGREE
and IFNULL(m.FDELETED,'F') ='F'
and m.FMARKS = '-1'
and stu.FEXAMNO between '{$from_exam}' and '{$to_exam}'
group by FCSUBCODE,m.FREGNO order by FCSUBCODE,m.FREGNO;
";
$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
$pdf->Subject_name=$lobj_get_subject_data[0]['FSUBCODE'].' '.$lobj_get_subject_data[0]['sub_name'].', Max: '.$lobj_get_subject_data[0]['FSMAXMARKS'];
$page_header_FEEZEDorNOT = "select if(FMESTATUS{$exam_code} like '%{$lobj_get_subject_data[0]['FSUBCODE']}%','FREEZED (READY TO SEND TO UNIVERSITY)','FREEZING PENDING (TO BE SENT TO UNIVERSITY AFTER FREEZING)') SUB_FREEZ_ADMIN ,
if(FCMESTATUS is null,'',concat('CONFIRMED(',FCMESTATUS,')')) as MESTATUS
from colldeg where fcollcode='{$college_code}'
and fdegree='{$degree_code}'
";
$lobj_page_header_FEEZEDorNOT = $aobj_context->mobj_db->GetRow($page_header_FEEZEDorNOT);
$pdf->SetFont('Times','',10);
$Count_subject=1;
$DUP_FCSUBCODE='';
$pdf->page_absent_count=0;
$pdf->total_absent_count=0;
$count=0;
$countVal=0;
$DUP_FCSUBCODE=$lobj_get_subject_data[0]['FSUBCODE'];
$row_cnt=0;
$MismatchSign=0;
$MismatchStart=0;
// Subject wise Marks List Generator.
$pdf->AddPage();
foreach($lobj_get_subject_data as $key => $value)
{
if($DUP_FCSUBCODE==$value['FSUBCODE'])
{
$pdf->Cell(10,6,$Count_subject++,0,0,'C');
$pdf->Cell(20,6,$value['FREGNO'],0,0,'L');
$pdf->Cell(70,6,$value['Name1'],0,0,'L');
$pdf->Cell(40,6,$value['Marks'],0,1,'L');
$count++;
$row_cnt++;
if(($row_cnt) > 30)
{
$pdf->SetFont('Times','',10);
$pdf->SetMargins(18,15);
$pdf->AddPage();
$row_cnt=0;
}
}
else if($count > 0)
{
$pdf->Subject_name=$value['FSUBCODE'].' '.$value['sub_name'].', Max: '.$value['FSMAXMARKS'];
// for header -> subject freezed or not
$page_header_FEEZEDorNOT = "select if(FMESTATUS{$exam_code} like '%{$value['FSUBCODE']}%','FREEZED (READY TO SEND TO UNIVERSITY)','FREEZING PENDING (TO BE SENT TO UNIVERSITY AFTER FREEZING)') SUB_FREEZ_ADMIN ,
if(FCMESTATUS is null,'',concat('CONFIRMED(',FCMESTATUS,')')) as MESTATUS
from colldeg where fcollcode='{$college_code}'
and fdegree='{$degree_code}'
";
$lobj_page_header_FEEZEDorNOT = $aobj_context->mobj_db->GetRow($page_header_FEEZEDorNOT);
$DUP_FCSUBCODE=$value['FSUBCODE'];
$Count_subject=1;
$row_cnt=0;
$pdf->Ln(6);
$pdf->SetFont('Arial','',8);
$pdf->Cell(50,3,"Date : {$pdf->date_1}",'0',1,'L');
/* $pdf->Ln(8);
$pdf->Cell(50,3,'Signature of the Teaching Faculty','0',0,'L');
$pdf->Cell(120,3,'Signature of the H.O.D','0',1,'R');
$pdf->Ln(8);
$pdf->Cell(170,3,'Signature of the Principal','0',1,'R'); */
$pdf->Ln(3);
$pdf->AddPage();
$pdf->Cell(10,6,$Count_subject++,0,0,'C');
$pdf->Cell(20,6,$value['FREGNO'],0,0,'L');
$pdf->Cell(70,6,$value['Name1'],0,0,'L');
$pdf->Cell(5,6,$value['Marks'],0,1,'C');
}
}
// End of Subject wise Marks List Generator.
// Footer of Each Page.
$pdf->Ln(6);
$pdf->SetFont('Arial','',8);
$pdf->Cell(50,3,"Date : {$pdf->date_1}",'0',1,'L');
$pdf->Ln(8);
/* $pdf->Cell(50,3,'Signature of the Teaching Faculty','0',0,'L');
$pdf->Cell(120,3,'Signature of the H.O.D','0',1,'R');
$pdf->Ln(8);
$pdf->Cell(170,3,'Signature of the Principal','0',1,'R'); */
$pdf->Output("report_IApending_wise.pdf","D");
}
}
?>
|