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.12.76.168
<?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;
class MYPDF extends TCPDF{
public $aobj_context;
public $degreegrp;
public function setData($aobj_context){
$this->aobj_context = $aobj_context;
}
public function Header($aobj_context){
$this->univcode = $this->aobj_context->mobj_data["univcode"];
$bMargin = $this->getBreakMargin();
$auto_page_break = $this->AutoPageBreak;
$this->SetAutoPageBreak(false, 0);
$this->SetTitle("Application Form");
$img_path = $this->aobj_context->main_src . "/img/".$this->univcode."_logo.jpg";
if (file_exists($img_path)) {
$this->Image($img_path, 10,3,30,10);
}
$this->SetFont('Times', 'B', 12);
$this->Ln(5);
$this->Cell(0, 4, $this->aobj_context->funivname, 0, 1, 'C');
$this->SetFont('Times', 'B', 10);
$this->Cell(0, 4, $this->aobj_context->add, 0, 1, 'C');
$this->SetFont('Times', '', 10);
$this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');
// telephone number
$this->SetFont('Times', '', 9);
$this->Cell(0, 4, "TEL- ".$this->aobj_context->telno." ". $website, 0, 1, 'C');
$this->SetAutoPageBreak($auto_page_break, $bMargin);
}
public function Footer(){
$this->SetY(-15);
$this->SetFont('helvetica', 'I', 8);
$this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
class ReprtObject{
public function DefaultConstructor($aobj_context){
$this->aobj_context = $aobj_context;
$univcode = $aobj_context->mobj_data["univcode"];
$this->ip = $_SERVER["REMOTE_ADDR"];
$get_date = "select DATE_FORMAT(now(), '%d/%m/%Y') as now_date";
$obj = $this->aobj_context->mobj_db->GetRow($get_date);
// var_dump($this->aobj_context->mobj_db);die();
$get_coll_name = "select funivname, funivcode, funivadd2,
funivadd1 AS 'state', pdf_logo_path, ftdvs_helplineno as telno,
fadmdec
FROM control";
$lobj_get_coll_name = $this->aobj_context->pobj_db->GetRow($get_coll_name);
$aobj_context->funivname = $lobj_get_coll_name['funivname'];
$aobj_context->s_state = $lobj_get_coll_name['state'];
$aobj_context->add = $lobj_get_coll_name['funivadd2'];
$aobj_context->telno = $lobj_get_coll_name['telno'];
$aobj_context->pdf_logo_path = $lobj_get_coll_name['pdf_logo_path'];
$aobj_context->funivcode = $lobj_get_coll_name['funivcode'];
$aobj_context->admdec = $lobj_get_coll_name['fadmdec'];
$this->current_date = $obj['now_date'];
$this->pdf = new MYPDF('P',PDF_UNIT, PDF_PAGE_FORMAT, true, 'ISO-8859-1', false);
$this->pdf->setData($aobj_context);
}
public function Report($aobj_context){
$app_no = $aobj_context->mobj_data["app_no"];
$univcode = $aobj_context->mobj_data["univcode"];
$query = "select a.fappno,a.fleadid, a.fname, fmobile, femail, if(fgender = 'F', 'Female', 'Male')as fgender,
date_format(fdob, '%d/%m/%Y')as fdob, fcatecode, fnation as nationality,
ffatname
, fmotname, freligion, faadhaarno, concat(a.fdegree, ' - ', fdescpn)as fdegree,
concat(fadd1, ', ', fadd2, ', ', fadd3)as fadd,
s.fname as fstate, fcountry, fpincode,
ifnull(a.faadhaarpath,'') as faadhaarpaths,
ifnull(a.ftenpath,'') as ftenpaths,
ifnull(a.ftwthpath,'') as ftwthpaths,
ifnull(a.ftcpath,'') as ftcpaths,
ifnull(a.fmigpath,'') as fmigpaths,
ifnull(a.fugpath,'') as fugpaths,
ifnull(a.fstdpicpath, '') as fstdpicpath
from adm_stud a inner join adm_state s on s.fid = a.fstate
inner join degree d on d.fdegree = a.fdegree
where fappno ='{$app_no}' group by a.fappno";
$per_details = $this->aobj_context->pobj_db->GetRow($query);
$faadhaarpaths = $per_details['faadhaarpaths'];
$aappno = $per_details['fappno'];
$pdf = $this->pdf;
$pdf->AddPage("P");
$pdf->ln(20);
$pdf->SetFont('Times','',10);
$html = '<h3 style="background-color: #918988; color: rgb(255, 255, 255);">I. Personal Details</h3>';
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->writeHTMLCell(188,0,$x,$y,$html, false,1, false, true, '', false);
$photo_url = "https://qp-tran.s3.ap-south-1.amazonaws.com/";
$table1 = '<style>td{border: 0.5px solid black;} .lable {font-weight: bold;}</style>';
$table1 .= '<table cellpadding="3" cellspacing="0">
<tr nobr="true">
<td width="120" class="lable">Application No.</td>
<td width="300" colspan="3" style = "font-size:15px;">'.$aappno.'</td>
<td width="100" rowspan="5"><img width="100" height="100" src="'.$photo_url.$per_details['fstdpicpath'].'" /></td>
</tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Name of the Applicant</td>
<td width="300" colspan="3">'.$per_details['fname'].'</td></tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Mobile No.</td>
<td width="300">'.$per_details['fmobile'].'</td>
</tr>';
$table1 .= '<tr nobr="true">
<td width="120" class="lable">Email Id</td>
<td width="300">'.$per_details['femail'].'</td>
</tr>';
$table1 .= '<tr nobr="true">
<td width="120" class="lable">Course</td>
<td width="300">'.$per_details['fdegree'].'</td>
</tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Gender </td>
<td width="70">'.$per_details['fgender'].'</td>
<td width="150" class="lable">Date of Birth (DD/MM/YYYY)</td>
<td width="180">'.$per_details['fdob'].'</td>
</tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Nationality </td>
<td width="70">'.$per_details['nationality'].'</td>
<td width="150" class="lable">Aadhaar Number</td>
<td width="180">'.$per_details['faadhaarno'].'</td>
</tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Category</td>
<td width="70">'.$per_details['fcatecode'].'</td>
<td width="150" class="lable">Religion</td>
<td width="180">'.$per_details['freligion'].'</td>
</tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Father Name</td>
<td width="400">'.$per_details['ffatname'].'</td>
</tr>';
$table1 .='<tr nobr="true">
<td width="120" class="lable">Mother Name</td>
<td width="400">'.$per_details['fmotname'].'</td>
</tr>';
$table1 .= '</table>';
$pdf->SetX(11);
$pdf->writeHTML($table1, false, true, false, false, 'L');
$pdf->ln(7);
$html = '<h3 style="background-color: #918988; color: rgb(255, 255, 255);">II. Communication Details</h3>';
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->writeHTMLCell(188,0,$x,$y,$html, false,1, false, true, '', false);
$table2 = '<style>td{border: 0.5px solid black;} .lable {font-weight: bold;}</style>';
$table2 .= '<table cellpadding="3" cellspacing="0">
<tr nobr="true">
<td width="120" class="lable">Address</td>
<td width="400">'.$per_details['fadd'].'</td>
</tr>';
$table2 .= '<tr nobr="true">
<td width="120" class="lable">State</td>
<td width="400">'.$per_details['fstate'].'</td>
</tr>';
$table2 .= '<tr nobr="true">
<td width="120" class="lable">Country</td>
<td width="400">'.$per_details['fcountry'].'</td>
</tr>';
$table2 .= '<tr nobr="true">
<td width="120" class="lable">Pincode</td>
<td width="400">'.$per_details['fpincode'].'</td>
</tr>';
$table2 .= '</table>';
$pdf->SetX(11);
$pdf->writeHTML($table2, false, true, false, false, 'L');
$pdf->ln(7);
$pdf->SetFont('Times','BU',13);
// $pdf->Cell(180,7,'Declaration by the Candidate',0,1,'C');
$pdf->SetFont('Times','',9);
// $pdf->MultiCell(180,4,$this->aobj_context->admdec,0,'J');
// $pdf->Cell(180, 7, 'This report is electronically generated. Student signature is not required.',0,1,'L');
}
public function SendOutput(){
$this->pdf->Output("Acknowledgement.pdf", "I");
}
}
function genrateAppl($aobj_context){
$univcode = $aobj_context->mobj_data["univcode"];
$class_obj = new ReprtObject();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->Report($aobj_context);
$class_obj->SendOutput();
}
|