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.117.168.40
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
require_once($pdf_writer_class);
require_once("report_hall_ticket.php");
class applicationFormReport extends TCPDF
{
function formcolldata()
{
$get_coll_name="select FUNIVCODE, FUNIVNAME as 'FUNIVNAME',
FUNIVADD1 as 'state', pdf_logo_path,
ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ
From control";
$lobj_get_coll_name=$this->aobj_context->pobj_db->GetRow($get_coll_name);
$this->FUNIVCODE=$lobj_get_coll_name['FUNIVCODE'];
$this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
$this->s_state=$lobj_get_coll_name['state'];
$this->f_year=$lobj_get_coll_name['f_year'];
$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
$this->FEXAMAPPREQ=$lobj_get_coll_name['FEXAMAPPREQ'];
}
function DefaultConstructor($aobj_context)
{
$this->aobj_context=$aobj_context;
$this->pdf=new TCPDF();
//$this->regno=trim($this->aobj_context->mobj_data["regno"]);
$this->app_no=trim($this->aobj_context->mobj_data["app_no"]);
$this->univcode=trim($this->aobj_context->mobj_data["univcode"]);
$this->ip=$_SERVER["REMOTE_ADDR"];
if($this->univcode == '097')
{
$get_date="select now() as now_date, fregno
from regcandsum where (fappno = '{$this->app_no}' or fregno = '{$this->app_no}')";
}else
{
$get_date="select now() as now_date, fregno
from regcandsum where (fappno = '{$this->app_no}' or fregno = '{$this->app_no}')
and fpaymentstatus = 'success'";
}
//var_dump($get_date);
$obj=$this->aobj_context->pobj_db->GetRow($get_date);
$this->regno = $obj['fregno'];
require_once("getnumword.php");
}
function WriteHallTicket()
{
$aobj_context=$this->aobj_context;
ini_set("memory_limit",-1);
ini_set('max_execution_time',3300);
$class_obj->app_no =$this->app_no;
$get_data="SELECT FAPPNO,FDEGREE,FREGNO,FTOTALFEE,date_format(FLOGDATE,'%d/%m/%Y') as FAPPDATE,
date_format(fdob,'%d/%m/%Y') as dob,
FPAYMENTTYPE,FPAYMENTSTATUS,ftranid as FPAYMENTREMARKS,
DATE_FORMAT(FPAYMENTDATE,'%d/%m/%Y %h:%s:%i %p') as FACKDATE,r.*
FROM regcandsum r
WHERE fregno='{$this->regno}'";
$obj_get_data = $aobj_context->pobj_db->GetRow($get_data);
$PaymentType=$obj_get_data['FPAYMENTYPE'];
$FPAYMENTSTATUS=$obj_get_data['FPAYMENTSTATUS'];
$FPAYMENTREMARKS=$obj_get_data['FPAYMENTREMARKS'];
$FPAYMENTDATE=$obj_get_data['FACKDATE'];
$FTOTALFEE=$obj_get_data['FTOTALFEE'];
$FPAYMENTTYPE = $obj_get_data['FPAYMENTTYPE'];
$query="select r.fregno, r.fdegree, r.fcollcode, s.fname, s.fcaste, d.fexamno, d.ftotsub,
s.ffatname, s.fmotname, d.fdescpn, d.fexamname, concat('[',r.fcollcode,'] ',fcollname, ', ', ftown) as fcollname,
s.fphotopath
from regcandsum r inner join student s on r.fregno = s.fregno
inner join degree d on r.fdegree = d.fdegree and r.fexamno = d.fexamno
inner join college c on s.fcollcode = c.fcollcode
where r.fregno = '{$this->regno}'";
$rst = $aobj_context->pobj_db->GetRow($query);
//var_dump($query);
$pdf=$this->pdf;
$pdf->SetMargins(20,5,35);
$pdf->SetFillColor(248, 248 ,255);
$pdf->SetFont('Times','',10);
$pdf->AddPage("P");
$page_cnt=1;
// var_dump($class_obj->std_arr);
//if(!array_key_exists($reg_v['FREGNO'],$class_obj->receipt_date_arr))
//continue;
$full_photo_path="";
$full_photo_path=trim($aobj_context->main_src."/".$reg_v['photo_path']);
//$pdf->Ln(3);
//$pdf->SetLineWidth(0.01);
$pdf->SetLineWidth(0.01);
$pdf->SetFont('Times','B',15);
$img_path=$aobj_context->main_src."/img/logo_".$aobj_context->pdb['ffolder'].".jpg";
if(file_exists($img_path))
{
if($this->univcode == '097')
$pdf->Image($img_path,15,5,22);
else
$pdf->Image($img_path,15,14,22);
}
if($this->univcode == '097')
{
$pdf->SetFont('Times','B',10);
$str = '<p style = "text-align:center;">PKM EDUCATIONAL TRUST <sup>®</sup></p>';
$pdf->SetX(8);
$pdf->writeHTML($str,'L');
}
if($this->univcode != '097')
{
$pdf->SetFont('Times','B',15);
$pdf->Cell(0,4,$this->FUNIVNAME,0,1,'C');
}
if($this->univcode == '097')
{
$pdf->SetFont('Times','B',13);
$pdf->Cell(0,6,$rst['fcollname'],0,1,'C');
}
else
{
$pdf->SetFont('Times','',9);
$pdf->Cell(0,4,$this->s_state ,'0',1,'C');
}
$pdf->SetFont('Times','',13);
$pdf->Ln(2);
$pdf->Cell(0,6,'Registration Form' ,'0',1,'C');
$pdf->SetFont('Times','',13);
$pdf->Ln(1);
$pdf->SetFont('Times','',13);
$pdf->Cell(0,6,$rst['fdescpn'].' ['.$rst['fdegree'].']',0,1,'C');
$pdf->Ln(2);
$pdf->SetFont('Times','',11);
$full_photo_path = "https://university-student-photos.s3.ap-south-1.amazonaws.com/".$this->FUNIVCODE.'/'.urlencode($rst['fphotopath']);
$stud_image = file_get_contents($full_photo_path);
$pdf->Image('@'.$stud_image,165,40,26,26);
if($this->univcode == '097')
{
$table1 = '<style>
td {
border: 0.5px solid black;
}
</style>
<table cellspacing="0" cellpadding = "2" >';
$table1 .='<tr nobr="true" >
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >App. No.</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['FAPPNO'].' </td>
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >App. Date.</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['FAPPDATE'].' </td>
</tr>';
$table1 .='<tr nobr="true" >
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Reg. No.</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['FREGNO'].' </td>
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >DOB</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['dobrr'].' </td>
</tr>';
$table1 .='<tr nobr="true" >
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Father MOB</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['ffmob'].' </td>
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Mother MOB</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['fmmob'].' </td>
</tr>';
$table1 .='<tr nobr="true" >
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Student MOB</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['fsmob'].' </td>
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Student Email</td>
<td width="150" height="20px" style = "text-align:left;margin-left: 10px;" >'.$obj_get_data['femail'].' </td>
</tr>';
$commdadd = $obj_get_data['fadd1'].' '.$obj_get_data['fadd2'].' '.$obj_get_data['fadd3'].' '.$obj_get_data['fcity'].' '.$obj_get_data['fstate'].' '.$obj_get_data['fpincode'];
$pedadd = $obj_get_data['fperadd1'].' '.$obj_get_data['fperadd2'].' '.$obj_get_data['fperadd3'].' '.$obj_get_data['fpercity'].' '.$obj_get_data['fperstate'].' '.$obj_get_data['fperpincode'];
$table1 .='<tr nobr="true" >
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Communication Address</td>
<td width="425" height="20px" style = "text-align:left;margin-left: 10px;" >'.$commdadd.' </td>
</tr>';
$table1 .='<tr nobr="true" >
<td width="125" height="20px" style = "text-align:left;margin-left: 10px;" >Permanent Address</td>
<td width="425" height="20px" style = "text-align:left;margin-left: 10px;" >'.$pedadd.' </td>
</tr>';
$table1 .= '</table>';
$pdf->SetX(8);
$pdf->writeHTML($table1, true, true, false, false, 'L');
}else
{
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6,' App. No.',0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(40,6,''.$obj_get_data['FAPPNO'],0,0,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6,' App. Date',0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(120,6,''.$obj_get_data['FAPPDATE'],0,1,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6,' Reg. No.',0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(40,6,''.$rst['fregno'],0,0,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6,' Category.',0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(120,6,''.$rst['fcaste'],0,1,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6," Student's Name",0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(120,6,''.$rst['fname'],0,1,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6," Father's Name",0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(120,6,''.$rst['ffatname'],0,1,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6," Mother's Name",0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->Cell(120,6,''.$rst['fmotname'],0,1,'L');
// $pdf->SetFont('Times','B',11);
// $pdf->Cell(30,6,' Course',0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
// $pdf->SetFont('Times','',11);
// $pdf->Cell(120,6,'['.$rst['fdegree'].'] '.$rst['fdescpn'],0,1,'L');
$pdf->SetFont('Times','B',11);
$pdf->Cell(30,6,' College',0,0,'L'); $pdf->Cell(6,6,' : ',0,0,'L');
$pdf->SetFont('Times','',11);
$pdf->MultiCell(150,6,$rst['fcollname'],0,"L");
}
$pdf->Ln(2);
$pdf->SetFont('Times','B',11);
$pdf->Cell(175,6,'Subjects Appearing',1,1,'C');
$pdf->Cell(15,6,"Sl. No.","1",0,"C");
$pdf->Cell(20,6,"Sub. Code","1",0,"C");
$pdf->Cell(140,6,"Subject Title","1",1,"C");
// $pdf->Cell(20,6,"QP Code","1",1,"C");
$pdf->SetFont('Times','',11);
$sl_no=1;
$examno = $rst['fexamno'];
$degree = $rst['fdegree'];
$query2 = "select distinct cd.fsubcode, s.fsubname, ifnull(cd.finserted, 'F') as finserted from regcanddet cd
inner join subject s on cd.fdegree = s.fdegree and cd.fexamno = s.fexamno
and cd.fsubcode = s.fsubcode and ifnull(s.fintass,'') <> 'T'
where cd.fdegree = '{$degree}' and cd.fexamno = '{$examno}'
and cd.fregno = '{$this->regno}' order by s.fprintord, s.fsubcode";
$result2 = $aobj_context->pobj_db->GetAll($query2);
foreach($result2 as $ek)
{
$explode_arr=explode("->",$ek);
$pdf->Cell(15,6, $sl_no,"1",0,"C");
$pdf->Cell(20,6, $ek['fsubcode'],"1",0,"C");
$pdf->Cell(140,6, $ek['fsubname'],"1",1,"L");
// $pdf->Cell(20,6,$explode_arr[3],"1",1,"C");
$sl_no++;
}
if($this->univcode != '097')
{
$query = "select ffeecode, famount from regstudfee where fregno = '{$this->regno}'";
$result2 = $aobj_context->pobj_db->GetAll($query);
$pdf->ln(4);
$pdf->SetFont('Times','B',11);
$pdf->Cell(175,6,'Subjects Appearing',1,1,'C');
$pdf->SetFont('Times','B',10);
$pdf->Cell(15,6,"Sl. No.","1",0,"C");
$pdf->Cell(140,6,"Fee Head","1",0,"C");
$pdf->Cell(20,6,"Amount","1",1,"C");
$pdf->SetFont('Times','',10);
$sl_no = 1;
foreach($result2 as $ek)
{
$explode_arr=explode("->",$ek);
$pdf->Cell(15,6, $sl_no,"1",0,"C");
$pdf->Cell(140,6, $ek['ffeecode'],"1",0,"L");
$pdf->Cell(20,6, $ek['famount'],"1",1,"R");
// $pdf->Cell(20,6,$explode_arr[3],"1",1,"C");
$sl_no++;
}
$pdf->SetFont('Times','B',10);
$pdf->Cell(155,6, "TOTAL","1",0,"L");
$pdf->Cell(20,6, $FTOTALFEE,"1",1,"R");
$pdf->ln(4);
$pdf->SetFont('Times','B',11);
$pdf->Cell(175,6,'Payment Details',1,1,'C');
$pdf->SetFont('Times','',10);
$pdf->Cell(35,6,'Total Fee',1,0,'L');
$pdf->Cell(50,6,"{$FTOTALFEE}/-",1,0,'R');
$pdf->Cell(35,6,'Payment Date',1,0,'L');
$pdf->Cell(55,6,"{$FPAYMENTDATE}",1,1,'L');
$pdf->Cell(35,6,'Transaction id',1,0,'L');
$pdf->Cell(140,6,"{$FPAYMENTREMARKS}",1,1,'L');
$pdf->Cell(35,6,'Payment Type',1,0,'L');
$pdf->Cell(50,6,"{$FPAYMENTTYPE}",1,0,'L');
$pdf->Cell(35,6,'Payment Status',1,0,'L');
$pdf->Cell(55,6,"{$FPAYMENTSTATUS}",1,1,'L');
}
$pdf->ln(20);
$pdf->Cell(35,6,"Date:","10",0,"L");
$pdf->Cell(140,6,"Signature of the Student","10",1,"R");
}
function SendOutput()
{
$this->pdf->Output("application_letter_{$this->app_no}.pdf","I");
}
}
function printRegnAcknowledgement($aobj_context)
{
$aobj_context->pobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new applicationFormReport();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->formcolldata();
$class_obj->WriteHallTicket();
$class_obj->SendOutput();
}
?>
|